一、啟動apache遇到錯誤:httpd: Could not reliably determine the server's fully qualified domain name
[root@server httpd-2.2.4]# /usr/local/apache/bin/apachectl start
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName,解決方法如下:
1)進入apache的安裝目錄:(視個人安裝情況而不同) [root@server ~]# cd /usr/local/apache/conf
2)編輯httpd.conf文件,搜索"#ServerName",添加ServerName localhost:80
[root@server conf]# ls
extra httpd.conf magic mime.types original
[root@server conf]# vi httpd.conf
#ServerName www.example.com:80
ServerName localhost:80
3)再重新啟動apache 即可。
[root@server ~]# /usr/local/apache/bin/apachectl restart
二、重啟報錯apache2 address already in use:make_sock:could not bind to address [::]:80
此錯誤為端口被占用,只有進入root用戶,才可以查看所有端口被占用的情況,因此需要:
$su
#netstat -lnp | grep 80
tcp 0 x x.x.x.x:8084 ... listen 1167/mono
tcp 0 x x.x.x.x:80 ... listen 1194/inetd
udp 0 x x.x.x.x:2080 ... listen 14427/drcomauthsvr
查看知道是Inetd占用了80端口
#kill 1194
#exit //退出root用戶
$sudo apapche2ctl -k start
啟動成功!