[Mono-bugs] [Bug 679598] New: Apache+mod_mono, xsp or MonoFastCGI does not obey the <httpHandlers/><add path="anypathhereisbuggy" />

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Mar 14 22:33:49 EDT 2011



           Summary: Apache+mod_mono, xsp or MonoFastCGI does not obey the
                    <httpHandlers/><add path="anypathhereisbuggy" />
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.8.x
          Platform: Other
        OS/Version: RHEL 5
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: Sys.Web
        AssignedTo: mhabersack at novell.com
        ReportedBy: demis.bellot at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US)
AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.127 Safari/534.16

Basically after numerous integration tests the only path that works reliably is
the wildcard path <add path="*" />. Where all requests are passed to the target

I've found any other path to have some issues and does not behave as it does in
ASP.NET hosts on windows.

I've assembled a number of 'lightweight starter projects' with different
configurations that are subject to a series of integration tests.

The full source code for the 'starter projects' that are being tested are
available at:

The full source code for the integration tests that generated the reports below
is available at:

Here is the integration test report results for CentOS running on
Nginx/FastGGI, Apache+mod_mono, xsp2/xsp4 and ConsoleAppHost:

for comparison here are the equivalent windows benchmarks:

The Web.Config's used in the started project is the result of the most
consistent experience I could find across Windows/.NET and Linux/MONO platforms
running as-is without any code or binary changes (my goal).

1) The major bug that occurs in all MONO ASP.NET hosts using a custom handler
(e.g. /api) is that if the virtual host / application path (i.e.
/CustomPath/api ) does not start with the same name as registered <httpHandler
/><add path="api*"/> then for some strange reason (i.e. as these 2
configurations shouldn't be related), it fails to pass nested paths more than 1
level deep, e.g: 

http://servicestack.net/CustomPath40/api/hello - works
http://servicestack.net/CustomPath40/api/hello/world - does not work
http://servicestack.net/CustomPath40/api/hello/world/1/2/3 - neither does any
nested part from here on in

By contrast if the virtual path started with the same name e.g. /ApiPath35 and
a <httpHandler/> of 'api*' then all requests below work as expected:

2) It is hard to configure a default document for '/' without it being
automatically added to the request url and have it still be passed to the
registered handler. Ideally I would like /default.htm to be handled by Nginx or
Apache if it exists otherwise '/' gets passed to the <httpHandler />

Reproducible: Always

Steps to Reproduce:
1. Eh, run the integration tests or call the urls:

http://servicestack.net/ApiPath35/api/ - is running Nginx/FastCGI
http://api.servicestack.net/ApiPath35/api/ - anything in the api.* sub domain
is running Apache+mod_mono

My Apache conf looks like this:

LoadModule mono_module /usr/lib/httpd/modules/mod_mono.so

<VirtualHost *:80>
        ServerName api.servicestack.net
        HostnameLookups Off
        UseCanonicalName On
        MonoPath default /opt/mono
        MonoServerPath default /opt/mono/bin/mod-mono-server2

    AddMonoApplications default
    <Location /ApiPath35>
        MonoSetServerAlias default
                SetHandler mono

Actual Results:  
404s mostly as a result of the request not being passed to the registered
<httpHandler />

Expected Results:  
200 OK, which happens if the request makes it through to the <httpHandler />

There are many differences in how Windows ASP.NET and MONO ASP.NET handles the
<httpHandler /><add path="*"/> that are inconsistent across win/linux
platforms. i.e. ASP.NET doesn't need a wild card e.g. path="api" will allow all
/api/requests/from/here to get passed through to the httpHandler. At best MONO
requires path="api*" and a strict matching of virtual path / app name with the
registered handler.

Feel free to email me on demis.bellot at gmail.com for any clarifications of this

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the mono-bugs mailing list