Mod_mono gives EOF errors for fresh centos installation

I have a new version of Centos 6.3 fully updated. I have installed mono, xsp and mod_mono from sources. Each package is well composed. They were all installed prefixed with / usr / local / mono (so everything is under / usr / local / mono)

I added "Include conf / mod_mono.conf" to the httpd.conf file. I created a virtual host using http://go-mono.com/config-mod-mono/ . I had to tweak it a bit to get the correct binary path, but that's it.

Here is my vhost content (I removed the comments):

<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>

      

This is the page I'm trying to load (default.aspx):

<html>
<body>
Hello
</body>
</html>

      

It's nice and simple. When I go to it, it throws the following error:

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 

      

There are no other files in the document root. Just default.aspx. No entries are generated in the apache error log. If I switch the engine from mod-mono-server2 to mod-mono-server4 (which we would prefer to use), I get the following in the apache error log (when apache starts):

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

      

After visiting the same page, I get a 500 error and in the apache error log:

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

      

Does anyone know why this was?

+3


source to share


1 answer


Two years too late, but just in case someone will run into a problem again ...

I believe the answer lies in declaring the desired compilation language in the aspx file. Add the following line at the top of your .aspx file, and I'll bet it works:



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

      

+4


source







All Articles