Apache Virtual Hosts and subdomains

apache-2.2subdomainvirtualhost

I'm trying to create a subdomain for a project i'm working on, projectx.cairocubicles.com, this url points to another server than the one hosting www.cairocubicles.com. The server the subdomain is pointing to has apache installed with the following virtual host:

    <VirtualHost *:80>
  # Admin email, Server Name (domain name) and any aliases
  ServerAdmin webmaster@cairocubicles.com
  ServerName  www.project1.cairocubicles.com


  # Index file and Document Root (where the public files are located)
  DirectoryIndex index.html index.php
  DocumentRoot /home/project1/web/public
    <Directory /home/project1/web/public>
        Options Indexes FollowSymLinks
        AllowOverride All
        AcceptPathInfo On
        Order allow,deny
        Allow from all
    </Directory>


  # Custom log file locations
  LogLevel warn
  ErrorLog  /home/project1/web/log/error.log
  CustomLog /home/project1/web/log/access.log combined

</VirtualHost>

But now when browsing to project1.cairocubicles.com i get a different website (another website in the virtual host lists). I also tried changing ServerName www.project1.cairocubicles.com to ServerName project1.cairocubicles.com but then i got a 403 Forbidden error. Any clues?

Thanks.

Best Answer

Just a quick shot in the dark, but this may be a SELinux issue. When you go to the site you have configured as the ServerName, does anything show in the site specific logs? Does anything show up in /var/log/http/error.log?

Related Topic