mod_mono(8)
π NAME π
okay bestie, this is mod_mono(8) β the Apache module that enables ASP.NET pages. It works together with mod-mono-server.exe π«Ά
β¨ DESCRIPTION β¨
mod_mono is a simple module that works with Apache 2.0 or newer. periodt.
It needs mod-mono-server.exe installed on the system. By default, it will attempt to run mod-mono-server.exe if it doesn't find it running.
π CONFIGURATION DIRECTIVES π
okay so here's the group-chat lore: all the directives except MonoSetServerAlias accept an optional first argument β that argument is the mod-mono-server instance alias the directive applies to. If you give only one argument to one of those directives, it applies to the 'default' mod-mono-server instance. For more examples, refer to the monodoc documentation on configuring mod_mono π
MonoUnixUmaskβ takes an octal number as its parameter. That number must be a valid Unix file creation mask value (seeumask(2)). The mask gets applied whenever a directory or file is created from within an ASP.NET application. Default value:"0077". πMonoUnixSocketβ takes a file name as its argument. That file is a named pipe used to send/receive data from/tomod_monoto/frommod-mono-server. You cannot useMonoListenPortandMonoUnixSocketat the same time. Default value:"/tmp/mod_mono_server".MonoListenPortβ TCP port on whichmod-mono-servershould listen/is listening on. Mutually exclusive withMonoUnixSocket. When this option is specified,mod-mono-serverandmod_monouse a TCP socket for communication. Default value: none.MonoListenBacklog Nβ the backlog of connections to set on the listener socket inmod-mono-server. By default the value is set to500.MonoMinThreads Nβ the minimum number of threads the threadpool allocates inmod-mono-server. Increase this value to better handle the sudden arrival of connections. The default value is determined by the mono runtime. π§MonoListenAddressβ IP address wheremod-mono-servershould listen/is listening on. Can only be used whenMonoListenPortis specified. Default value:"127.0.0.1".MonoRunXSPβ if the value isTrue, it tellsmod_monoto spawnmod-mono-server.exeif it's not already running. If set toFalse, most of these directives are useless. Default value:True.MonoXSPStartAttemptsβ number of timesmod_monowill attempt to start a backend which died. Value cannot be lower than0. Default value:3.MonoXSPStartWaitTimeβ number of seconds to wait after starting the backend. This is to let the backend initialize properly before attempting to connect to it. Value cannot be lower than2. Default value:2.MonoAutoRestartModeβ set the auto-restart mode for the backend(s). Three modes are available:Noneβ do not auto-restart,Requestsβ restart after a configured number of requests served,Timeβ restart after the backend has been up for the specified period of time. Note that if you enable auto-restart you should consider using off-process state server, since on every restart your application state will be lost. Default value:None.MonoAutoRestartRequestsβ number of requests for a backend to serve before auto-restarting. The value here is taken into account only whenMonoAutoRestartModeis set toRequests. Default value:10000.MonoAutoRestartTimeβ time after which the backend should be auto-restarted. The time format is:DD[:HH[:MM[:SS]]]. Default value:00:12:00:00.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 theMONO_PATHenvironment variable. Default value:"".MonoServerPathβ the full path to themod-mono-serverscript. Default value:"/usr/bin/mod-mono-server".MonoTargetFrameworkβ ifMonoRunXSPisTrue, this option selects the .NET framework version to use. This affects the backend that is started to service the requests. TheMonoServerPathoption takes precedence over this setting. Available values are"2.0","3.5"and"4.0". Default value:"2.0". πMonoWapiDirβ the directory where the mono runtime will create the".wapi"directory used to emulate windows I/O. It's used to setMONO_SHARED_DIR. Default value:"/tmp".MonoDocumentRootDirβ the directory passed in the--rootargument when launchingmod-mono-server.MonoMaxCPUTimeβ ifMonoRunXSPisTrue, 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β ifMonoRunXSPisTrue, 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β this value will be passed tomod-mono-server.exein the--applicationsoption. Seexsp(1)manual page for details.AddMonoApplicationsβ this value will be passed tomod-mono-server.exein the--applicationsoption. Seexsp(1)manual page for details.MonoApplicationsConfigFileβ the argument passed in the--appconfigfileargument tomod-mono-server. Default value:NULL.MonoApplicationsConfigDirβ the argument passed in the--appconfigdirargument tomod-mono-server. Default value:config/mod-mono-applications.
π note that you must specify at least one ofMonoApplications,MonoApplicationsConfigFileandMonoApplicationsConfigDir. no cap, that's mandatory.
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 callssetenv (name, value)before runningmod-mono-server.MonoIOMAPβ takes an alias name and a string of the same format and meaning as theMONO_IOMAPenvironment variable (see themono(1)manpage). The effect is thatmod_monoperforms the same actions as the mono runtime withMONO_IOMAPin effect, as well as that theMONO_IOMAPvariable with the specified value is exported in the backend environment. This option is necessary when you're usingMONO_IOMAPin your application and there might be static files with mixed case names β in such casemod_monoattempts to open the file directly and sends it using apache facilities. Default value: none.MonoMaxActiveRequestsβ the maximum number of concurrent requestsmod_monowill pass off to the ASP.NET backend. Set to zero to turn off the limit. Default value:0.MonoMaxWaitingRequestsβ the maximum number of concurrent requestsmod_monowill hold while the ASP.NET backend is busy with the maximum number of requests specified byMonoMaxActiveRequests. Requests that can't be processed or held are dropped withService Unavailable. Default value:150.MonoCheckHiddenFilesβ do not protect hidden files/directories from being accessed by clients. Hidden files/directories are those with the Hidden attribute on Windows and whose name starts with a dot on Unix. Any file/directory below a hidden directory is inaccessible. This option turns the default behavior of protecting such locations off. If your application does not contain any hidden files/directories, you might want to use this option as the checking process has a per-request cost. Accepts a boolean value β'true'or'false'. Default value:true. AppSettings key name:MonoServerCheckHiddenFiles. π
πΈ SAMPLE VIRTUAL HOST CONFIGURATION πΈ
bestie, note that the configuration below requires the mod_mono module to be loaded by Apache. How that's done is distribution-specific β please check your distribution documentation for details. π¦
This one is using <Directory>:
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 is using <Location>:
Alias /demo "/usr/lib/xsp/test"
AddMonoApplications default "/demo:/usr/lib/xsp/test"
<Location /demo>
SetHandler mono
</Location>
If you prefer to use .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 ποΈ
Okay bestie, so mod_mono comes with a simple web-based control panel for restarting the mod-mono-server β highkey useful when assemblies need to be reloaded from disk after they've been changed. To activate this main character energy, place this in your httpd.conf:
<Location /mono>
SetHandler mono-ctrl
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Location>
Then the control panel is accessible at http://yourdomain.com/mono β iconic. Clicking the link to restart mod-mono-server will immediately restart it, no cap.
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 π±
Heads up, bestie: it may modify MONO_PATH, PATH and MONO_SHARED_DIR when starting mod-mono-server.
MOD_MONO_CCVβ this 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 usingMonoSetEnvto allow different vhost to use separate validation techniques. πMOD_MONO_LOCKING_MECHANISMβ this variable may be used to choose the APR locking mechanism for the dashboard. The currently defined mechanism names are:DEFAULT,FCNT,FLOCK,SYSVSEM,PROC_PTHREAD,POSIXSEM. Note that not every mechanism may be available for your platform. In such case,mod_monowill fallback to using theDEFAULTvalue which lets the APR decide which locking mechanism to use.DEFAULTis also the default value for the option if the environment variable is not set or its value is unknown. π¦
π¨ This value MUST NOT be set using MonoSetEnv β it MUST be present in the Apache environment before the module is initialized and its configuration parsed.
π FILES π
httpd.conf
π AUTHORS π
mod_mono was started by Daniel Ridruejo (daniel rawbyte com). Currently, Marek Habersack (mhabersack@novell.com) is the maintainer. Periodt. π
π MAILING LISTS π
See http://mail.ximian.com/mailman/mono-list for details.
π WEB SITE π
Visit http://mono-project.com/Mod_mono for details.
π SEE ALSO π
xsp(1),mod-mono-server(1),mono(1),mcs(1) β iykyk, go read these too. π
π That's the whole vibe check, bestie β this page is mod_mono(8), version 3.8, dated 28 Jan 2009. Go slay your config! β¨πΈ
π¦ where this page comes from
- debian bookworm: libapache2-mod-mono 3.8-3+b2
- ubuntu jammy: libapache2-mod-mono 3.8-3
- ubuntu noble: libapache2-mod-mono 3.8-3build1
- (C) 2004-2009 Novell, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms