configuring apache with mod_mono for .net app
Posted
by
Mystere Man
on Server Fault
See other posts from Server Fault
or by Mystere Man
Published on 2012-06-28T20:49:38Z
Indexed on
2012/06/28
21:18 UTC
Read the original article
Hit count: 260
I'm having a huge problem getting mod_mono and apache configured to work correctly. I've had this working at one time, but I can't seem to figure out where i'm going wrong. I'm using mono-server4.
I'm trying to use a seperate port from the main website. So I have in /etc/apache2/sites-available (with a link from sites-enabled) a vhost configuration that looks like this:
<VirtualHost *:9999>
ServerName XXX
ServerAdmin web-admin@XXX
DocumentRoot /var/xxx
MonoServerPath XXX "/usr/bin/mod-mono-server4"
MonoDebug XXX true
MonoSetEnv XXX MONO_IOMAP=all
MonoApplications XXX "/:/var/xxx"
<Location "/">
Allow from all
Order allow,deny
MonoSetServerAlias XXX
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>
</VirtualHost>
I used mono-server4-admin to create the application
mono-server4-admin --path=/var/xxx --app=/XXX --port=9999
When i start apache, it gives the error:
Syntax error on line 13 of /etc/apache2/sites-enabled/xxx:
Server alias 'XXX, not found.
This corresponds with the MonoSetServerAlias statement. So I commented it out, and when I do that apache starts. However, when I try to access the site, I get a 500 error.
The access log indicates that it's trying to access the app on port 80, rather than 9999. I'm not sure what the problem is here. Can anyone help me get figure out where I went wrong?
My mono-server4-hosts.conf contains this:
# start /etc/mono-server4/conf.d/RMRSite/10_XXX
Alias /XXX "/var/xxx"
AddMonoApplications default "/XXX:/var/xxx"
<Directory /var/xxx>
SetHandler mono
<IfModule mod_dir.c>
DirectoryIndex index.aspx
</IfModule>
</Directory>
# end /etc/mono-server4/conf.d/XXX/10_XXX
Also, my /etc/mono-server4/conf.d/XXX/10_XXX contains this:
This is the configuration file
for the XXX virtualhost
path = /var/xxx
alias = /XXX
vhost = localhost
port = 9999
© Server Fault or respective owner