0

Hey I'm having an issue getting my subdomains to show up, I am using HTTPD and have set up my conf in conf.d witht he following

<VirtualHost *:80>
    ServerName wp.{domain}.com
    SetEnvIfNoCase HOST ^wp\.{domain}\.com\.?(:80)?$ PROTECTED_HOST

    DocumentRoot /var/www/html/wp.{domain}.com

    LogLevel info ssl:warn
    ErrorLog ${APACHE_LOG_DIR}/wp.error.log
    CustomLog ${APACHE_LOG_DIR}/wp.access.log combined

    DirectoryIndex index.php

    SetEnv APPLICATION_ENV development

    <Directory /var/www/html/wp.{domain}.com/>
        AuthUserFile /root/htpasswd
        AuthType Basic
        AuthName "Password Protected"

        Order Deny,Allow
        Satisfy any
        Deny from all
        Require valid-user
        Allow from env=!PROTECTED_HOST
    </Directory>
</VirtualHost>

I have also put this in my httpd.conf

my hosts file looks as follows

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

127.0.0.1       {domain}.com        wp.{domain}.com
192.237.179.187 {domain}.com        wp.{domain}.com
10.208.155.37   serve.smart.com     wp.{domain}.com

The error that I am getting is _default_ VirtualHost overlap on port 80, the first has precedence

While adding NameVirtualHost *:80 my sub domain stop working

how do I fix this?

2
  • What other virtual hosts do you have configured? It sounds as though a different vhost is answering for domain.com. Dec 26, 2013 at 18:24
  • This is it, I agree with your observation though, I'm also wondering if the A-Records have been set as well, I believe this would cause similar symptoms. I'm trying to get a hold of the client now
    – ehime
    Dec 26, 2013 at 18:35

1 Answer 1

1

You seem to be missing ServerAlias {domain}.com in your vhost configuration.

If that vhost is the only one or the default (first) one, then it won't matter because any hostnames that don't match will go to that one. But from the error message you're getting, it sounds as though you have other vhosts as well. You didn't tell us what those are.

Why do you have wp.domain.com resolving to three different IP addresses? I've never tried that so I'm not sure what you get - the first, last, random, or round robin.

2
  • You get a round robin effect tmk, I'll give your solution a try, plus one and thanks for taking the time to come up with the answer =)
    – ehime
    Dec 26, 2013 at 17:53
  • unfortunately this does not work =)
    – ehime
    Dec 26, 2013 at 17:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .