Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to access my server as http://serverip

With NameVirutalHost configuration, the domain names are redirected to their respective folders. But for serverip, I want apache to serve me a different folder. But it is serving me the content for My system is Ubuntu 11.04. How can this issue be solved ?

share|improve this question
Can we get output the virtualhost section of both sites? – Rilindo Jul 26 '11 at 17:27
You mean you want the exact configuration options ? – sul4bh Jul 26 '11 at 17:41
up vote 1 down vote accepted

Try defining a NameVirtualHost for serverip as you would for any other name. It should also be the first one you define (this will make it the default virtual host if no HTTP Host: header is received, as often happens when you point a web browser at an IP address).

share|improve this answer
I already tried that. I checked that the browsers send IP address in HOST field and used the IP address for ServerName. But that does not seem to work. – sul4bh Jul 26 '11 at 17:39
I added ServerName <serverip> in a VirtualHost directive and it seems to work fine now. Thanks for you suggestion. – sul4bh Jul 26 '11 at 18:00

Your Answer


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

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