[Mono-aspnet-list] mod_mono sample configuration

Mike Morano mmorano at mikeandwan.us
Thu Jun 21 01:10:57 UTC 2012


On Wed, Jun 20, 2012 at 3:32 PM, Gonzalo Paniagua Javier
<gonzalo.mono at gmail.com> wrote:
> On Wed, Jun 20, 2012 at 12:51 PM, Mike Morano <mmorano at mikeandwan.us> wrote:
>> On Wed, Jun 20, 2012 at 11:46 AM, Gonzalo Paniagua Javier
>> <gonzalo.mono at gmail.com> wrote:
>>> On Wed, Jun 20, 2012 at 8:33 AM, Mike Morano <mmorano at mikeandwan.us> wrote:
>>>> Hello,
>>>>
>>>> I have an MVC3 site that is working fine in XSP4 on Mono 2.11.1
>>>> (installed with a prefix of /opt/mono-2.11, and run xsp4 after setting
>>>> my environment via the script listed here:
>>>> http://www.mono-project.com/Parallel_Mono_Environments).  This site is
>>>> leveraging the fact that mono now bundles the MVC3 components, and not
>>>> using mvc3 libraries in the bin folder of the site.
>>>>
>>>> However, I have not been successful in getting this site to run under
>>>> apache/mod_mono.  Trying different things yields different apache
>>>> errors, though the most promising was seeing the mono error page after
>>>> adding the following to the apache config (note the order of 4.0 vs.
>>>> 4.5):
>>>>
>>>> MonoPath site "/opt/mono-2.11/lib/mono/4.0:/opt/mono-2.11/lib/mono/4.5"
>>>>
>>>>
>>>> Does anyone have a working configuration you could share?
>>>
>>> You are probably missing 'MonoServerPath /opt/mono-2.11/bin/mod-mono-server4'.
>>>
>>> -Gonzalo
>>
>>
>> Thanks for your reply.
>>
>> I do have that in the config, here are mono related lines as they are
>> currently set:
>>
>> MonoDebug site true
>> MonoAutoApplication disabled
>> MonoPath site /opt/mono-2.11/lib/mono/4.0:/opt/mono-2.11/lib/mono/4.5
>> MonoServerPath site /opt/mono-2.11/bin/mod-mono-server4
>> MonoDocumentRootDir site /srv/www/site
>> MonoApplications site /:/srv/www/site
>> MonoUnixSocket site /tmp/mod_mono_server_site
>>
>> With the above, here is the information on the mono asp.net error page:
>>
>> System.Exception
>> Compiler failed to produce the assembly. Output: ''
>>
>> Description: HTTP 500.Error processing request.
>>
>> Details: Non-web exception. Exception origin (name of application or
>> object): System.
>> Exception stack trace:
>> at Mono.CSharp.CSharpCodeCompiler.CompileFromFileBatch
> [...]
>>
>> Does anything else look off?
>
> I never set MonoPath when configuring Apache. If it still fails, try
> disabling batch compilation of the pages, which will tell you which
> file is causing the compilation problem.
>

After setting batch="false" in the web.config, I am still getting the
same error, with no files listed.

I should probably mention how I built the site:

$MONO_PREFIX/bin/mcs \
    -target:library \
    -pkg:dotnet \
    -r:System.ComponentModel.DataAnnotations \
    -r:System.Configuration \
    -r:System.Web.ApplicationServices \
    -r:System.Web.Extensions \
    -r:System.Web.Mvc \
    -r:System.Web.WebPages \
    -r:$DEPLOY_PATH/bin/log4net.dll \
    -r:$DEPLOY_PATH/bin/mysql.data.dll \
    -out:$DEPLOY_PATH/bin/maw.dll \
    -recurse:$SOURCE_PATH/*.cs

This compiles fine, gives the following warning:
warning CS1701: Assuming assembly reference `System.Web.WebPages,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
matches assembly `System.Web.WebPages, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35'. You may need to
supply runtime policy
Compilation succeeded - 1 warning(s)

I assume this is still a valid approach to preparing the application
(this compiled version runs on xsp)?

I also tried calling mod-mono-server4 from the command line 2
different ways, to try and mimic how apache is  invoking the process.
Below are the 2 invocations, perhaps shedding a bit more light on the
error when monopath is not used:

** setting monopath (when properly run in apache, yields mono asp.net
error page)
MONO_PATH=/srv/www/mikeandwan.us/bin:/opt/mono-2.11/lib/mono/4.0:/opt/mono-2.11/lib/mono/4.5
/opt/mono-2.11/bin/mono --debug
/opt/mono-2.11/lib/mono/4.0/mod-mono-server4.exe --filename
/tmp/mod_mono_server_maw --applications /:/srv/www/mikeandwan.us
--nonstop --root /srv/www/mikeandwan.us
mod-mono-server4
mod-mono-server4
Listening on: /tmp/mod_mono_server_maw
Root directory: /srv/www/mikeandwan.us

** without setting monopath (when run via apache, yields apache
'internal server error' page)
/opt/mono-2.11/bin/mono --debug
/opt/mono-2.11/lib/mono/4.0/mod-mono-server4.exe --filename
/tmp/mod_mono_server_maw --applications /:/srv/www/mikeandwan.us
--nonstop --root /srv/www/mikeandwan.us
mod-mono-server4
Missing method System.Configuration.IConfigurationSectionHandler::Create(object,object,XmlNode)
in assembly /opt/mono-2.11/lib/mono/4.0/System.dll, referenced in
assembly /opt/mono-2.11/lib/mono/4.0/System.Configuration.dll
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
/home/mmorano/software/mono/build/xsp-2.10.2/src/Mono.WebServer.Apache/main.cs:208
  at Mono.WebServer.Apache.Server+ApplicationSettings..ctor ()
[0x0002a] in /home/mmorano/software/mono/build/xsp-2.10.2/src/Mono.WebServer.Apache/main.cs:63
mod-mono-server4
Listening on: /tmp/mod_mono_server_maw
Root directory: /srv/www/mikeandwan.us

Any additional thoughts?

Thanks,
Mike


More information about the Mono-aspnet-list mailing list