How To Access Domain Through Direct IP Not Domain Name?

We have lagunaguitar.com on a shared IP, but can't access that through the IP via web browser.

For instance, I can see this page (goes to "domain default page")
http://lagunaguitar.com/index.html

But not either one of these:
http://208.109.109.28/var/www/vhosts/lagunaguitar.com/index.html
http://208.109.109.28/var/www/vhosts/lagunaguitar.com/httpdocs/index.html

I think I'm just missing something on the path?

We use Linux and Apache if that adds anything.

Thanks!
runningoneAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
n664dcConnect With a Mentor Commented:
http://lagunaguitar.com/ is a virtual host on apache

meaning when you access the server, apache determines which virtual host to use by the url you enter. This way, many different domain names can point to the same IP with completly seperate websites.

to see this in action:
open up a terminal or command prompt if you're on windows
type:
telnet 208.109.109.28 80
GET / HTTP/1.1
Host: lagunaguitar.com
press enter twice

http://lagunaguitar.com/index.html will be displayed

if you try:
telnet 208.109.109.28 80
GET / HTTP/1.1
Host: www.google.com
press enter twice

you'll get an error from apache because www.google.com is not configured

what this means is the directory your webpage is served from is dependent on which 'host' header you send along with the request. Unless the root directory that apache serves from by default is above the folder your virtual host is configured for, I don't think you'll be able to access it by typing in a path.

also /var/www/vhosts/lagunaguitar.com/httpdocs/index.html is a full path and would require that / be the default directory that apache serves from... a very bad idea :D

-n664dc
0
 
runningoneAuthor Commented:
<<what this means is the directory your webpage is served from is dependent on which 'host' header you send along with the request. Unless the root directory that apache serves from by default is above the folder your virtual host is configured for, I don't think you'll be able to access it by typing in a path.>>

I'm getting at least part of what your are saying here.

So what I want to know is:
    Is there a way to access a host from a server even if the DNS hasn't been setup for it?  In other words, assume that http://lagunaguitar.com points to CURRENT SERVER but I want to look at the lagunaguitar on NEW SERVER, so I can make use of the host name while building my new site. I want to do this so I can test the site on the new server before switching the DNS over to point lagunaguitar.com to NEW SERVER.
0
 
Cyclops3590Connect With a Mentor Commented:
If the new server also runs apache in virtual host mode, then you can't.  You either need to set it up so you can visit the site via the IP, e.g. http://1.2.3.4, or setup a new fqdn to reference the test site by, e.g. http://beta.lagunaguitar.com.

Then when you want to move it over you just change the virtual host to accept http://lagunaguitar.com instead of http://beta.lagunaguitar.com
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.