关于apache2在linux启动命令的疑问

coat 发布于 2013/12/08 18:49
阅读 1K+
收藏 0
coat@Blue :~$ apache2ctl restart
/usr/sbin/apache2ctl: 87: ulimit: error setting limit (Operation not permitted)
httpd not running, trying to start
(13)Permission denied: make_sock: could not bind to address [::]:80
(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 'restart' failed.
The Apache error log may have more information.
coat@Blue :~$ apache2 -k restart
httpd not running, trying to start
(13)Permission denied: make_sock: could not bind to address [::]:80
(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
coat@Blue :~$ service apache2 restart
[....] Restarting web server: apache2/usr/sbin/apache2ctl: 87: ulimit: error setting limit (Operation not permitted)
/usr/sbin/apache2ctl: 87: ulimit: error setting limit (Operation not permitted)
(13)Permission denied: make_sock: could not bind to address [::]:80
(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.

 failed!


如上 我在普通用户下使用apache2 -k restart ,service apahce2 restart apachectl restart

都失败了。但是我在root用户下使用 apachectl 却可以

系统为debian7.2 

还有,现在还有必要配置lamp吧?都想去lnmp了。。。


加载中
0
旧城的骁珖
旧城的骁珖
apache使用端口 80 是需要root权限的(这是系统决定的) 如果修改成高于1000的端口 或许普通用户可以直接开启服务 。另外日志文件权限也是限制一个普通用户打开的原因
0
coat
coat

引用来自“普华之光”的答案

apache使用端口 80 是需要root权限的(这是系统决定的) 如果修改成高于1000的端口 或许普通用户可以直接开启服务 。另外日志文件权限也是限制一个普通用户打开的原因
那我如果root了  service apache2 start 或者 apache2 -k 也是用不了啊
0
旧城的骁珖
旧城的骁珖
@coat 有root不能做的事情么
0
coat
coat

引用来自“普华之光”的答案

@coat 有root不能做的事情么
root@Blue :/home/coat# apache2 -k restart
httpd not running, trying to start
(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


.....service apache2 命令竟然可以了。


0
旧城的骁珖
旧城的骁珖
Address already in use
0
coat
coat

引用来自“普华之光”的答案

Address already in use

在端口已经被使用了的情况下不能调用这个命令么?

apachectl restart为什么可以?

root@Blue:/home/coat# apache2 -k 
apache2: illegal option -- k
Usage: apache2 [-D name] [-d directory] [-f file]
               [-C "directive"] [-c "directive"]
               [-k start|restart|graceful|graceful-stop|stop]
               [-v] [-V] [-h] [-l] [-L] [-t] [-T] [-S] [-X]



0
卡车司机
卡车司机
sudo service apache2 restart
返回顶部
顶部