![在 CentOS 上使用 httpd 时出错](https://linux22.com/image/1344545/%E5%9C%A8%20CentOS%20%E4%B8%8A%E4%BD%BF%E7%94%A8%20httpd%20%E6%97%B6%E5%87%BA%E9%94%99.png)
我正在使用 CentOS。当我尝试启动 httpd 时,我收到以下错误:
> sudo httpd
httpd: apr_sockaddr_info_get() failed for ccrhwp01948
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
以下是主机名信息:
> hostname
samp-serv3
此服务器没有关联任何域。只有一个 IP 地址。以下是主机信息:
> nano /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
有谁知道如何正确解决这个问题?
谢谢。
答案1
设置 FQDN 主机名
echo HOST.DOMAIN.com > /etc/hostname
/bin/hostname -F /etc/hostname
/etc/init.d/httpd restart