Mono / mod_mono setup - willing to pay for solution

Discussion in 'Parallels Plesk Panel 10.x for Linux Problems, Suggested Fixes, and How-To' started by dcollis, Dec 16, 2011.

  1. dcollis

    dcollis New Member

    Mono / mod_mono setup (CentOS 5)

    I've been trying to get mod_mono to work on my server and have been failing miserably.
    I want to be able to run MVC3 sites that require the latest version of Mono.

    I have managed to install mod_mono & mono server via YUM (I am running CentOS 5) but can't work out how to configure an individual virtual site to use it.

    I have been trying to configure this for a particular domain. Plesk appears to set things up so that each virtual site has it's own
    conf directory: i.e. /var/www/vhosts/
    In here, I think you are supposed to be able to add a vhost.conf that is used to configure the site, but nothing I do here seems to work (to get it to act as an MVC3 site using Mono).

    Are there any gurus out there that might be able to offer some advice (or just do it for me - and explain how I can do it for future sites)? I am willing to pay for some you to do it if your rates are reasonable.

    Last edited: Dec 19, 2011
  2. dcollis

    dcollis New Member

  3. dcollis

    dcollis New Member

    This is the next thing I tried:
    (I added the example conf there with paths updated as the vhost.conf file in the /var/www/vhosts/ directory).
    After restarting httpd and browsing to I was presented with the Apache 2 Test Page. Other sites appear to work correctly still...

    Any thoughts?
  4. dcollis

    dcollis New Member

    Well, I got something to work by taking the contents of the vhost.conf and putting it directly into the .include file that Plesk generates (which comes with a nice warning at the top telling you *not* to edit it and instead create the vhost.conf file).
    However, doing this appears to allow the mono server to attempt to start up when i visit the domain in question. Although it now throws an exception immediately. But I think perhaps this is a question for the mono mailing list.

    I will report back if I get any further, however, I would still be interested in what I am supposed to do rather than editing that .include file that Plesks warns me against doing...
  5. dcollis

    dcollis New Member

    Good news - Mono 2.10.2 is working on my server now.

    The misleading errors I was getting in my httpd\error log turned out to be caused be dlls in my bin directory that shouldn't be there. You need to remove the majority of the System.*.dlls as well as Microsoft.Web.Infrastructure, leaving just these ones:

    With this in-place, I was able to get my MVC3 site to run.

    So, now I just need to know how to make all of this Plesk-friendly. As I am fairly sure replacing the generated httpd.include file in my virtual host conf directory is the wrong way to go about this.

    If anyone has an answer for me, please let me know.
  6. dcollis

    dcollis New Member

  7. dcollis

    dcollis New Member

    A couple of other notes for other people who end up here looking for a solution:

    Ensure you install mono-addon mod_mono-addon versions. If you still have mono standard installed it might have conflicts. yum remove anything that is version 1.x.

    If you directly reference mono server paths if your conf file, then you don't need to worry. If you're going to sym links in /usr/bin then ensure they link to the correct version (delete & recreate if you need to).

    In your main /etc/httpd/conf/httpd.conf:
    Move the line:
    Include conf.d/*.conf
    To after the lines:
    User apache
    Group apache

    In your /etc/httpd/conf.d:
    The installer for me put in an incorrect path for the (in the LoadModule line).
    Change it to: LoadModule mono_module modules/ (if it isn't this).

    If you are making https requests in your code (from your server to other servers), you'll need to jump through hoops: (there are various ways to solve this problem, including turning it off, with a line such as this: ServicePointManager.ServerCertificateValidationCallback += (s, c, ch, ssl) => true;

    If you are using MEF, don't try and use DirectoryCatelogs (this causes problems when indexing dlls that have no exports). If using MefContrib, you'll need to add your own custom MvcApplicationRegistry into the startup so it doesn't scan the entire bin folder.

    Again, if anyone has an answer to how to this without over-writing Plesk generated conf files, I'd love to know :)

Share This Page