Apache解决error setting limit (Operation not permitted)及could not bind to address 0.0.0.0:80 的方法

来源:互联网 发布:医学大数据挖掘与应用 编辑:程序博客网 时间:2024/05/05 14:57

Apache解决error setting limit (Operation not permitted)及could not bind to address 0.0.0.0:80 的方法

在终端执行命令 service apache2 start后,在终端输出如下内容
* Starting web server apache2

/usr/sbin/apache2ctl: 87: ulimit: error setting limit (Operation not permitted)
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
Action ‘start’ failed.
The Apache error log may have more information.

[fail]

解决方法:

网上又看到Apache1024以下的端口需要root权限才能执行,所以只需在启动命令前加上sudo就可以了。

参考:http://zhidao.baidu.com/link?url=Z7Gvo7SKY9wOIQX36A5uj4QzuVhL1aBC5Qe14FhU5eMq8bwkkH3uejr5vZc7EM0zvOFhnf4wgvd8Wd2hortLm4M8M9rZvpr_jixeVcxiuay

普通用户只有bind 1024以后的端口的权限。请选择1024以后的端口,或者测试时用root用户。

另外http://blog.sina.com.cn/s/blog_417ad82e0101eomt.html 中给出了关于一些问题的解决方法,可供参考。

解决/usr/sbin/apache2ctl: 87: ulimit: error setting limit (Operation not permitted) 的方法是将 /user/sbin目录下的apache2ctl  文件中的ULIMITE_MAX_FILES修改为=ULIMITE_MAX_FILES “”

注:这里建议注释掉,然后修改,这样可以做到简单恢复。

修改完成后,在终端输入service   Apache2  start后会在终端输出

* Starting web server apache2

(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
Action ‘start’ failed.
The Apache error log may have more information.
[fail]

虽然没有完全解决问题,但是已经解决了/usr/sbin/apache2ctl: 87: ulimit: error setting limit (Operation not permitted) 的问题,其实这里我也不清楚是什么问题。

0 0