我全新更新了Centos 6.3。 我从源代码安装了mono,xsp和mod_mono。每个包都编译完美。它们都安装了前缀为/ usr / local / mono(所以一切都在/ usr / local / mono下)
我已将“Include conf / mod_mono.conf”添加到我的httpd.conf文件中。 我使用http://go-mono.com/config-mod-mono/生成了一个虚拟主机。我必须稍微自定义它才能获得正确的二进制路径,但就是这样。
这是我的vhost内容(我删除了评论):
<VirtualHost *:80>
ServerName sandbox.domain.com
ServerAdmin web-admin@sandbox.domain.com
DocumentRoot /u01/www/vhosts/asp
MonoServerPath sandbox.domain.com "/usr/local/mono/bin/mod-mono-server2"
MonoDebug sandbox.domain.com true
MonoSetEnv sandbox.domain.com MONO_IOMAP=all
MonoApplications sandbox.domain.com "/:/u01/www/vhosts/asp"
<Location "/">
Allow from all
Order allow,deny
MonoSetServerAlias sandbox.domain.com
SetHandler mono
</Location>
</VirtualHost>
这是我尝试加载的页面(default.aspx):
<html>
<body>
Hello
</body>
</html>
这很简单。当我去它时,它给了我以下错误:
System.Web.Compilation.CompilationException
CS1576: The line number specified for #line directive is missing or invalid
Description: Error compiling a resource required to service this request. Review your source file and modify it to fix this error.
Details: CS1576: The line number specified for #line directive is missing or invalid
Error origin: Compiler
Error source file: /default.aspx
Exception stack trace:
at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.Web.VirtualPath virtualPath, System.CodeDom.Compiler.CompilerParameters options) [0x0035f] in /usr/local/src/mono-3.0.3/mcs/class/System.Web/System.Web.Compilation/AssemblyBuilder.cs:853
at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.Web.VirtualPath virtualPath) [0x00000] in /usr/local/src/mono-3.0.3/mcs/class/System.Web/System.Web.Compilation/AssemblyBuilder.cs:731
at System.Web.Compilation.BuildManager.GenerateAssembly (System.Web.Compilation.AssemblyBuilder abuilder, System.Web.Compilation.BuildProviderGroup group, System.Web.VirtualPath vp, Boolean debug) [0x00258] in /usr/local/src/mono-3.0.3/mcs/class/System.Web/System.Web.Compilation/BuildManager.cs:846
at System.Web.Compilation.BuildManager.BuildInner (System.Web.VirtualPath vp, Boolean debug) [0x0011c] in /usr/local/src/mono-3.0.3/mcs/class/System.Web/System.Web.Compilation/BuildManager.cs:469
文档根目录中没有其他文件。只是default.aspx。 apache错误日志中不会生成任何条目。 如果我将引擎从mod-mono-server2切换到mod-mono-server4(我们更喜欢使用),我会在apache错误日志中获得以下内容(在apache start上):
Listening on: /tmp/mod_mono_server_globalListening on: /tmp/mod_mono_server_global
Root directory: /
Root directory: /
Error: Address already in use
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/local/src/xsp-2.10.2/src/Mono.WebServer.Apache/main.cs:208
at Mono.WebServer.Apache.Server+ApplicationSettings..ctor () [0x0002a] in /usr/local/src/xsp-2.10.2/src/Mono.WebServer.Apache/main.cs:63
mod-mono-server4
Listening on: /tmp/mod_mono_server_sandbox.domain.com
Root directory: /u01/www/vhosts/asp
访问同一页面后,我收到500错误,以及apache错误日志中的以下内容:
Worker initialization exception occurred. Continuing anyway:
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.ModMonoWorkerRequest..cctor () [0x00034] in /usr/local/src/xsp-2.10.2/src/Mono.WebServer.Apache/ModMonoWorkerRequest.cs:85
System.NullReferenceException: Object reference not set to an instance of an object
at Mono.WebServer.BaseApplicationHost.EndOfRequest (Mono.WebServer.MonoWorkerRequest mwr) [0x00029] in /usr/local/src/xsp-2.10.2/src/Mono.WebServer/BaseApplicationHost.cs:141
at Mono.WebServer.ModMonoApplicationHost.ProcessRequest (Int32 reqId, System.String verb, System.String queryString, System.String path, System.String protocol, System.String localAddress, Int32 serverPort, System.String remoteAddress, Int32 remotePort, System.String remoteName, System.String[] headers, System.String[] headerValues, System.Object worker) [0x00173] in /usr/local/src/xsp-2.10.2/src/Mono.WebServer.Apache/ModMonoApplicationHost.cs:109
at (wrapper remoting-invoke-with-check) Mono.WebServer.ModMonoApplicationHost:ProcessRequest (int,string,string,string,string,string,int,string,int,string,string[],string[],object)
at Mono.WebServer.ModMonoWorker.InnerRun (System.Object state) [0x00199] in /usr/local/src/xsp-2.10.2/src/Mono.WebServer.Apache/ModMonoWorker.cs:239
at Mono.WebServer.ModMonoWorker.Run (System.Object state) [0x00002] in /usr/local/src/xsp-2.10.2/src/Mono.WebServer.Apache/ModMonoWorker.cs:92
[Wed Jan 30 15:22:43 2013] [error] (70014)End of file found: read_data failed
[Wed Jan 30 15:22:43 2013] [error] Command stream corrupted, last command was -1
System.NullReferenceException: Object reference not set to an instance of an object
at Mono.WebServer.BaseApplicationHost.EndOfRequest (Mono.WebServer.MonoWorkerRequest mwr) [0x00029] in /usr/local/src/xsp-2.10.2/src/Mono.WebServer/BaseApplicationHost.cs:141
at Mono.WebServer.ModMonoApplicationHost.ProcessRequest (Int32 reqId, System.String verb, System.String queryString, System.String path, System.String protocol, System.String localAddress, Int32 serverPort, System.String remoteAddress, Int32 remotePort, System.String remoteName, System.String[] headers, System.String[] headerValues, System.Object worker) [0x00173] in /usr/local/src/xsp-2.10.2/src/Mono.WebServer.Apache/ModMonoApplicationHost.cs:109
at (wrapper remoting-invoke-with-check) Mono.WebServer.ModMonoApplicationHost:ProcessRequest (int,string,string,string,string,string,int,string,int,string,string[],string[],object)
at Mono.WebServer.ModMonoWorker.InnerRun (System.Object state) [0x00199] in /usr/local/src/xsp-2.10.2/src/Mono.WebServer.Apache/ModMonoWorker.cs:239
at Mono.WebServer.ModMonoWorker.Run (System.Object state) [0x00002] in /usr/local/src/xsp-2.10.2/src/Mono.WebServer.Apache/ModMonoWorker.cs:92
[Wed Jan 30 15:22:43 2013] [error] (70014)End of file found: read_data failed
[Wed Jan 30 15:22:43 2013] [error] Command stream corrupted, last command was -1
有没有人知道为什么会这样?
答案 0 :(得分:4)
两年太晚了,但万一有人再次遇到问题......
我相信答案是在aspx文件中声明所需的编译语言。在.aspx文件的顶部添加以下行,我打赌它有效:
<%@ Page Language="C#" %>