Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have several folders in my /www folder that contain various applications. To keep things organized, I keep them in their own folders -- this includes my base application.

Examples:

  1. phpmyadmin = /www/phpmyadmin
  2. phpvirtualbox = /www/phpvirtualbox
  3. root domain site = /www/Landing

The reason I segregate all of my sites is that I actively develop on some of these (my root site) and when I publish via Visual Studio, I choose to delete prior to upload - if I put the Landing page in the base folder, it would be devastating for me.

My goal is that when I go to www.example.com - I go to my page. If I go to www.example.com/phpmyadmin, it does not work because of this in the Apache2 folder:

<Location "/"> # Error is the "/"
  Allow from all
  Order allow,deny
  MonoSetServerAlias domain
  SetHandler mono
  SetOutputFilter DEFLATE
  SetEnvIfNoCase Request_URI "\.(?:gif|jpe?g|png)$" no-gzip dont-vary
</Location>
<IfModule mod_deflate.c>
   AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript
</IfModule>

If I change the location to say "/Other", then the base site is broken, and the aliases are restored for the other sites. If it is "/", then the base site works and no aliases work.

What could I do to allow it to treat my /www/Landing as my webroot, but when I go to an alias, it GOES to the alias.

Edit: Added in the default VirtualHost info.

DocumentRoot /var/www
<VirtualHost *:80>
    ServerAdmin info@example.com
    ServerName www.example.com

ExpiresActive On
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType text/css "access plus 1 days"

  MonoServerPath domain "/usr/bin/mod-mono-server4"
  MonoDebug domain true
  MonoSetEnv domain MONO_IOMAP=all
  MonoApplications domain "/:/var/www/Landing"

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule (.*) /Landing/$1 [L]


#Need to watch what the Location is set to. Can cause issues for alias
<Location "/">
  Allow from all
  Order allow,deny
  MonoSetServerAlias domain
  SetHandler mono
  SetOutputFilter DEFLATE
  SetEnvIfNoCase Request_URI "\.(?:gif|jpe?g|png)$" no-gzip dont-vary
</Location>
<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript
</IfModule>

    ErrorLog ${APACHE_LOG_DIR}/error.log

    LogLevel warn
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
share|improve this question

1 Answer 1

I don't have any experience with Mono, but it seems like the other sites should work if you leave the location as / but only the base site would work if you set the location as /Landing.

What most people would do is simply leave the location as / and use mod_rewrite to map non-phpmyadmin or -phpvirtualbox requests to the /Landing/ directory, e.g.

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) /Landing/$1 [L]
share|improve this answer
    
Added this to the virtualhost file and still the same. –  Brent Feb 13 '12 at 22:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.