0

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 192.168.40.1] 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>
        ServerAdmin webmaster@example.com
        DocumentRoot /var/www/mvcgui/wwwroot
        ServerName 192.168.40.132
        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
        </Location>
</VirtualHost>

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

Astaar
  • 448
  • 1
  • 8
  • 18

1 Answers1

0

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.

Astaar
  • 448
  • 1
  • 8
  • 18