Solved

How To Access Domain Through Direct IP Not Domain Name?

Posted on 2006-11-25
6
229 Views
Last Modified: 2010-03-18
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!
0
Comment
Question by:runningone
6 Comments
 
LVL 3

Accepted Solution

by:
n664dc earned 250 total points
ID: 18013328
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
 

Author Comment

by:runningone
ID: 18263654
<<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
 
LVL 25

Assisted Solution

by:Cyclops3590
Cyclops3590 earned 250 total points
ID: 18511025
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

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question