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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Webserver ?

Status
Not open for further replies.

vfear

Technical User
Feb 9, 2001
159
0
0
US
I want to set up 2 domains on one IP address.. so basically I want to setup test1.com and test2.com on the same server.. each pointed to different directories.. Can someone tell me how to do so I am running redhat 7.2 .. I see a virtual hosts options so I am guessing I will need to do it by name host. now how can I test it out without actually owning the domain names ?? I can setup dns for it I guess.. please help
 
I'm assuming you're using the default server Apache on RH
7.2.

Configure your local dns and/or resolv.conf to resolve test1.com and test2.com correctly.

In httpd.conf, you'd want to following. ( Simplified for brevity )
Make sure you have the /var/ directories created. You will place each domains content in their prospective directories.


NameVirtualHost xxx.xxx.xxx.xxx # Interface IP address


<VirtualHost xxx.xxx.xxx.xxx> # Interface IP Address
ServerAdmin admin@test1.com
DocumentRoot /var/ ServerName </VirtualHost>

<VirtualHost xxx.xxx.xxx.xxx> # Interface IP Address
ServerAdmin admin@test2.com
DocumentRoot /var/ ServerName </VirtualHost>


Restart apache.. apachectl restart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top