nginx restart problems
-
Hi i have installed nginx correctly and if I type in my IP address it goes to the nginx start page I am now trying to load some domains etc and get the following problem when i try to reload ngincx:
sudo /etc/init.d/nginx restart
/etc/init.d/nginx: line 20: [: 67: binary operator expected
/etc/init.d/nginx: line 21: ^G: command not found
/etc/init.d/nginx: line 22: ^X: command not found
Restarting nginx: nginx.When I load my new domain website I get the nginx homepage not the website I have created.
Can anyone help me with this
cheers rich
Posted 1 year ago # -
Hi Richard,
This will be a configuration issue of some kind .. what Nginx version are you using, there's always a chance something has changed
.. but the errors point to the init script so I'd try recopying and pasting that too.
Something else, for some reason or other, sometimes it's better to use:-
/etc/init.d/nginx stop
/etc/init.d/nginx start.. rather than restart .. in fact try that first!
Posted 1 year ago # -
Hi olly im using nginx 7.0.65 and when i try with the previous i get this message:
/etc/init.d/nginx start
/etc/init.d/nginx: line 20: [: 67: binary operator expected
/etc/init.d/nginx: line 21: ^G: command not found
/etc/init.d/nginx: line 22: ^X: command not found
Starting nginx: 2010/05/24 17:24:04 [warn] 12787#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1
2010/05/24 17:24:04 [emerg] 12787#0: open() "/var/log/nginx/error.log" failed (13: Permission denied)
nginx.any ideas??
I really appreciate your help
Rich
Posted 1 year ago # -
** please don't dup posts, have deleted the other! **
ok Rich, i suspect you've got some kind of a copy/paste error but I may be wrong
.. let's try this .. go here:-
http://vpsbible.com/web-servers/install-nginx-not-apache/
and scroll to section .. Have Nginx Start, Restart or Stop When Required
like it says, open the file:-
sudo nano /etc/init.d/nginx
and please post the content here so I can take a look. appreciated.
now close the file using CTRL-X
and delete it:-
sudo rm /etc/init.d/nginx
and we'll try recreating that file so, like it says in:-
Have Nginx Start, Restart or Stop When Required
.. create the file (well, recreate):-
sudo nano /etc/init.d/nginx
and copy/paste from the code box just below that command .. be sure to open the code into it's own popup first so you don't copy the line numbers .. sorry, you probably know that.
now have another go restarting nginx:-
sudo /etc/init.d/nginx start
sudo /etc/init.d/nginx stop
sudo /etc/init.d/nginx restart.. er, yep, I should have give you that as a super-user command before, though that wasn't the issue anyway by the looks of it.
if it was some syntax issue and you can help me to diagnose that to make instructions clearer for others I'd be grateful.
otherwise, spew out whatever errors and i'll have another think.
.. i suppose you created the default vhost? have you got some spiel that begins "server {" if you go:-
cat /usr/local/nginx/sites-available/default
otherwise, tell me, did you install with the individual tutorials or the stackscript?
ok .. try that lot and report back
Posted 1 year ago # -
Hi sorry about the dup.
the content for that file is as follows:
#! /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 INFOPATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/sbin/nginx
NAME=nginx
DESC=nginxtest -x $DAEMON || exit 0
# Include nginx defaults if available
if [ -f /etc/default/nginx ] ; then
. /etc/default/nginx
fiset -e
case "$1" in
start)
echo -n "Starting $DESC: "
start-stop-daemon --start --quiet --pidfile /usr/local/nginx/logs/$NAME.pid \
--exec $DAEMON -- $DAEMON_OPTS
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon --stop --quiet --pidfile /usr/local/nginx/logs/$NAME.pid \
--exec $DAEMON
echo "$NAME."
;;restart|force-reload)
echo -n "Restarting $DESC: "
start-stop-daemon --stop --quiet --pidfile \
/usr/local/nginx/logs/$NAME.pid --exec $DAEMON
sleep 1
start-stop-daemon --start --quiet --pidfile \
/usr/local/nginx/logs/$NAME.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/$NAME.pid \
--exec $DAEMON
echo "$NAME."
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
exit 1
;;
esacexit 0
when i try to restart i get the following message:
savvy@mail~ $ sudo /etc/init.d/nginx start
Starting nginx: [emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: still could not bind()
savvy@mail~ $with the cat.... thing i get the following message:
savvy@mail~ $ cat /usr/local/nginx/sites-available/default
server {
listen 80;
server_name localhost;location / {
root html;
index index.php index.html index.htm;
}# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html
{
root html;
}
}savvy@mail~ $
I installed with the stackscript however i accidentally missed out the ip tables one but did it retrospectively.
When i go to the domain that should be live all i get is the nginx homepage (savvywebsites.co.uk)
should i reformat the server and just start again or should i pursue it further.
Also with regard to emails how do you set up individual email addresses ie:
example1@waywiderweb.com
example2@waywiderweb.com
example3@waywiderweb.com.Thankyou so much for your help
Posted 1 year ago # -
Sorry I did individual installs not the stackscript but I am going to try the stackscript now and will let you know how i get on.
Posted 1 year ago # -
k Rich .. so, no dice with that change to the init.d file?
Posted 1 year ago # -
I think i've got to the bottom of the problem, i'm using a co.uk domain (because i'm cheap) and i think i have to change the following file:
sudo nano /usr/local/nginx/sites-available/waywiderweb.com
to the second example you gave on http://vpsbible.com/web-servers/serve-multiple-sites-blogs-with-virtual-hosts/
so the re-write is http://www.waywiderweb.com, this has solved my problems with it i just need to load all my websites now, i've got about 40 ready to go so lots of work.
the stackscript was really helpful, i think you should look to make it more prominent on the website, if you get some free time.
I really do appreciate all the help with this olly, your a gent and a scholar.
With regard to email how do i set up multiple email addresses i.e:
example1@email.com
example2@email.com
example3@email.comand
example1@internet.com
example2@internet.com
example3@internet.comOnce again thankyou so much for all your help, if theres ever anything i can do to help please email me at richardcliffe101@hotmail.co.uk.
kind regards
RichPosted 1 year ago # -
er, just saw this Richard .. (thank you)
.. well, what I'd tend to recommend for the email is simply to set up a bunch of catch-all's at Google Apps.
the bible's postfix/RDNS section has allowed for this functionality.
40 domains though .. hmmn .. maybe a mail server would suit better, a separate box.
Posted 1 year ago #
Reply
You must log in to post.
Want HTML?
a blockquote code em strong ul ol liPlace code between backticks `codeHere`
You've got it.
