Keith2 / lowendscript-ng

20 stars 10 forks source link

nginx can't restart #2

Open zxflyjia opened 12 years ago

zxflyjia commented 12 years ago

root@vps:~# /etc/init.d/nginx restart Restarting nginx: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] still could not bind() nginx.

But port 80 is not occupied,no nginx process

Keith2 commented 12 years ago

Have you run the optional custom option?

If not change /etc/nginx/sites-available/default tp

server { listen 80 default_server; ## listen for ipv4 listen [::]:80 default_server ipv6only=on; ## listen for ipv6 servername ; access_log /var/log/nginx/default.log; return 444; }

This needs moving from the custom option to the nginx option.

On Fri, 13 Apr 2012 05:56:21 +0100, zxflyjia
reply@reply.github.com
wrote:

root@vps:~# /etc/init.d/nginx restart Restarting nginx: nginx: [emerg] bind() to [::]:80 failed (98: Address
already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] still could not bind() nginx.

But port 80 is not occupied,no nginx process


Reply to this email directly or view it on GitHub: https://github.com/Keith2/lowendscript-ng/issues/2

Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

zxflyjia commented 12 years ago

I'm sorry I still do not understand server { the listen 80 default_server; # # listen for ipv4 listen [::]: 80 default_server ipv6only = on; # # listen for ipv6 the servername ; , access_log / var / log / nginx / default.log; the return 444; } this added to the / etc / nginx / nginx.conf?

Keith2 commented 12 years ago

This replaces the file /etc/nginx/sites-available/default

On Fri, 13 Apr 2012 08:20:27 +0100, zxflyjia
reply@reply.github.com
wrote:

I'm sorry I still do not understand server { the listen 80 default_server; # # listen for ipv4 listen [::]: 80 default_server ipv6only = on; # # listen for ipv6 the servername ; , access_log / var / log / nginx / default.log; the return 444; } this added to the / etc / nginx / nginx.conf?


Reply to this email directly or view it on GitHub: https://github.com/Keith2/lowendscript-ng/issues/2#issuecomment-5109674

Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

zxflyjia commented 12 years ago

I replaces the file /etc/nginx/sites-available/default server { listen 80 default_server; ## listen for ipv4 listen [::]:80 default_server ipv6only=on; ## listen for ipv6 server_name www.mydomain.com; access_log /var/log/nginx/default.log; return 444; } but didn‘t open the website

zxflyjia commented 12 years ago

can you shouw me a example .conf or send by email

Keith2 commented 12 years ago

The script can set up an example conf

bash setup-debian.conf domain example.com

This will create /etc/nginx/sites-available/example.com with the contents

server { listen 80; listen [::]:80; server_name www.example.com; rewrite ^(.*) http://example.com$1 permanent; }

server { listen 80; listen [::]:80; server_name example.com ipv4.example.com ipv6.example.com; access_log /var/log/nginx/example.com.log main; include standard.conf;

include fastcgi_php;

     include nophp.conf;

include fcgiwrap.conf;

     include nocgi.conf;
     include disallow.conf;
     root /var/www/example.com;
     index index.html;

}

On Fri, 13 Apr 2012 08:42:22 +0100, zxflyjia
reply@reply.github.com
wrote:

can you shouw me a example .conf or send by email


Reply to this email directly or view it on GitHub: https://github.com/Keith2/lowendscript-ng/issues/2#issuecomment-5109920

Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

zxflyjia commented 12 years ago

bash setup-debian.conf domain mydomain.com but there has nothing in /etc/nginx/sites-available/

Keith2 commented 12 years ago

Sorry, mistyped the command, it should be

bash setup-debian.sh domain mydomain.com

Run this from the same directory you have setup-debian.sh in.

On Fri, 13 Apr 2012 09:15:02 +0100, zxflyjia
reply@reply.github.com
wrote:

bash setup-debian.conf domain mydomain.com but there has nothing in /etc/nginx/sites-available/


Reply to this email directly or view it on GitHub: https://github.com/Keith2/lowendscript-ng/issues/2#issuecomment-5110341

Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

zxflyjia commented 12 years ago

root@vps:~# bash setup-debian.sh domain mydomain.com Reloading nginx configuration: nginx. root@vps:~# /etc/init.d/nginx restart Restarting nginx: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] still could not bind() nginx.

bash setup-debian.sh domain mydomain.com it's work

but nginx can't restart root@vps:~# netstat -ntpl Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 20039/mysqld tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 17731/master tcp6 0 0 :::1234 :::* LISTEN 17620/xinetd root@vps:~#

zxflyjia commented 12 years ago

To modify nginx.conf file?

Keith2 commented 12 years ago

Do not modify nginx.conf

On Fri, 13 Apr 2012 10:08:31 +0100, zxflyjia
reply@reply.github.com
wrote:

To modify nginx.conf file?


Reply to this email directly or view it on GitHub: https://github.com/Keith2/lowendscript-ng/issues/2#issuecomment-5111086

Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

zxflyjia commented 12 years ago

so how to solve? the website still failed to open

Keith2 commented 12 years ago

Have you setup DNS A records for the website?

On Fri, 13 Apr 2012 10:13:48 +0100, zxflyjia
reply@reply.github.com
wrote:

so how to solve? the website still failed to open


Reply to this email directly or view it on GitHub: https://github.com/Keith2/lowendscript-ng/issues/2#issuecomment-5111162

Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

zxflyjia commented 12 years ago

yeah i have setup DNS A records for the website

zxflyjia commented 12 years ago

Need to be modified into a nameserver.?

Keith2 commented 12 years ago

The A records have to be created in a nameserver. You may also have to wait for dns propagation for the changes to take
effect.

On Fri, 13 Apr 2012 10:34:22 +0100, zxflyjia
reply@reply.github.com
wrote:

Need to be modified into a nameserver.?


Reply to this email directly or view it on GitHub: https://github.com/Keith2/lowendscript-ng/issues/2#issuecomment-5111464

Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

zxflyjia commented 12 years ago

thaks a lot

zxflyjia commented 12 years ago

i wish that A records

zxflyjia commented 12 years ago

i have to be created in a nameserver. but it isn‘t work

dmrzh commented 11 years ago

I have same problem

dmrzh commented 11 years ago

I solve this problem adding ipv6only=on; to listen [::]:80;
in /etc/nginx/sites-available/myserver.conf as described http://stackoverflow.com/questions/14972792/nginx-nginx-emerg-bind-to-80-failed-98-address-already-in-use

Keith2 commented 11 years ago

ipv6only=on was coded although in the wrong place, now moved from the custom option to the nginx option.