Linux:启动apache报错 httpd: Could not reliably determine the server‘s fully qualified domain name

默认安装的 httpd 服务并未指定域名,在输入bin/apachectl start 启动 apache 服务时会出现 报错 “httpd: Could not reliably determine the server's fully qualified domain name”。

① 在配置文件 /etc/httpd/conf/httpd.conf 中加入域名

# vim /etc/httpd/conf/httpd.conf

②  找到文件中的 # ServerName www.example.com:80, 修改成你需要指定的域名,或者在下一行添加。端口号不是必须加的。例如:

ServerName www.aurona.com

③ 在配置文件 /etc/hosts 中加入 ip地址与域名

# vim /etc/hosts

打开文件后添加 ip 地址与刚刚指定的域名。ip地址要修改成你自己的,可以用ifconfig查看。

192.168.137.29 www.aurona.com

④ 然后重启 httpd 即可。可以用 systemctl status httpd查看状态。 

# systemctl restart httpd
# systemctl status httpd

 此时,报错已解决。可以正常启动apache。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值