[Mono-list] How to: mod_mono with apache 1.3 and virtual hosts?

Sebastian Gingter sgingter at web.de
Thu Dec 22 05:38:26 EST 2005


Hello,

I actually have a bit of a problem of running mod_mono with my apache 1.3 and in virtual hosts.
And first thing: sorry if my english isn't that good: It's rusted a bit in the last years...

I installed and configured mono, and when I use this entry in my httpd.conf:

Alias /mono "/var/www/mono"
MonoApplications "/mono:/var/www/mono"
<Directory /var/www/mono>
       SetHandler mono
</Directory>

it simly works there. The problem is: I have many virtual hosts configured and now I can
access the same web application with www.domain1.com/mono and www.domain2.com/mono etc...
But I don't want that.

What I want is to copy different web applications into different vhosts and run them there
ie. www.domain1.com with /var/www/domain1/index.aspx and
ie. www.domain2.com with /var/www/domain2/index.php wich runs under php but with the ability
to call a webform.aspx in the same directory that runs through mono. (I have a php based forum
and ther should be a seperate frontend for user management written in c# and this should be
accessed either by a direct call to that aspx or if that won'work at all in a pure sub directory of
that forum installation).

I tried this:

<VirtualHost xxx.xxx.xxx.xxx:80>
  ServerName domain2.com
  ServerAlias www.domain2.com
  ServerAdmin sgingter at web.de
  DocumentRoot /var/www/domain2/
  php_admin_value open_basedir /var/www/domain2/
  php_admin_flag safe_mode On
  ErrorLog /var/kunden/logs/sgingter-error.log
  CustomLog /var/kunden/logs/sgingter-access.log combined

  SetHandler mono
  MonoApplications "/:/var/www/domain2"
  MonoDocumentRootDir "/var/www/domain2"
</VirtualHost>

But when I make a call to www.domain2.de/WebForm.aspx it delivers only the aspx source
and it does not execute the application. Even with AddHandler mono .aspx .ascx .... it does
not execute the asp.net application.

There is no error in the logs or whatever, it just handles the aspx file like any other html or
txt file and delivers it's plain text. This config does not touch my php, the php applications still
run as they are intendet to.

The mod_mono_server is startet from apache and running (it's shown by ps aux) and well,
I don't have a clue where to still look right now to get that running.

Please give me a hint or two to the thing I must have overlooked or I must have done the
wrong way.

Some additional information: I'm running debian sarge and compiled mono by myself (as
I said, by using an alias it works, also command-line .net applications run without problems).
I use apache 1.3.34 and the latest stable mono sources.

Please help me, since I would love to use mono on linux for my .net applications. My apache's
completely confused about so much stopping, starting and restarting that I think it will be soon
really mad on me if that don't stops...

Thanks in advance,

   Sebastian Gingter


More information about the Mono-list mailing list