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

Apache Virtual hosting not working

Status
Not open for further replies.

celo84

IS-IT--Management
Dec 5, 2011
1
Hi
I am new member of this forum.
I have have setup apache on my CentOS to serve 2 domains. At least I think so:). Primary domain is hosted in document root folder /var/ while secondary domain in located in its subfolder /var/Apache config file is setup as follows:

<VirtualHost x.x.x.x:80>
DocumentRoot /var/ServerName </VirtualHost>

<VirtualHost *:80>
DocumentRoot /var/ServerName </VirtualHost>

However, when I try the browser points me to
 
I believe its the <virtual Host :*> part thats your problem

No need to have the :80 as you are already listening on that port (unless you feel you need to put each virtual on different ports)

Try this:

<VirtualHost x.x.x.x>
DocumentRoot /var/ServerName </VirtualHost>


<VirtualHost x.x.x.x>
DocumentRoot /var/ServerName </VirtualHost>

''''''''''''''''''''''''''''''''''''''''''''''''

Edited example of one of my virtual's

<VirtualHost 123.145.167.189>
DocumentRoot /export/home/sites/site32/web
ServerName <Directory /export/home/sites/site32/web>
allow from all
Options +Indexes
</Directory>
</VirtualHost>

Laurie.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top