【问题标题】:Apache + WSGI: Address already in use: make_sock: could not bind to addressApache + WSGI:地址已在使用中:make_sock:无法绑定到地址
【发布时间】:2013-06-04 10:21:39
【问题描述】:

当我尝试启动 Apache2 时收到以下消息:

* Restarting web server apache2                                                  
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:2080
no listening sockets available, shutting down
Unable to open logs
Action 'start' failed.
The Apache error log may have more information.

uwsgi 正在监听那个端口:

sudo netstat -ltnp | grep ':2080'
tcp        0      0 0.0.0.0:2080            0.0.0.0:*               LISTEN  884/uwsgi

在此之前我手动安装了 wsgi

sudo apt-get install libapache2-mod-wsgi

因为我在尝试启动 Apache 时收到此消息:

Syntax error on line 25 of /etc/apache2/sites-enabled/graphite:
Invalid command 'WSGIDaemonProcess', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
   ...fail!

杀死进程不起作用,因为它会自动重新启动。我可以用命令禁用它

sudo a2dismod wsgi

但随后我再次收到“无效命令 'WSGIDaemonProcess' 消息。

apache error.log 不包含任何相关信息。

知道什么可以解决这个问题吗?因为现在我有点陷入僵局。

【问题讨论】:

    标签: apache ubuntu apache2 mod-wsgi wsgi


    【解决方案1】:

    如果你得到:

    Invalid command 'WSGIDaemonProcess', perhaps misspelled or defined by a module not included in the server configuration Action 'configtest' failed.
    

    那么这意味着你没有在 Apache 中启用 mod_wsgi 模块,所以它没有被加载。

    那或者你正在运行一个古老的 Apache 1.3 版本,虽然这不太可能,因为你认为你现在甚至无法获得这样一个旧 Apache 版本的 mod_wsgi 二进制包。

    至于端口的使用,你显然不能让Apache和uWSGI使用同一个端口,所以你需要为它们设置不同的端口。

    【讨论】:

      猜你喜欢
      • 2018-03-20
      • 2014-07-10
      • 2018-12-05
      • 1970-01-01
      • 2016-11-11
      • 2012-12-25
      • 1970-01-01
      • 2012-02-26
      • 1970-01-01
      相关资源
      最近更新 更多