Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 webmaster@example.com
        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.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

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 .

but I do have a /etc/httpd/conf/mod_mono.conf

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.

#
# Load config files from the config directory "/etc/httpd/conf.d".
#
Include conf.d/*.conf

For more information, see:

share|improve this answer
1  
That was it. During the configuration of mod_mono, the mod_mono.conf file is put under /conf/, so I assumed it was supposed to be there. Copying the file to /conf.d/ fixed this. Doh! –  Astaar Mar 26 '13 at 8:31
add comment

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.