When I restart/reload/whatever apache2 (2.4) on Ubuntu Server 14.10, I get the error message that the server could not determine the FQDN. I had this set previously, no big deal, but I now have two domain names on the server managed by separate VirtualHost config files. What should I set ServerName to in apache2.conf to suppress the error since I have multiple domain names? Should it globally be the server's IP address but set individually in the VirtualHost configs the proper way?

  • Just set it to localhost. – cuonglm Apr 19 '15 at 18:02
  • @cuonglm Well, that's simple, I didn't even think about that. If you post as an answer I'll accept it. Thank you! – vaindil Apr 19 '15 at 18:33

You can just set it to localhost. Edit /etc/apache2/conf.d/httpd.conf:

ServerName localhost

The ServerName directive can be use in two contexts: server config or virtual host.

  • In server config context, ServerName directive is used when creating redirection URLs.
  • In virtual host context, ServerName directive is used to uniquely identify a virtual host.

So you must set ServerName inside a VirtualHost section for each domain configuration to identify two domains. The global value will make the warning message disappear and doesn't affect the identity between two domains.


In CentOS 7x the file is located at /etc/httpd/conf/httpd.conf.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.