我需要在 Centos 6 服务器上部署 ASP.NET MVC4(至少 MVC3)应用程序。
我已经安装了 Mono 3.2.1、XSP4、mod_mono(与 apache Web 服务器一起使用)并成功运行了与 Mono 一起使用的测试应用程序。我使用配置工具为应用程序目录创建配置,并部署在 .Net 2.0 上的 VS2012 中创建的空 ASP.NET WebPages 项目 - 它运行正常。但我需要运行 .net 4.5 或至少 4.0 应用程序,因此我在配置中将 MonoServerPath 设置为 mod-mono-server4 而不是 mod-mono-server2,但现在我收到“服务暂时不可用” ” 尝试访问 asp.net 项目目录(甚至为空)时出错。
我应该检查什么?
更新:我检查了 apache 日志,它显示的内容如下:
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.
答案1
原贴者给出的答案:
要修复它,您必须
mod-mono-server4.exe
从/opt/mono/lib/mono/4.0
(或安装它的任何地方)复制到/opt/mono/lib/mono/4.5
,然后mod-mono-server4
在/opt/mono/bin
其中进行编辑exec /opt/mono/bin/mono $MONO_OPTIONS "/opt/mono/lib/mono/4.0/mod-mono-server4.exe" "$@"
到
exec /opt/mono/bin/mono $MONO_OPTIONS "/opt/mono/lib/mono/4.5/mod-mono-server4.exe" "$@"