[Mono-devel-list] Patching mod_mono to provide ASP.NET support for an entire virtual host on Apache 1.3.28

Christopher McGinnis christopherm at neopets.com
Thu May 13 02:31:25 EDT 2004

After compiling mod_mono and configuring it to server ASP.NET pages for a
complete virtual host I found that Apache would no longer server any web
pages (including ASP.NET). Serving ASP.NET pages in a virtual/alias'd
directory, however, worked just fine.

My "MonoApplications" line read as follows:
	MonoApplications    "/:/var/http"

After going through the mod_mono source I found that I could not tell
mod-mono-server.exe what I wanted the "--root" parameter to be.
NOTE: "mod-mono-server.exe --help" lists "MonoServerRootDir" as being a
paramter that can be set in httpd.conf however mod_mono does not support it.

I went ahead and modified the source to allow "MonoServerRootDir" to be set
in httpd.conf.  After that I was able to server ASP.NET pages for whole
virtual host (e.g. http://www.somedomain.com/index.aspx).

The diff of my changes and the original source is listed below.
Original mod_mono.c = <
Modified mod_mono.c = >

Christopher McGinnis
Neopets Inc.

> #define SERVER_ROOT     "/var/http";
>  char *server_root; 
> CONFIG_FUNCTION (server_root, server_root) 
>  server->server_root= SERVER_ROOT; 
<  char *argv [8]; 
>  char *argv [10]; 
<  argv [7] = NULL; 
>  argv [7] = "--root"; 
>  argv [8] = server_conf->server_root; 
>  argv [9] = NULL; 
<      "running '%s %s %s %s %s %s %s'", 
<      argv [0], argv [1], argv [2], argv [3], argv [4], argv [5], argv
>      "running '%s %s %s %s %s %s %s %s %s'", 
>      argv [0], argv [1], argv [2], argv [3], argv [4], argv [5], argv [6],
argv[7], argv[8]); 
>  {"MonoServerRootDir", 
>  CONFIG_FUNCTION_NAME (server_root), 
>  NULL, 
>  TAKE1, 
>  "See MONO_SHARED_DIR in the mono manual page. Default: \"/tmp\"" 
>  }, 
>  AP_INIT_TAKE1 ("MonoServerRootDir", 
>   CONFIG_FUNCTION_NAME (server_root), 
>   NULL, 
>   "See MONO_SHARED_DIR in the mono manual page. Default: \"/tmp\"" 

More information about the Mono-devel-list mailing list