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 have a website that runs on an IP, 23.222.22 for example

I have created my virtual host as /home/www/ in Apache as my web server.

However for development, before updating DNS, can I access the site like



http://23.222.22/ just loads info from var/www


share|improve this question
Yes, this seem fine right! What's your question!? – F. Hauri Nov 1 '12 at 13:21
up vote 3 down vote accepted

Short answer: you can't directly

To get what you want:

  • Add that entry to your hosts* file, where your will point to your ip
  • You can find a browser plugin, where you can add a Host header, to tell the webserver which vhost you wish to access

* c:\windows\system32\drivers\etc\hosts on Windows and /etc/hosts on *nix; just add at the end, and then open in your browser

share|improve this answer
Works like a charm. Wanted to run this site in development without touching DNS and this works great! Thanks – TheBlackBenzKid Oct 29 '12 at 11:37

If you setup your site as the default DocumentRoot for Apache then it should display that site when you access using an IP rather than the hostname.

Of course all your server variables for URL etc will be the IP rather than the hostname.

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.