[Mono-list] How to configure N apache virtual hosts using ONE instance of MONO server.

Joshua Tauberer jit at occams.info
Sat Apr 12 10:09:29 EDT 2008


Unai Rodriguez wrote:
> I am having a hard time trying to set up a site which is serving several 
> virtual hosts (Apache's name based virtual hosting) BUT using ONE 
> instance of MONO server.
> 
> Having several instances of mono server running made my web server's 
> memory shoot up. I am not sure if this is expected either.

It depends on what you're loading up in your application. My 
mod-mono-server processes are in the 50-200 MB memory usage range.

> My current settings are as follows:
> 
> <VirtualHost *:80>
>      [...]
>      ServerName  site1.example.com
>      DocumentRoot /docroot1
>      MonoApplications "/:/docroot1"
>      [...]
> </VirtualHost>
> 
> <VirtualHost *:80>
>      [...]
>      ServerName  site2.example.com
>      DocumentRoot /docroot2
>      MonoApplications "/:/docroot2"
>      [...]
> </VirtualHost>
> 
> This config creates 2 instances of mono.

Right.

> I have tried this also:
> 
> <VirtualHost *:80>
>      [...]
>      ServerName  site1.example.com
>      DocumentRoot /docroot1
>      MonoApplications site "/:/docroot1"
>      [...]
> </VirtualHost>
> 
> <VirtualHost *:80>
>      [...]
>      ServerName  site2.example.com
>      DocumentRoot /docroot2
>      MonoApplications site "/:/docroot2"
>      [...]
> </VirtualHost>
> 
> In this case what happens is only one applications is active, meaning:
> 
> http://site1.example.com -> would show up
> 
> http://site2.example.com -> would show an Internal Server Error.

This is sort of a bug.

> How am I supposed to configure this?

You should try specifying the MonoApplications directives outside of the 
vhost blocks. Something like:

MonoApplications 
"site1.example.com:/:/docroot1,site2.example.com:/:/docroot2"

I can't remember if this actually works or not.

-- 
- Josh Tauberer

http://razor.occams.info

"Yields falsehood when preceded by its quotation!  Yields
falsehood when preceded by its quotation!" Achilles to
Tortoise (in "Godel, Escher, Bach" by Douglas Hofstadter)


More information about the Mono-list mailing list