1. XenForo 1.5.14 中文版——支持中文搜索!现已发布!查看详情
  2. Xenforo 爱好者讨论群:215909318 XenForo专区

Nginx前端,Apache后端,启动失败?

本帖由 woi9112014-03-30 发布。版面名称:应用交流

  1. woi911

    woi911 VIP会员

    注册:
    2014-02-19
    帖子:
    283
    赞:
    59
    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
     
  2. admin

    admin 管理员 管理成员

    注册:
    2011-11-01
    帖子:
    3,671
    赞:
    2,425
    目测还是httpd还是需要80端口 没改过来吧~
     
  3. woi911

    woi911 VIP会员

    注册:
    2014-02-19
    帖子:
    283
    赞:
    59
    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端口。只是今天重启了一下,就成这样了。
     
  4. woi911

    woi911 VIP会员

    注册:
    2014-02-19
    帖子:
    283
    赞:
    59
    /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'
     
正在加载...