LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-23-2006, 01:13 PM   #1
sjenkinsdc
LQ Newbie
 
Registered: Jan 2006
Posts: 7

Rep: Reputation: 0
Question How do I test my vhost before setting DNS?


I'm moving a site to my new dedicated server. I have name-based vhosts set up. However, before I set the URL to point to my new server, I'd like to test my setup on the dedicated server.

How can I do this? I've searched a few threads and cannot find an answer. I'd like to access the site to test it before making it live. If I point the URL to the new server and it is no good, then that no-good!!!

I've got a LAMP setup going on.

Thanks for any help anyone can provide this somewhat informed newbie.
 
Old 01-23-2006, 01:33 PM   #2
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,402
Blog Entries: 1

Rep: Reputation: 64
You need to set up your own name<->ip translation to the new ip, overriding the current one.

Let say your URL site is www.whatever.com which binds to 123.123.123.123 on internet.

Let say your new server would be 231.231.231.231.

In a linux machine put a line in your /etc/hosts file to point to this new ip:

231.231.231.231 www.whatever.com

(you may to restart the nscd daemon. Also, in the file /etc/nsswitch.conf, the line "hosts: files dns" must have "files" first).
After changing /etc/hosts, ping www.whatever.com would return results from 231.231.231.231.

In a windows machine the equivalent file is \Windows\System32\drivers\etc\hosts


regards,
 
Old 01-23-2006, 02:21 PM   #3
sjenkinsdc
LQ Newbie
 
Registered: Jan 2006
Posts: 7

Original Poster
Rep: Reputation: 0
So I don't need to do anything on the server, just update the hosts file on my client machine?

Is there anyway to directly access the vhost using the IP address? For example, I know you can access users accounts by ipaddress slash ~username. Any similar way to do this to access vhost?
 
Old 01-24-2006, 05:20 AM   #4
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,402
Blog Entries: 1

Rep: Reputation: 64
Quote:
Originally Posted by sjenkinsdc
So I don't need to do anything on the server, just update the hosts file on my client machine?
Yes. That's right. You just need the test machine be able to translate the server name to the new ip address. You need to "by-pass" the standard conversion process, because it would return the original ip address.

Quote:
Originally Posted by sjenkinsdc
Is there anyway to directly access the vhost using the IP address? For example, I know you can access users accounts by ipaddress slash ~username. Any similar way to do this to access vhost?
No, because you told me the server is "name based", not "ip based". When your browser contact the web server at the new ip, the request includes the name of the server. This name in the request is used by the web server to decide which virtual site would reply.

request,
 
Old 01-27-2006, 06:13 PM   #5
sjenkinsdc
LQ Newbie
 
Registered: Jan 2006
Posts: 7

Original Poster
Rep: Reputation: 0
Thank you for your help

A big thanks for quickly and succinctly answering my question. Much appreciated.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I test that my dns server is functioning correctly adam_ant Linux - Networking 4 12-13-2005 03:31 PM
Apache: Alias is working on ssl vhost but not on mass vhost jonavogt Linux - Software 0 06-07-2005 03:05 PM
DNS test result. What's wrong? frankpretec Linux - Networking 3 04-05-2005 08:21 PM
vhost on fc2 install. defaults to 1 vhost only knightdog Linux - Newbie 8 11-12-2004 02:45 PM
setting vhost in unix with BIND Gijet Linux - Wireless Networking 0 06-14-2004 08:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration