gpt4 book ai didi

apache - mod_mono 在新安装的 centos 上给出 EOF 错误

转载 作者:太空宇宙 更新时间:2023-11-03 17:14:31 24 4
gpt4 key购买 nike

我全新安装了完全更新的 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/ 生成了一个虚拟主机.为了获得正确的二进制路径,我不得不稍微对其进行自定义,但仅此而已。

这是我的虚拟主机内容(我删除了评论):

<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 启动时):

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

有人知道为什么会这样吗?

最佳答案

晚了两年,但以防万一有人再次遇到这个问题......

我相信答案是在 aspx 文件中声明所需的编译语言。在您的 .aspx 文件顶部添加以下行,我敢打赌它会起作用:

<%@ Page Language="C#" %>

关于apache - mod_mono 在新安装的 centos 上给出 EOF 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14612055/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com