anmar.eu.org
Home  mono stuff 
mod_mono-win32 mod_mono port for Apache 2 (and 2.2) under windows
Home >mono >mod_mono-win32
Resources:
» Latest mod_mono-win32 patch
  Patch for the r107874 revision of mod_mono source.
» Binary version for the above
 

Binaries of mod_mono with the above patch applied.

Built for the official 2.0.59 and 2.2.3 win32 binary version of the Apache HTTP Server. It contains release and debug builds.

» License
  This patch is under the same license as the official mod_mono package.
   

Related resources:
Mono - The Mono project is an open source effort sponsored by Novell to create a free implementation of the .NET Development Framework.
Apache HTTP Server - The Apache HTTP Server Project is an effort to develop and maintain an open-source HTTP server for modern operating systems including UNIX and Windows NT. The goal of this project is to provide a secure, efficient and extensible server that provides HTTP services in sync with the current HTTP standards.
Brian Kernighan's site - You can find there a compiled native Win32 awk binary needed to build mod_mono-win32. awk.exe

 
Introduction

This page contains my port of mod_mono to windows (Apache 2.0.x and 2.2.x). Then you can run an OSS ASP.NET server on your windows machine :)

The intent of the patch is being the less intrusive as possible with the current code base while being as straightforward as possible to build and run. It contains the suitable makefile (Makefile.win) to compile it using nmake.

Pre-requisites:

  • You must have installed the latest 2.0.x or 2.2.x win32 binary version of the Apache HTTP Server
  • You must have installed the latest 1.2.x version of mono using the combined installer for windows. Click here

Build prerequisites:

  • MS VS.NET 2003
  • GNU patch (or anything capable of applying unified difference files
  • The awk utility (see 'Related resources' for pointers). It must be named awk.exe and found in the system PATH

You can replace VS.NET with some free MS tool: Microsoft Visual C++ Toolkit 2003 (compiler and basic libraries), Microsoft Platform SDK (contains additional headers and libraries) and Microsoft .NET Framework SDK (contains nmake and other libraries). The binaries provided here since r56267 have been built that way.

Build instructions:

  • Download the latest patch
  • Check out the corresponding revision of mod_mono
  • Apply the patch to it
  • From a VS.NET command line environment execute "nmake /f Makefile.win APACHEDIR=..\Apache2 _mod_mono_r " where APACHEDIR matches the location where you have installed Apache (the full set of targets and options can be found in the header of the Makefile.win file)

Installation instructions:

  • Take mod_mono.so (from Release folder or from the downloaded zip file) and copy to Apache's modules folder

Configuration instructions:

The configuration is just the same as described in the documentation of mod_mono. If you want that mod-mono-server.exe is executed by mod_mono then you must consider the following limitations:

  • If MonoApplications is used, it does not allow to set ':' as part of the path. So if you need to set the drive letter, just use any other of the possible syntax available to setup applications.
  • To use ASP.NET 2.0 profile, you must set MonoServerPath to mod-mono-server2.cmd location (the windows installer puts it in mono's bin folder).

The rest of the options must be configured just as with the UNIX version. For more info about configuring mod_mono, read the documentation that comes with the official mod_mono source (mod_mono's INSTALL) or the official mod_mono wiki page. Sample configuration:

		...
		LoadModule mono_module modules/mod_mono.so
		...
		AddHandler mono .aspx .ascx .asax .ashx .config .cs .asmx
		<IfModule mod_dir.c>
			DirectoryIndex index.aspx default.aspx
		</IfModule>
		...
		<VirtualHost *:80>
			ServerName localhost
			DocumentRoot "C:\Mono\lib\xsp\test"
		...
			MonoDocumentRootDir "C:/Mono/lib/xsp/test"
			MonoApplications "/:./"
		...
		</VirtualHost>
					

Build platform (of the binary version):

Test platform:

Debugging:

  • Use the Binary version with debugging enabled (found in debug folder en the zip file) or compile _mod_mono_d target
  • Run apache as: "apache.exe -e debug" or "httpd.exe -e debug"
  • There should be lots of debug info in your "error.log" file

Any suggestions are welcome ;-)

Latest News

Sunday Aug 17th 2008

Adapted patch to revision r107874. It should now work with mono >=2.0.

-- Angel Marin

Saturday Apr 19th 2008

Adapted patch to revision r94183. It should now work with mono >=1.9.

WARNING: Due to bug #372220 you need to overwrite mod-mono-server binaries with a trunk build.

-- Angel Marin

Sunday Dec 16th 2007

Adapted patch to revision r89283. It should now work with mono >=1.2.6 releases.

-- Angel Marin

Sunday Sept 16th 2007

Adapted patch to revision r84611. It should now work with mono >=1.2.5 releases.

WARNING: It seems the manual changes needed due to bug #79920 on prior releases are no longer required.

-- Angel Marin

Friday June 8th 2007

Adapted patch to revision r75989. It should now work with mono >=1.2.4 releases.

WARNING: To make it work you must do some manual changes to your mono installation (bug #79920):

  1. Move 'lib\mono\1.0\mod-mono-server.exe' to 'lib\mono\1.0\winhack\'
  2. Move 'lib\mono\2.0\mod-mono-server2.exe' to 'lib\mono\2.0\winhack\'
  3. Edit 'bin\mod-mono-server.bat' and 'bin\mod-mono-server2.bat' to match the new locations

-- Angel Marin

Sunday December 17th 2006

Adapted patch to revision r68268. It should now work with mono 1.2.x releases.

WARNING: To make it work you must do some manual changes to your mono installation (bug #79920):

  1. Move 'lib\mono\1.0\mod-mono-server.exe' to 'lib\mono\1.0\winhack\'
  2. Move 'lib\mono\2.0\mod-mono-server2.exe' to 'lib\mono\2.0\winhack\'
  3. Edit 'bin\mod-mono-server.bat' and 'bin\mod-mono-server2.bat' to match the new locations

It's been delayed for a while as I lost the qemu image I used to do this builds in a hard disk failure and I haven't had the time to setup everything before. Enjoy it.

-- Angel Marin

Thursday September 7th 2006

Adapted patch to revision r64616.

WARNING: MonoExecutablePath and MonoServerPath settings have changed the way they were used (if you aren't using them in your config file, just ignore this notes):

  • MonoExecutablePath: it's value is no longer needed and now it's ignored.
  • MonoServerPath: it must now point to mod-mono-server.cmd or mod-mono-server2.cmd location. So if you need to use the ASP.NET 2.0 profile, you must now set MonoServerPath setting to mod-mono-server2.cmd location.

Enjoy it.

-- Angel Marin

Friday July 7th 2006

Adapted patch to revision r59457.

  • Added support for Apache 2.2.x.
  • The binaries are now provided as a single zip that contains release and debug build for Apache 2.0.x and 2.2.x.

Enjoy it.

-- Angel Marin

Sunday February 5th 2006

Adapted patch to revision r56267. The binaries provided are now built under Windows XP pro SP2 with the free MS tool chain (and tested under Windows 2003).

Enjoy it.

-- Angel Marin

Friday December 23rd 2005

Adapted patch to revision r54402. Adapted doc to reflect the new situation as of 1.1.12.1 win32 installer:

  • MonoDocumentRootDir now allows paths with spaces.

Enjoy it.

-- Angel Marin

Thursday December 8th 2005

Adapted patch to revision r53645. Adapted doc and samples to reflect the new patch features:

  • MonoExecutablePath and MonoServerPath are no longer needed in order to get it working if you have installed mono using the official win32 installer (they are read from registry).
  • If MonoListenPort is not set, it's now assigned sequentially starting at 2000.
  • MonoWapiDir now defaults to %temp% environment variable.
  • MonoListenAddress defaults to localhost (127.0.0.1)

Enjoy it.

-- Angel Marin

Sunday November 13th 2005

Adapted patch to revision r52941. Adapted doc and samples to reflect the new situation as of 1.1.10 win32 installer:

  • MonoExecutablePath now allows paths with spaces.
  • MonoExecutablePath and MonoServerPath must be prefixed with the 'default' keyword (the default instance alias)
  • Added a compiled version with debugging enabled.

Enjoy it.

-- Angel Marin

Friday October 07th 2005

Adapted patch to revision r50630. Adapted doc and samples to reflect the new situation as of 1.1.9 win32 installer:

  • The 1.1.9 win32 installer comes now with mod-mono-server binary included.
  • MonoExecutablePath must now be set to the exe file as the bat one is gone.
  • xsp files are installed to a different path: lib/xsp.

Enjoy it.

-- Angel Marin

Friday May 20th 2005

Published patch for revision r44835. It already lacks of easier configuration, but it works for me :)

Enjoy it.

-- Angel Marin

Disclaimer

These patch and binary are distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY.


Copyright © 2003 - 2008 Angel Marin All rights reserved.