启动apache时出现
[root@centos apache2]# /usr/local/apache2/bin/apachectl start
httpd: Could not reliably determine the server's fully qualified domain ">name, using 121.10.40.155 for ServerName
现在提供该问题的解决方法
1)进入apache配置文件的目录:(视个人安装情况而不同)
[root@centos /]# cd /etc/httpd //我安装时配置文件所在的目录为/etc/httpd
2)编辑httpd.conf文件,搜索"#ServerName",添加ServerName localhost:80
[root@centos httpd]# ls
conf.d extra httpd.conf magic mime.types original
[root@centos httpd]# vi httpd.conf
#
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
#ServerName www.example.com:80
更改为:
ServerName localhost:80
3)再重新启动apache 即可。
[root@centos httpd]# /usr/local/apache2/bin/apachectl restart
OK,启动成功啦!