http服务启动时的两个错误


    本人系统CentOS 6.5 64bit, Apache HTTP Server的版本为2.2.15。

    启动http服务时出现如下错误:

[root@lls ipc]# /etc/init.d/httpd start
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using lls.pc for ServerName
(13)Permission denied: make_sock: could not bind to address [::]:8099
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:8099
no listening sockets available, shutting down
Unable to open logs
                                                           [FAILED] 

    错误原因在于SELinux 安全机制的作用,现在来逐个解决问题。



   1.

Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using lls.pc for ServerName 

    表示没有确切地定义主机名。

    在配置文件/etc/httpd/conf/httpd.conf中修改,将被注释掉的ServerName名字改为自己的主机名,查看主机名:

[root@lls ipc]# hostname
lls.pc 

    于是将被屏蔽掉的ServerName修改为:

ServerName lls.pc


   2.

(13)Permission denied: make_sock: could not bind to address [::]:8099
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:8099
no listening sockets available, shutting down
Unable to open logs 
    表示系统系统中没有为http服务定义8099端口,查看http端口:

[root@lls ipc]# semanage port -l | grep http
http_cache_port_t              tcp      3128, 8080, 8118, 8123, 10001-10010
http_cache_port_t              udp      3130
http_port_t                    tcp      80, 81, 443, 488, 8008, 8009, 8443, 9000
pegasus_http_port_t            tcp      5988
pegasus_https_port_t           tcp      5989 
    查看http_port_t,系统果然没有为http服务定义8099端口,于是添加8099端口并再次查看http服务的端口:

[root@lls ipc]# semanage port -a -t http_port_t -p tcp 8099
[root@lls ipc]# semanage port -l | grep http
http_cache_port_t              tcp      3128, 8080, 8118, 8123, 10001-10010
http_cache_port_t              udp      3130
http_port_t                    tcp      8099, 80, 81, 443, 488, 8008, 8009, 8443, 9000
pegasus_http_port_t            tcp      5988
pegasus_https_port_t           tcp      5989 
      可以看到,在http_port_t中增加了8099。



    重新启动http服务:

[root@lls ipc]# /etc/init.d/httpd start
Starting httpd:                                            [  OK  ] 
    Ok,启动成功




参考:
[1]http://blog.163.com/darkness@yeah/blog/static/13177448420116991252712/
[2]http://blog.csdn.net/maoxiang/article/details/5720464






  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值