问题描述:经过yum install -y httpd 安装好Apache后启动报错,以下:html
注释:绿色的是命令行提示的输出的内容。黑色字绿色底纹的命令是输入的内容。apache
[root@it3246 ~]# service httpd start微信
正在启动 httpd:httpd: apr_sockaddr_info_get() failed for it3246dom
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName [肯定]ide
解决办法:spa
编辑hosts文件命令行
[root@it3246 html]# vi /etc/hostsrest
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4server
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6htm
127.0.0.1 it3246
注意:根据本身的机器主机名改 it3246是我本身的机器名称 [root@it3246 html]里面@后面就是机器名
完成hosts文件编辑后,解决了一个问题。还有错误提示
[root@it3246 etc]# service httpd restart
中止 httpd: [肯定]
正在启动 httpd:httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
2.解决办法:
编辑httpd.conf文件,搜索到"#ServerName",添加ServerName it3246:80或者去掉本来的
#ServerName www.example.com:80 前面的注释 后面改为 it3246:80
[root@server conf]# ls
extra httpd.conf magic mime.types original
[root@server conf]# vi httpd.conf
#ServerName www.example.com:80
ServerName it3246:80
3.重启apache。
[root@it3246 etc]# service httpd status
httpd (pid 29506) 正在运行...
注意:文章中it3246是根据本身机器替换的 是本身的主机名
博客不常常在线,能够加QQ(同步微信交流)1600157341