I have a linux server with 2 dedicated IPs that I use to host about 10 different sites with Apache's virtual host capabilities. Each site has its own domain name, and I use NameVirtualHosts to direct requests to the proper folder based on which domain is being requested, and anything that doesn't match (like entering one of the IP addresses) gets directed to a default page using <VirtualHost _default_:*>.

My question is, since I have multiple IPs and all possible requests are handled as virtual hosts, what should I set ServerName to in the httpd.conf file outside of the vhosts? Does it even matter?

migrated from stackoverflow.com Jan 5 '12 at 2:51

This question came from our site for professional and enthusiast programmers.


If you leave it out entirely Apache will perform a gethostbyname() on the server where it starts and look it up that way, so it really doesn't matter much. Either leave it out entirely or set it to the name of the actual server.

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.