Nginx前端占用80端口, Apache后端占用8080端口。 在测试服务器上一直稳定运行了一个星期,今天重启了一下服务器,发现httpd强制占用80端口,nginx启动不了,我停止了httpd,启动nginx并在占用了80,然后启动httpd,但httpd启动失败。我查看了httpd.conf和vhost下面的配置文件,都是Listen 127.0.0.1:8080 请问有人知道这是什么原因吗? [root@mkx conf]# service httpd start Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName (98)Address already in use: make_sock: could not bind to address [::]:80 (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down Unable to open logs [FAILED] [root@mkx conf]# netstat -tulnp | grep ':80 ' tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 3771/nginx
httpd.conf # Listen: Allows you to bind Apache to specific IP addresses and/or # ports, instead of the default. See also the <VirtualHost> # directive. # # Change this to Listen on specific IP addresses as shown below to # prevent Apache from glomming onto all bound IP addresses. # #Listen 12.34.56.78:80 Listen 127.0.0.1:8080 default.conf <VirtualHost *:8080> ServerAdmin admin@linuxeye.com DocumentRoot "/home/wwwroot/default" ServerName 127.0.0.1 ErrorLog "/home/wwwlogs/error_apache.log" CustomLog "/home/wwwlogs/access_apache.log" common <Directory "/home/wwwroot/default"> SetOutputFilter DEFLATE Options FollowSymLinks Require all granted AllowOverride All Order allow,deny Allow from all DirectoryIndex index.html index.php </Directory> </VirtualHost> 没有啊,我一直都没有修改过8080端口。只是今天重启了一下,就成这样了。
/usr/local/apache/logs/error_log [Sun Mar 30 04:02:01.147938 2014] [mpm_prefork:notice] [pid 2272] AH00171: Graceful restart requested, doing restart [Sun Mar 30 04:02:01.224805 2014] [mpm_prefork:notice] [pid 2272] AH00163: Apache/2.4.9 (Unix) configured -- resuming normal operations [Sun Mar 30 04:02:01.224823 2014] [core:notice] [pid 2272] AH00094: Command line: '/usr/local/apache/bin/httpd'