今天在安装HTTP服务时出现如下错误提示:
-
- [root@localhost ~]# service httpd start
- Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain 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]
如上错误有两部分错误:
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName
分析:
这个问题是由于/etc/httpd/conf/httpd.conf文件中设置了 ServerName 所以它就用主机上的名称来取代,这样的话先去找/etc/hosts 中有沒有主机的定义。
解决方法:
所以要解决这个问题可以设置 ServerName 或者在 /etc/hosts 中填入自己的主机名称 datacentersky,如下:
- vi /etc/hosts
- 127.0.0.1 localhost.localdomain localhost datacentersky
2. 第二个错误:
-
- (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
原因:80端口被占用
解决方法:
netstat -tunpl | grep :80
- [root@liujing html]# netstat -tunpl | grep :80
- tcp 0 0 :::80 :::* LISTEN 23577/httpd
假设如上的信息中80端口被其他服务占用,就可以通过kill相应上面的进程ID: kill 23577 。这样重新启动http服务就OK了。

DC Farm小程序二维码
扫一扫添加博客小程序
2012年9月30日 下午9:16 沙发
分析的很透彻,很欣赏你的看法,学习了。
2012年10月1日 上午9:19 板凳
来访,我还在用传统虚拟主机ing。。。
2012年10月1日 下午6:15 地板
看起来还是很不错的样子》》》》
2012年10月10日 上午12:06 4楼
分析的很透彻,很欣赏你的看法,学习了。