Could not reliably determine the server's fully qualified domain name

前端 未结 13 686
悲&欢浪女
悲&欢浪女 2020-11-29 19:09

I have just installed Apache 2.2.17, and I am using it first time.

Now when I try to start the server using the command service httpd start it gives me

相关标签:
13条回答
  • 2020-11-29 19:38

    Under Debian Squeeze;

    1. Edit Apache2 conf file : vim /etc/apache2/apache2.conf
    2. Insert the following line at the apache2.conf: ServerName localhost
    3. Restart Apache2: apache2ctl restart or /etc/init.d/apache2 restart

    Should work fine (it did solve the problem in my case)

    tks noodl for the link on the different layouts. :)

    0 讨论(0)
  • 2020-11-29 19:46

    Another option is to ensure that the full qualified host name (FQDN) is listed in /etc/hosts. This worked for me on Ubuntu v11.10 without having to change the default Apache configuration.

    0 讨论(0)
  • 2020-11-29 19:47

    Two things seemed to do it for me:

    1. Put all aliases for 127.0.0.1 in /etc/hosts in a single line (e.g. 127.0.0.1 localhost mysite.local myothersite.local
    2. Set ServerName in my httpd.conf to 0.0.0.0 (localhost or 127.0.0.1 didn't work for me)

    Editing /etc/hosts got rid of long response times and setting the ServerName got rid of OP's warning for me.

    0 讨论(0)
  • 2020-11-29 19:49

    FQDN means the resolved name over DNS. It should be like "server-name.search-domain".

    The warning you get just provides a notice that httpd can not find a FQDN, so it might not work right to handle a name-based virtual host. So make sure the expected FQDN is registered in your DNS server, or manually add the entry in /etc/hosts which is prior to hitting DNS.

    0 讨论(0)
  • 2020-11-29 19:49

    who are still couldnt resolve the problem and using mac then follow this

    1.goto the root folder /

    1. cd usr/local/etc/apache2/2.4

    3.sudo nano httpd.conf

    4.change #servername to ServerName 127.0.0.1:8080 press ctrl+o,+return+ctrl x

    5.then restart the server apachectl restart

    0 讨论(0)
  • 2020-11-29 19:51

    Yes, you should set ServerName:

    http://wiki.apache.org/httpd/CouldNotDetermineServerName

    http://httpd.apache.org/docs/current/mod/core.html#servername

    You can find information on the layouts used by the various httpd distributions here:

    http://wiki.apache.org/httpd/DistrosDefaultLayout

    In your case the file to edit is /etc/httpd/conf/httpd.conf

    0 讨论(0)
提交回复
热议问题