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. |
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, |
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? |
Quote:
Quote:
request, |
Thank you for your help
A big thanks for quickly and succinctly answering my question. Much appreciated.
|
All times are GMT -5. The time now is 04:28 AM. |