httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

前端 未结 12 1718
悲&欢浪女
悲&欢浪女 2020-12-04 05:44

I tried to restart my Apache server on CentOS 5.0 and got this message:

httpd: Could not reliably determine the server\'s fully qualified domain name,

12条回答
  •  眼角桃花
    2020-12-04 06:04

    If you've edited /etc/apache2/httpd.conf with the ServerName localhost you may be editing the wrong file. All answers I found were pointing towards that standard httpd.conf. After some foraging, I found a good answer here.

    To locate the right httpd.conf file use

    apachectl -t -D DUMP_INCLUDES
    

    I found mine was actually /usr/local/etc/httpd/httpd.conf.

    Use your preferred editor to comment out the line (i.e. remove the # before) starting with ServerName, and replace the domain name for the appropriate one – local environments should work with

    ServerName localhost
    

    I hope this helps more people who may be stuck.

提交回复
热议问题