I have compiled and installed Mono 3.0.6, XSP and mod_mono on CentOS, following mostly these instructions.
My VHOST is configured as such:
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/mvcgui/wwwroot
ServerName 192.168.40.132
# ServerAlias example.com
ErrorLog /var/www/mvcgui/error.log
CustomLog /var/www/mvcgui/requests.log combined
MonoServerPath mvcgui "/opt/mono/bin/mod-mono-server4"
MonoDebug mvcgui true
MonoSetEnv mvcgui MONO_IOMAP=all
MonoApplications mvcgui "/:/var/www/mvcgui/wwwroot"
</VirtualHost>
However when I try to start the httpd service, I get an error:
Invalid command 'MonoServerPath', perhaps misspelled or defined by a module not included in the server configuration
So I'm thinking that my mod_mod is not loaded, but I do have a /etc/httpd/conf/mod_mono.conf configured like this:
[root@dev-server httpd]# cat /etc/httpd/conf/mod_mono.conf
# mod_mono.conf
# Achtung! This file may be overwritten
# Use 'include mod_mono.conf' from other configuration file
# to load mod_mono module.
<IfModule !mod_mono.c>
LoadModule mono_module /usr/lib/httpd/modules/mod_mono.so
</IfModule>
<IfModule mod_headers.c>
Header set X-Powered-By "Mono"
</IfModule>
AddType application/x-asp-net .aspx
AddType application/x-asp-net .asmx
AddType application/x-asp-net .ashx
AddType application/x-asp-net .asax
AddType application/x-asp-net .ascx
AddType application/x-asp-net .soap
AddType application/x-asp-net .rem
AddType application/x-asp-net .axd
AddType application/x-asp-net .cs
AddType application/x-asp-net .vb
AddType application/x-asp-net .master
AddType application/x-asp-net .sitemap
AddType application/x-asp-net .resources
AddType application/x-asp-net .skin
AddType application/x-asp-net .browser
AddType application/x-asp-net .webinfo
AddType application/x-asp-net .resx
AddType application/x-asp-net .licx
AddType application/x-asp-net .csproj
AddType application/x-asp-net .vbproj
AddType application/x-asp-net .config
AddType application/x-asp-net .Config
AddType application/x-asp-net .dll
DirectoryIndex index.aspx
DirectoryIndex Default.aspx
DirectoryIndex default.aspx
[root@dev-server httpd]#
What am I doing wrong? I've spent hours on this, and I've looked at many discussions here and other parts of the web and nothing seems to match my problem.
I believe you are correct in saying that mod_mono is not loaded. This is because Apache his not reading your config file, and therefore never receives the instructions to
LoadModule mono_module
.Apache will not read
/etc/httpd/conf/mod_mono.conf
by default.You should move mod_mono.conf to
/etc/httpd/conf.d
, where it will get picked up when Apache is reloaded. Normally only the Apache 'main' configuration lives under/etc/httpd/conf/
, while your new customizations, third party configuration files, etc. live under/etc/httpd.conf.d
.Your main HTTPD configuration file at
/etc/httpd/conf/httpd.conf
should contain a section like the following. This tells Apache to look for additional config files under the conf.d directory.For more information, see:
Include
.