今天啓動apache查看狀態發現報錯,說不能確認服務器徹底確認域名,如下是報錯內容:apache
[root@localhost ~]# service httpd status Redirecting to /bin/systemctl status httpd.service ● httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled) Active: active (running) since Thu 2019-09-19 16:13:13 CST; 19min ago Docs: man:httpd(8) man:apachectl(8) Process: 4342 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS) Main PID: 4459 (httpd) Status: "Total requests: 0; Current requests/sec: 0; Current traffic: 0 B/sec" CGroup: /system.slice/httpd.service ├─4459 /usr/sbin/httpd -DFOREGROUND ├─4460 /usr/sbin/httpd -DFOREGROUND ├─4461 /usr/sbin/httpd -DFOREGROUND ├─4462 /usr/sbin/httpd -DFOREGROUND ├─4463 /usr/sbin/httpd -DFOREGROUND └─4464 /usr/sbin/httpd -DFOREGROUND Sep 19 16:13:13 localhost.localdomain systemd[1]: Starting The Apache HTTP Server... Sep 19 16:13:13 localhost.localdomain httpd[4459]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdo...is message ###就是這一個 Sep 19 16:13:13 localhost.localdomain systemd[1]: Started The Apache HTTP Server. Hint: Some lines were ellipsized, use -l to show in full.
解決辦法:服務器
vi /etc/httpd/conf/httpd.conf 加入一句 ServerName localhost:80dom
而後重啓apache服務spa
[root@localhost ~]# vi /etc/httpd/conf/httpd.conf [root@localhost ~]# service httpd restart Redirecting to /bin/systemctl restart httpd.service [root@localhost ~]# service httpd status Redirecting to /bin/systemctl status httpd.service ● httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled) Active: active (running) since Thu 2019-09-19 16:38:08 CST; 5s ago Docs: man:httpd(8) man:apachectl(8) Process: 4610 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS) Main PID: 4615 (httpd) Status: "Processing requests..." CGroup: /system.slice/httpd.service ├─4615 /usr/sbin/httpd -DFOREGROUND ├─4616 /usr/sbin/httpd -DFOREGROUND ├─4617 /usr/sbin/httpd -DFOREGROUND ├─4618 /usr/sbin/httpd -DFOREGROUND ├─4619 /usr/sbin/httpd -DFOREGROUND └─4620 /usr/sbin/httpd -DFOREGROUND Sep 19 16:38:08 localhost.localdomain systemd[1]: Starting The Apache HTTP Server... Sep 19 16:38:08 localhost.localdomain systemd[1]: Started The Apache HTTP Server. [root@localhost ~]#