Results 1 to 7 of 7

Thread: Mono / mod_mono setup - willing to pay for solution

  1. #1
    Kilo Poster
    Join Date
    Feb 2008
    Posts
    13

    Default 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/mydomain.com/conf/
    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.

    Thanks,
    David
    Last edited by dcollis; Dec 19, 2011 at 08:03 AM. Reason: Wanted to make title clearer for others



  2. #2
    Kilo Poster
    Join Date
    Feb 2008
    Posts
    13

    Default

    These instructions helped me get to the point I am at now: http://developer.mindtouch.com/en/do...Mono_on_CentOS



  3. #3
    Kilo Poster
    Join Date
    Feb 2008
    Posts
    13

    Default

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

    Any thoughts?



  4. #4
    Kilo Poster
    Join Date
    Feb 2008
    Posts
    13

    Default

    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. #5
    Kilo Poster
    Join Date
    Feb 2008
    Posts
    13

    Default

    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:
    System.Web.Mvc
    System.Web.Helpers
    System.Web.Routing
    System.Web.Razor
    System.Web.WebPages
    System.Web.WebPages.Razor
    System.Web.WebPages.Deployment

    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. #6
    Kilo Poster
    Join Date
    Feb 2008
    Posts
    13

    Default

    I also found this helpful: http://www.go-mono.com/config-mod-mono/



  7. #7
    Kilo Poster
    Join Date
    Feb 2008
    Posts
    13

    Default

    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 mod_mono.so (in the LoadModule line).
    Change it to: LoadModule mono_module modules/mod_mono.so (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: http://www.mono-project.com/FAQ:_Security (there are various ways to solve this problem, including turning it off, with a line such as this: ServicePointManager.ServerCertificateValidationCal lback += (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



Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •