Welcome! Log In Create A New Profile

Advanced

Can't start nginx

Andreas Vieten
July 11, 2009 11:13AM
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/.
Subject Author Posted

Can't start nginx

Andreas Vieten July 11, 2009 11:13AM

Re: Can't start nginx

Maxim Dounin July 13, 2009 07:52AM

Re: Can't start nginx

Robert Gabriel July 13, 2009 08:14AM

Re: Can't start nginx

AndiV74 July 13, 2009 12:31PM

Re: Can't start nginx

Andreas Vieten July 13, 2009 05:23PM

Re: Can't start nginx

Robert Gabriel July 14, 2009 04:33AM

Re: Can't start nginx

Robert Gabriel July 14, 2009 04:32AM

Re: Can't start nginx

Amin MG January 17, 2014 09:24AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 167
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready