Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apache Virtual Host and DNS 1

Status
Not open for further replies.

ph4nt0m

Technical User
Mar 5, 2004
4
GB
Hi All
Say a customer owns a domain abc.com. The DNS records for abc.com are on DNS servers I do not own. However I own a web server and the customer would like to host his site on this server.

If I setup a Virtual Host container within Apache which contains the following for the ServerName and ServerAlias directives:

ServerName abc.com
ServerAlias
And the customer changes his A record with his DNS host to point to the IP address of my web server - will a user on the Internet typing into a browser be directed to the relevant docroot etc within my webserver? (after DNS propagation and obviously I have also setup the DocumentRoot directive).

I need to clarify this before I tell the customer to change his DNS, only to find it doesn't work, and for his website to be down for a couple of days.

Thanks very much.
 
Before you tell your customer anything test it. Change a dns record, setup the vhost and see if it works. If it does you can be confident that it will work for your customer.
 
Unfortunately I have not got any domains that are not live on which I can change the record and test this. Hence why I need to be sure it is possible before I do it in this instance. It seems as though it is, and I was reasonably sure it was (after having glimpsed at other Apache setups that were similar to mine).
 
If all you need to test is Apache, you don't need a real domain and you don't need a read DNS.

Pick a domain. I like because it won't interfere with anything. Set up a virtual server in Apache with a ServerName entry of
Add an entry to a workstation's hosts file for to point to the IP address of the Apache virtual server.

Then restart your web browser and point it at

But remember, unless you're sharing IP addresses between sites, Servername and Serveralias aren't even necessary.

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Thanks very much sleipnir214 - good idea, I should have thought of that earlier! Anyway I tried it out, and it works a treat - just as expected.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top