0

I have recently just set up a RHEL based server running two domains. However, I am having difficulty hitting both domains from the browser. My config is:

NameVirtualHost *:80

<VirtualHost *:80>
    ServerName domainA.com
    ServerAlias domainA.com *.domainA.com
    DocumentRoot /home/domainA/public_html
    <Directory "/home/domainA/public_html">
         allow from all
         Options +Indexes
    </Directory>    
</VirtualHost> 
<VirtualHost *:80>
     ServerName domainB.com
     ServerAlias domainB.com *.domainB.com
     DocumentRoot /home/domainB/public_html
     <Directory "/home/domainB/public_html">
          allow from all
          Options +Indexes
     </Directory>
</VirtualHost>

The problem is when I navigate to domainA.com I hit the correct Virtualhost (which is fine), however when I navigate to domainB.com it displays the Apache Test page.

Edit

I have a Firewall between the webserver and the web. I tested the rules governing Domain A and Domain B.

Domain A reaches target and a status 200 is returned.
Domain B reaches target and a status 403 (permission denied) is returned

amburnside
  • 1,943
  • 5
  • 24
  • 43

1 Answers1

0

What you need to do is take a look at sites-enabled and sites-available. Here's the first entry when Googling: http://www.debian-administration.org/articles/412 Looks reasonable and should help you integrate that.

The problem is that you need separate entries for all the sites you want to run on this apache2. Simple entries in your config file don't do it. Only the first works, the rest is more or less ignored. Creating separate entries with sites-enabled and sites-available is the way to go here.

Holger Frohloff
  • 1,695
  • 18
  • 29