Gandi Wiki


You are on a question's page

answered

Question "Finding a virtual host in a browser", by Mary F.

Hi,

I don't want to point my domain name to my server here before everything works properly. So first I am trying to check my site through the ip adress. (Precision in case someone finds this weird: you don't need a domain name to access a web site).

Now with ftp connections:

ftp://myusername@90.243.20.169/virtualhostname/whatever

This works fine, all files appear to be in place

But with http connections:

http://90.243.20.169/virtualhostname/index.html

I get 404 file not found errors or timeouts.

I checked the permissions and for outsiders they

are set to "read" so there should be no problem there.

I am certain that this is the ip gandi said was

assigned to my server.

Oh, something else: the blog thingy seemed to be getting

in the way, so I uninstalled it, but while it was there

I didn't get 404, I got error messages from this blog

thingy.

All suggestions welcome

Answer, by Cem S.

I want to do the same thing here! how do I enable http access to my server?

Answer, by LelandV

Web servers using Virtual Hosts make use of the extended headers in the HTTP protocol to identify the website requested. This header is not in and of itself modifiable from the URL bar of a web browser.

The simplest (and quickest) way to do this is add a temporary entry in the hosts file of your PC with the full address (www.domain.com) pointing to the IP address of your server.

On Linux and Mac, this file is in /etc/hosts

On Windows (vista and later) this should be in \Windows\System32\Drivers\etc\hosts

The IP address goes first, then a tab, then the host.

Example:

192.168.15.32 www.domain.com

Once you have done that, you should be able to access the site on the server to do testing before you make the full DNS change.

Make sure that you remove the entry in the hosts file when you have finished testing, of course :)

Follow-up, by Cem S.

Hi there!

I've tried what you've suggested but it did not work for me… after modifying /etc/hosts like you said nothing changed, i still can't see the website from my browser. I tried restarting my mac didn't change anything… do you have any other suggestions ?

Thanks

Follow-up, by Sam W.

On this point - Entering the server IP loads the index page from this site, regardless of the number of vhosts installed.

What configuration points the server IP address to the www.example.com default install site?

Last modified: 04 Feb 2011 at 15:47 by Sam W.