mod-mono-server 4 is not working, while 2 does

5,555

The answer provided by the original poster:

To fix it, you have to copy mod-mono-server4.exe from /opt/mono/lib/mono/4.0 (or wherever you've installed it) to /opt/mono/lib/mono/4.5 and then to edit mod-mono-server4 in /opt/mono/bin from

exec /opt/mono/bin/mono $MONO_OPTIONS "/opt/mono/lib/mono/4.0/mod-mono-server4.exe" "$@"

to

exec /opt/mono/bin/mono $MONO_OPTIONS "/opt/mono/lib/mono/4.5/mod-mono-server4.exe" "$@"
Share:
5,555

Related videos on Youtube

Vladimir Glushkov
Author by

Vladimir Glushkov

Updated on September 18, 2022

Comments

  • Vladimir Glushkov
    Vladimir Glushkov over 1 year

    I need to deploy an ASP.NET MVC4 (MVC3 at least) application on Centos 6 server.

    I've installed Mono 3.2.1, XSP4, mod_mono (for use with apache web server) and succesfully ran the test application that goes with mono. I used a config tool to create a config for app directory and deployed an empty ASP.NET WebPages project created in VS2012 on .Net 2.0 - it ran ok. But I need to run an .net 4.5 or at least 4.0 application, so I've set the MonoServerPath to mod-mono-server4 instead of mod-mono-server2 in the config, but now i'm getting a "Service Temporarily Unavailable" error while trying to access the asp.net project directory (even empty).

    What should I check for?

    Update: I checked the apache log and here what it shows:

    mod-mono-server4
    Exception caught during reading the configuration file:
    System.MissingMethodException: Method not found: 'System.Configuration.IConfigurationSectionHandler.Create'.
      at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection (System.String configKey) [0x00000] in <filename unknown>:0 
      at System.Configuration.ConfigurationManager.GetSection (System.String sectionName) [0x00000] in <filename unknown>:0 
      at System.Configuration.ConfigurationManager.get_AppSettings () [0x00000] in <filename unknown>:0 
      at Mono.WebServer.Apache.Server.get_AppSettings () [0x00001] in /usr/src/xsp-2.10.2/src/Mono.WebServer.Apache/main.cs:208 
      at Mono.WebServer.Apache.Server+ApplicationSettings..ctor () [0x0002a] in /usr/src/xsp-2.10.2/src/Mono.WebServer.Apache/main.cs:63 
    mod-mono-server4
    Listening on: /tmp/mod_mono_server_Unreal
    Root directory: /var/www/html/Unreal
    Error: An exception was thrown by the type initializer for System.Net.Sockets.Socket
    mod-mono-server4
    Exception caught during reading the configuration file:
    System.MissingMethodException: Method not found: 'System.Configuration.IConfigurationSectionHandler.Create'.
      at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection (System.String configKey) [0x00000] in <filename unknown>:0 
      at System.Configuration.ConfigurationManager.GetSection (System.String sectionName) [0x00000] in <filename unknown>:0 
      at System.Configuration.ConfigurationManager.get_AppSettings () [0x00000] in <filename unknown>:0 
      at Mono.WebServer.Apache.Server.get_AppSettings () [0x00001] in /usr/src/xsp-2.10.2/src/Mono.WebServer.Apache/main.cs:208 
      at Mono.WebServer.Apache.Server+ApplicationSettings..ctor () [0x0002a] in /usr/src/xsp-2.10.2/src/Mono.WebServer.Apache/main.cs:63 
    mod-mono-server4
    Listening on: /tmp/mod_mono_server_Unreal
    Root directory: /var/www/html/Unreal
    Error: An exception was thrown by the type initializer for System.Net.Sockets.Socket
    mod-mono-server4
    Exception caught during reading the configuration file:
    System.MissingMethodException: Method not found: 'System.Configuration.IConfigurationSectionHandler.Create'.
      at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection (System.String configKey) [0x00000] in <filename unknown>:0 
      at System.Configuration.ConfigurationManager.GetSection (System.String sectionName) [0x00000] in <filename unknown>:0 
      at System.Configuration.ConfigurationManager.get_AppSettings () [0x00000] in <filename unknown>:0 
      at Mono.WebServer.Apache.Server.get_AppSettings () [0x00001] in /usr/src/xsp-2.10.2/src/Mono.WebServer.Apache/main.cs:208 
      at Mono.WebServer.Apache.Server+ApplicationSettings..ctor () [0x0002a] in /usr/src/xsp-2.10.2/src/Mono.WebServer.Apache/main.cs:63 
    mod-mono-server4
    Listening on: /tmp/mod_mono_server_Unreal
    Root directory: /var/www/html/Unreal
    Error: An exception was thrown by the type initializer for System.Net.Sockets.Socket
    [Wed Sep 25 08:45:13 2013] [error] Failed to connect to mod-mono-server after several attempts to spawn the process.
    
    • Parrhesia Joe
      Parrhesia Joe over 9 years
      You should answer your own question and mark it as answered, rather than editing the question. This was useful to me, although I almost missed the fact that an answer was in the question.