?
Solved

How To Access Domain Through Direct IP Not Domain Name?

Posted on 2006-11-25
6
Medium Priority
?
235 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 3

Accepted Solution

by:
n664dc earned 1000 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 1000 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

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

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

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…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month9 days, 22 hours left to enroll

762 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