I have a website that runs on an IP, 23.222.22 for example

I have created my virtual host as /home/www/www.site.com 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


  • Yes, this seem fine right! What's your question!? – F. Hauri Nov 1 '12 at 13:21

Short answer: you can't directly

To get what you want:

  • Add that entry to your hosts* file, where your www.site.com 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 www.site.com at the end, and then open www.site.com in your browser

  • 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.

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.