Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have Mono 3.0.6 up and running on a CentOS 6/Apache 2 setup. I have published an ASP.NET 4.5/MVC4 website on the server. However, when I try to reach the website I get a status code 503 (Service Temporarily Unavailable), and in the logs I can see that Mono is not even trying to catch the request (as it should try to route me from / to /Home/):

[Tue Mar 26 14:18:38 2013] [error] [client] Directory index forbidden by Options directive: /var/www/mvcgui/wwwroot/

I'm using the default Apache configuration, and copied mod_mono.conf to /etc/httpd/conf.d/00-mod_mono.conf. My VHOST is in the same directory as 01-mvcgui.conf (to make sure it's loaded after Mono). This is my vhost:

<VirtualHost _default_:80>
        DocumentRoot /var/www/mvcgui/wwwroot
        ErrorLog /var/www/mvcgui/error.log
        CustomLog /var/www/mvcgui/requests.log combined

        ## Mono-specific configuration ##
        MonoServerPath mvcgui "/opt/mono/bin/mod-mono-server4"
        MonoDebug mvcgui true
        MonoSetEnv mvcgui MONO_IOMAP=all
        MonoApplications mvcgui "/:/var/www/mvcgui/wwwroot"
        ## End Mono-specific configuration
        <Location />
        MonoSetServerAlias mvcgui
        SetHandler mono

I suspect the requests are not being passed on to Mono. How could I make sure it's the case?

share|improve this question

Of course, after 1 day spent on this I found the solution 5 minutes after posting here. I thought I'd share the result. For ASP.NET 4.5/MVC4, you need to change the path into which mod-mono-server4 gets the lib.

Edit the file:

vi /opt/mono/bin/mod-mono-server4

And in it change that line :

    exec /opt/mono/bin/mono $MONO_OPTIONS "/opt/mono/lib/mono/**4.0**/mod-mono-server4.exe" "$@"

With this one:

    exec /opt/mono/bin/mono $MONO_OPTIONS "/opt/mono/lib/mono/**4.5**/mod-mono-server4.exe" "$@"

I suspect that Mono wasn't 'intercepting' the requests because the server didn't start properly because of that lib path issue. Now I'm getting the .NET pages as expected.

share|improve this answer

Your Answer


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.