default domain and first domain in apache2 causing trouble
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.
Do you have ‘NameVirtualHost *:80′ defined before all your virtual hosts? Are all your sited listed in one file in order?
Check more discussion of this question.
Related posts:
Leave a comment
Recent Posts
- Windows File Permissions and Attributes
- What is the easiest way to upgrade my existing Perl 5.14 to Perl 5.16 on FreeBSD 9 using the ports system?
- Know if mysql has done its job
- Redirect https .com to https .co.uk without a valid SSL cert on .com without DNS change
- Why is it a bad idea to use customer email as from address





