default domain and first domain in apache2 causing trouble

Posted by acidzombie24 on Server Fault See other posts from Server Fault or by acidzombie24
Published on 2010-12-28T05:03:20Z Indexed on 2010/12/28 6:56 UTC
Read the original article Hit count: 225

Filed under:

I have 3 sites and a default/test site using mono's test page.

I created aFirst, c, d, e, zLast. zLast has rewrite rules that should be evaluated last. Since the first VirtualHost seen is the default i set it to this

--aFirst--
<VirtualHost *:80>
    ServerName www.domain.tld
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/test
    DirectoryIndex index.html index.aspx index.php
    MonoDocumentRootDir "/var/www/test"
    MonoServerPath rootsite "/usr/local/bin/mod-mono-server2"
    MonoApplications rootsite "/:/var/www/test"

    <Directory /var/www/test>
        MonoSetServerAlias rootsite
        SetHandler mono
        AddHandler mod_mono .aspx .ascx .asax .ashx .config .cs .asmx
    </Directory>
</VirtualHost>

The problem is my default page (the ip address of my server) and the first website (csite.ddomain.net) have problems (even though csite is defined in c and is not the first virtual host). The ip address of my server and csite.ddomain.net ALWAYS load the same site. Either monos test page or the csite. It flips every time i restart apache. Why isnt the server ip address always loading the default page (mono test page) and why isnt csite.ddomain.net always loading the site i want!?!

Heres the config for

--csite--
<VirtualHost *:80>
    ServerName  csite.testdomain.net
    ServerAdmin webmaster@localhost

    ServerAlias s.csite.testdomain.net

    DocumentRoot /var/www/prjname
    DirectoryIndex index.html index.aspx
    MonoDocumentRootDir "/var/www/prjname"
    MonoServerPath rootsite "/usr/local/bin/mod-mono-server2"
    MonoApplications rootsite "/:/var/www/prjname"

    <Directory /var/www/prjname>
        MonoSetServerAlias rootsite
        SetHandler mono
        AddHandler mod_mono .aspx .ascx .asax .ashx .config .cs .asmx
    </Directory>

</VirtualHost>

aFirst, c, d, e, zLast are all enabled.

© Server Fault or respective owner

Related posts about apache