Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

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

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

add comment

1 Answer 1

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.