Can't start nginx
Andreas Vieten
lists at ruby-forum.com
Sat Jul 11 19:13:20 MSD 2009
Hello,
I've tried a serveral times to start nginx but it always ends with no
happy end.
Download and compiling is no problem for me.
So here goes my way that i do it:
1) cd /tmp
wget wget http://sysoev.ru/nginx/nginx-0.7.61.tar.gz
tar xvfz nginx-0.7.61.tar.gz
cd nginx-0.7.61
./configure \
--prefix=/usr \
--conf-path=/etc/nginx/nginx.conf \
--http-log-path=/var/log/nginx/access_log \
--error-log-path=/var/log/nginx/error_log \
--pid-path=/var/run/nginx.pid \
--http-client-body-temp-path=/var/tmp/nginx/client \
--http-proxy-temp-path=/var/tmp/nginx/proxy \
--http-fastcgi-temp-path=/var/tmp/nginx/fastcgi \
--with-md5-asm --with-md5=/usr/include \
--with-http_realip_module \
--with-http_ssl_module \
--with-http_stub_status_module
make
make install
2) vi /etc/init.d/nginx
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
### END INIT INFO
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/sbin/nginx
NAME=nginx
DESC=nginx
test -x $DAEMON || exit 0
# Include nginx defaults if available
if [ -f /etc/default/nginx ] ; then
. /etc/default/nginx
fi
set -e
case "$1" in
start)
echo -n "Starting $DESC: "
start-stop-daemon --start --quiet --pidfile
/usr/local/nginx/logs/nginx.pid --exec $DAEMON -- $DAEMON_OPTS
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon --stop --quiet --pidfile
/usr/local/nginx/logs/nginx.pid --exec $DAEMON
echo "$NAME."
;;
restart|force-reload)
echo -n "Restarting $DESC: "
start-stop-daemon --stop --quiet --pidfile
/usr/local/nginx/logs/nginx.pid --exec $DAEMON
sleep 1
start-stop-daemon --start --quiet --pidfile
/usr/local/nginx/logs/nginx.pid --exec $DAEMON -- $DAEMON_OPTS
echo "$NAME."
;;
reload)
echo -n "Reloading $DESC configuration: "
start-stop-daemon --stop --signal HUP --quiet --pidfile
/usr/local/nginx/logs/nginx.pid --exec $DAEMON
echo "$NAME."
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
3) chmod 755 /etc/init.d/nginx
4) /etc/init.d/nginx start
But it won't start because of this error here:
(root)-(/tmp/nginx-0.7.61) $ /etc/init.d/nginx start
/etc/init.d/nginx: line 1: N: command not found
--
Posted via http://www.ruby-forum.com/.
More information about the nginx
mailing list