Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Like the question states only the first Virtual Host is loaded. If I go to the second domain then it simply directs to the first domain. I can load individual files on the second domain but I am unable get the index file to load.

NameVirtualHost *:80
<VirtualHost *:80>
 ServerAdmin youremail@domain.com
 DocumentRoot /var/www/intranet/public_html
 ServerName employees.nationalpurchasingpartners.com
 ServerAlias employees.nationalpurchasingpartners.com
</VirtualHost>

<VirtualHost *:80>
 ServerAdmin youremail@domain.com
 DocumentRoot /var/www/procurement/public_html
 ServerName www.procurementnews.com
 ServerAlias procurementnews.com
</VirtualHost>

I have run through the following link to no avail.

http://wiki.apache.org/httpd/CommonMisconfigurations

Adding output of curl:

HTTP/1.1 200 OK
Server: Apache
Set-Cookie: COOKIE=10.5.19.235.1396565642197130; path=/
ETag: "AAAAUSZYEDQ"
Last-Modified: Thu, 06 Mar 2014 21:50:26 GMT
Set-Cookie: referrer=; path=/
Set-Cookie: t=d9979760bb8211e39a570015c5e70b87; path=/
Set-Cookie: referrer=procurementnews.com; path=/
Vary: Accept-Encoding,User-Agent
Cartoon: aalander4
Content-Type: text/html; charset=UTF-8
Date: Thu, 03 Apr 2014 22:54:02 GMT
X-Varnish: 1862602499
Age: 0
Via: 1.1 varnish
Connection: keep-alive

Output of httpd -S

httpd -S

*:80                   is a NameVirtualHost
     default server employees.nationalpurchasingpartners.com (/etc/httpd/conf/httpd.conf:1012)
     port 80 namevhost employees.nationalpurchasingpartners.com (/etc/httpd/conf/httpd.conf:1012)
             alias employees.nationalpurchasingpartners.com
     port 80 namevhost www.procurementnews.com (/etc/httpd/conf/httpd.conf:1019)
             alias procurementnews.com
share|improve this question
    
What is the output from httpd -S? And did you restart Apache? –  Michael Hampton Apr 3 at 21:45
    
have you restarted apache since making changes to httpd-vhosts.conf? –  jayhendren Apr 3 at 21:46
    
httpd -S *:80 is a NameVirtualHost default server employees.nationalpurchasingpartners.com (/etc/httpd/conf/httpd.conf:1012) port 80 namevhost employees.nationalpurchasingpartners.com (/etc/httpd/conf/httpd.conf:1012) alias employees.nationalpurchasingpartners.com port 80 namevhost www.procurementnews.com (/etc/httpd/conf/httpd.conf:1019) alias procurementnews.com –  6paq Apr 3 at 21:47
    
Also Apache has been restarted multiple times –  6paq Apr 3 at 21:48
    
Place an empty index file in the docroot of both. This will rule out any application-level redirects. Maybe post the output of curl -I so we know what redirect is happening. –  Peter Apr 3 at 22:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.