Search code examples
asp.netapachemonomod-mono

Basic Mono installation wont work


Am using a CentOS 5.3 box as prod server and am trying to get mono running there. after much sifting i managed to install version 2.10.2 via yum. i installed also xsp and mod_mono the same way and created a simple hello world web page. thing is its not running. iam guessing something is up with my config files which are responsible for this. Being a newbie on both linux and apache configuration, i dont know whats wrong.

I have tried to follow some relative responses on the site but i cant get it work. So here is what ive done:

installed mono, xsp and mod_mono via yum; added to httpd.conf (mine is in /usr/local/apache/conf)

Include "/usr/local/apache/conf.d/*.conf"

then i created the following /usr/local/apache/conf.d/mod_mono.conf file :

MonoAutoApplication enabled LoadModule mono_module /usr/lib/httpd/modules/mod_mono.so

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 .config
AddType application/x-asp-net .Config
AddType application/x-asp-net .dll
DirectoryIndex index.aspx
DirectoryIndex Default.aspx
DirectoryIndex default.aspx

Alias /gpsmapper /usr/local/apache/htdocs/gpsmapper

MonoApplications "/gpsmapper:/usr/local/apache/htdocs/gpsmapper"

MonoServerPath "/opt/novell/mono/lib/mono/4.0/mod-mono-server4.exe"

SetHandler mono

i created an index.aspx under htdocs/gpsmapper but am getting a 503 Service temporarily unavailable.

Is any setting i made wrong?


Solution

  • You mix "MonoAutoApplication" and "MonoApplications" in the same file. I don't think it works. The AutoConfiguration feature allows precisely to avoid having to declare the application.

    Here is my own mod_mono.conf (used on Mac OS X 10.7.2 and Linux Ubuntu 11.04) :

    <IfModule !mono_module>
        LoadModule mono_module "libexec/apache2/mod_mono.so"
    </IfModule>
    
    <IfModule mono_module>
        AddType application/x-asp-net .config .cs .csproj .dll .resources .resx .sln .vb .vbproj
        AddType application/x-asp-net .asax .ascx .ashx .asmx .aspx .axd .browser .licx .master .rem .sitemap .skin .soap .webinfo
    
        MonoAutoApplication enabled
        MonoDebug true
        MonoServerPath "/usr/bin/mod-mono-server4"
        MonoSetEnv LANG=fr_FR.UTF-8
        MonoUnixSocket "/tmp/.mod_mono"
    
        <IfModule dir_module>
            DirectoryIndex Default.aspx
        </IfModule>
    
        <DirectoryMatch "/(bin|App_Code|App_Data|App_GlobalResources|App_LocalResources)/">
            Order deny,allow
            Deny from all
        </DirectoryMatch>
    
        <Location "/Mono">
            Order deny,allow
            Deny from all
            Allow from 127.0.0.1 ::1
            SetHandler mono-ctrl
        </Location>
    </IfModule>
    

    As you can see, I never define any Alias or MonoApplications directive.