mod_mono

Section: ASP.NET Support for Apache (8)
Updated: 9 Feb 2005
Index Return to Main Contents
 

NAME

mod_mono - apache module that enables ASP.NET pages. Works together with mod-mono-server.exe  

DESCRIPTION

mod_mono is a simple module that works with both 1.3 and 2.0 versions of apache.

It needs mod-mono-server.exe installed on the system. By default, it will attemp to run mod-mono-server.exe if it doesn't find it's running.  

CONFIGURATION DIRECTIVES

All the directives but MonoSetServerAlias accept an optional first argument that is the mod-mono-server instance alias for which the directive applies. If only one argument is provided for them, thr directive will apply to the 'default' mod-mono-server instance. Refer to the monodoc documentation on configuring mod_mono for more examples.

MonoUnixUmask
It accepts an octal number as a parameter. The number must be a valid unix file creation mask value (see umask(2)). The mask will be applied whenever a directory or file is created from within an ASP.NET application. Default value: "0077".
MonoUnixSocket
It accepts a file name as argument. That file will be a named pipe used to send/receive data from/to mod_mono to/from mod-mono-server. You cannot use MonoListenPort and MonoUnixSocket at the same time. Default value: "/tmp/mod_mono_server".
MonoListenPort
TCP port on which mod-mono-server should listen/is listening on. Mutually exclusive with MonoUnixSocket. When this options is specified, mod-mono-server and mod_mono will use a TCP socket for communication. Default value: none
MonoListenAddress
IP address where mod-mono-server should listen/is listening on. Can only be used when MonoListenPort is specified. Default value: "127.0.0.1"
MonoRunXSP
If the value is True, it tells mod_mono to spawn mod-mono-server.exe if it's not already running. If set to False, most of these directives are useless. Default value: True
MonoExecutablePath (Obsoleted, ignored)
Don't use this. It is ignored and has been left here for compatibility purposes. Default value: "/usr/bin/mono"
MonoPath
This value will be used to set the MONO_PATH environment variable. Default value: ""
MonoServerPath
The full path to the mod-mono-server script. Default value: "/usr/bin/mod-mono-server"
MonoWapiDir
The directory where mono runtime will create the ".wapi" directory used to emulate windows I/O. It's used to set MONO_SHARED_DIR. Default value: "/tmp"
MonoDocumentRootDir
The directory passed in --root argument when launching mod-mono-server.
MonoMaxCPUTime
If MonoRunXSP is True, CPU time limit in seconds allowed for the spawned mono process. Beyond that, it will be restarted. If this capability is not available on your system, the directive will be ignored. Default value: system default
MonoMaxMemory
If MonoRunXSP is True, the maximum size of the process's data segment (data size) in bytes allowed for the spawned mono process. It will be restarted when the limit is reached. If this capability is not available on your system, the directive will be ignored. Default value: system default
MonoApplications
AddMonoApplications
This value will be passed to mod-mono-server.exe in the --applications option. See xsp(1) manual page for details.
MonoApplicationsConfigFile
The argument passed in --appconfigfile argument to mod-mono-server. Default value: NULL.
MonoApplicationsConfigDir
The argument passed in --appconfigdir argument to mod-mono-server. Default value: config/mod-mono-applications

Note that you must specify at least one of MonoApplications, MonoApplicationsConfigFile and MonoApplicationsConfigDir.

MonoAutoApplication
Enables or disables automatic ASP.NET applications discovery. By default it is enabled if you have no application configured. Otherwise, it's disabled. The possible values are 'enabled' or 'disabled'.
MonoDebug
Runs mono in debug mode, which produces stack traces with line numbers. Default value: false.
MonoSetServerAlias
Takes a server alias name. This is to be used inside <Directory> or <Location>. Default value: 'default' if the directive is not used.
MonoSetEnv
Takes a string of 'name=value' pairs separated by semicolons. For each pair, it calls setenv (name, value) before running mod-mono-server.
 

SAMPLE CONFIGURATION

This one using <Directory>:
      LoadModule mono_module /usr/lib/apache/1.3/libmod_mono.so
      AddModule mod_mono.c
      Alias /mono "/usr/lib/xsp/test"
      AddMonoApplications default "/mono:/usr/lib/xsp/test"
      <Directory /usr/lib/xsp/test>
              SetHandler mono
              <IfModule mod_dir.c>
                    DirectoryIndex index.aspx
              </IfModule>
      </Directory>

This one using <Location>:

      LoadModule mono_module modules/libmod_mono.so
      Alias /demo "/usr/lib/xsp/test"
      AddMonoApplications default "/demo:/usr/lib/xsp/test"
      <Location /demo>
              SetHandler mono
      </Location>

If you prefer to .webapp configuration file(s) (see manual page of xsp), you can change MonoApplications in the above samples by:


      MonoApplicationsConfigFile default "/var/www/applications.webapp"
      
replacing the path to the file with yours.

If you want to use several .webapp files, use this instead:


      MonoApplicationsConfigDir default "/var/www/webapp"

and all the .webapp files found in the directory /var/www/webapp will be loaded.

Refer to monodoc documentation on configuring mod_mono for more examples.  

THE MOD_MONO CONTROL PANEL

mod_mono provides a simple web-based control panel for restarting the mod-mono-server, which is useful when assemblies need to be reloaded from disk after they have been changed. To activate the control panel, place the following in your httpd.conf:

            <Location /mono>
              SetHandler mono-ctrl
              Order deny,allow
              Deny from all
              Allow from 127.0.0.1
            </Location>

The control panel is then accessible at http://yourdomain.com/mono. Clicking the link to restart mod-mono-server will immediately restart it.

The Order/Deny/Allow access controls above restrict access to the control panel to the computer with IP address 127.0.0.1. Replace this (or add more Allow lines) with the IP address of your own computer so that you can access the control panel. You can also use Apache's htaccess features to password protect it, too.  

ENVIRONMENT VARIABLES

It may modify MONO_PATH, PATH and MONO_SHARED_DIR when starting mod-mono-server.

The MOD_MONO_CCV variable may be used to select which component will do client certificate validity (CCV) checks. By default both Apache and Mono will verify the client certificates. This can be changed to either "apache" or "mono" to limit the validity check to either environment. This variable can be set using MonoSetEnv to allow different vhost to use separate validation techniques.  

FILES

httpd.conf  

AUTHORS

mod_mono was started by Daniel Ridruejo (daniel rawbyte com). Currently, Gonzalo Paniagua Javier (gonzalo ximian.com) is the maintainer.  

MAILING LISTS

See http://mail.ximian.com/mailman/mono-list for details.  

WEB SITE

Visit http://www.go-mono.com for details.  

SEE ALSO

xsp(1),mod-mono-server(1),mono(1),mcs(1)


 

Index

NAME
DESCRIPTION
CONFIGURATION DIRECTIVES
SAMPLE CONFIGURATION
THE MOD_MONO CONTROL PANEL
ENVIRONMENT VARIABLES
FILES
AUTHORS
MAILING LISTS
WEB SITE
SEE ALSO

linux.jgfs.net manual pages