4

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?

poupou
  • 43,413
  • 6
  • 77
  • 174
sergio
  • 1,026
  • 2
  • 19
  • 43

1 Answers1

3

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.

CedX
  • 3,854
  • 2
  • 36
  • 45
  • I can't get mod_mono working on lion. Did you have to compile mono to be 64 bit? I've asked a question that you could probably answer but I won't paste the link here. – Josh Smeaton Jan 12 '12 at 22:59
  • Mono on OSX is 32-bit only. Mod_mono must be compiled from source ([here](http://ftp.novell.com/pub/mono/sources/mod_mono/mod_mono-2.10.tar.bz2)) with the usual commands : ./configure, make, sudo make install. If it does not work, please provide more info on what's going on. – CedX Jan 12 '12 at 23:02
  • I feel bad for hijacking your answer, but my question with more detail is [here](http://stackoverflow.com/questions/8815403/trouble-installing-mod-mono-on-mac-osx-lion) – Josh Smeaton Jan 13 '12 at 00:31
  • No problem :o) [I've answered](http://stackoverflow.com/questions/8815403/trouble-installing-mod-mono-on-mac-osx-lion/8845000#8845000) but I don't think that it solves your error... – CedX Jan 13 '12 at 02:02
  • Did you get xsp and mod_mono working on CentOs? I'm running into a ton of dependency errors so it would be nice to hear from someone who's gotten it working – Chazt3n Feb 15 '13 at 18:37
  • 1
    Most configuration examples I had seen had a `SetHandler mono` in there, which was actually breaking things. Somehow it causes mod_mono to try to use `mod-mono-server2` instead. So.... no `SetHandler mono`. Thanks :) – Thorarin Feb 14 '15 at 09:23