Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 have spent all weekend to replicate my development server back at home. I have an Apache server with 3 IP based virtual hosts pointing to /var/www/ /var/www/ /var/www/

Now I have been able to set up a VM on my desktop, installed the OS, the applications, the db server, apache etc. Everything is looking good so far.

So right now I have, at /var/www/ at /var/www/ at /var/www/

So when I go to, I go to so I guess apache is working aswell.

What I want to do is, instead of going to I want to change it to another address such as

How can I do this? I am looking through the virtual hosts section, I have changed server name entry etc but its not working.

Can you tell me in big picture what I would need to do to set that up? My current set up doesnt really help me much once the site get the www address.

Sorry if I am not explaining it right. I can provide my conf files if you need them. I have webmin installed.

Or could you tell if Document Root of IP address points to /var/www/, will it always resolve into that webaddress. That is if I enter the browser will redirect it to What effect does Server Name has in this regard then?

share|improve this question
Have you restarted apache? – dmah Dec 13 '10 at 2:14
Yes. When I do enter my local IP, I go to the I would like it to go to another address such as etc so that I am browsing local website. The actual site is accessible from internet – bcrawl Dec 13 '10 at 2:22
Are you entering the URL by IP address or by hostname? Do you have the IP address you entered mapped locally in /etc/hosts to – dmah Dec 13 '10 at 2:31
I am entering URL by IP. It gets resolved into hostname. No, I have not made any changes to /etc/hosts file. – bcrawl Dec 13 '10 at 2:35
How is your IP getting resolved into a hostname? Your address shouldn't be routeable to the Internet. What do your Apache error logs from and say? – dmah Dec 13 '10 at 2:43

Are you wanting the url in the client browser to change depending on the IP you type in? Or are you wanting a different site to load with a different IP?

If you want a IP or a domain name to go to a specific site use /etc/apache2/sites-enabled. Add a file to this directory with the contents;

<VirtualHost *:80>
        DocumentRoot /var/www/whatever

Then restart apache (/etc/init.d/apache2 restart)

Make sure the domain name resolves to the correct IP address (edit your dns records)

If I understand you correctly this should do what you want...

share|improve this answer

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.