1
2mod_mono(8) ASP.NET Support for Apache mod_mono(8)
3
4
5
7 mod_mono - apache module that enables ASP.NET pages. Works together
8 with mod-mono-server.exe
9
11 mod_mono is a simple module that works with Apache 2.0 or newer.
12
13 It needs mod-mono-server.exe installed on the system. By default, it
14 will attemp to run mod-mono-server.exe if it doesn't find it's running.
15
17 All the directives but MonoSetServerAlias accept an optional first
18 argument that is the mod-mono-server instance alias for which the
19 directive applies. If only one argument is provided for them, thr
20 directive will apply to the 'default' mod-mono-server instance. Refer
21 to the monodoc documentation on configuring mod_mono for more examples.
22
23
24 MonoUnixUmask
25 It accepts an octal number as a parameter. The number must be a
26 valid unix file creation mask value (see umask(2)). The mask
27 will be applied whenever a directory or file is created from
28 within an ASP.NET application. Default value: "0077".
29
30 MonoUnixSocket
31 It accepts a file name as argument. That file will be a named
32 pipe used to send/receive data from/to mod_mono to/from mod-
33 mono-server. You cannot use MonoListenPort and MonoUnixSocket
34 at the same time. Default value: "/tmp/mod_mono_server".
35
36 MonoListenPort
37 TCP port on which mod-mono-server should listen/is listening on.
38 Mutually exclusive with MonoUnixSocket. When this options is
39 specified, mod-mono-server and mod_mono will use a TCP socket
40 for communication. Default value: none
41
42 MonoListenBacklog N
43 The backlog of connections to set on the listener socket in mod-
44 mono-server. By default the value is set to 500.
45
46 MonoMinThreads N
47 The minimum number of threads the threadpool allocates in mod-
48 mono-server. Increase this value to better handle the sudden
49 arrival of connections. The default value is determined by the
50 mono runtime.
51
52 MonoListenAddress
53 IP address where mod-mono-server should listen/is listening on.
54 Can only be used when MonoListenPort is specified. Default
55 value: "127.0.0.1"
56
57 MonoRunXSP
58 If the value is True, it tells mod_mono to spawn mod-mono-
59 server.exe if it's not already running. If set to False, most of
60 these directives are useless. Default value: True
61
62 MonoXSPStartAttempts
63 Number of times mod_mono will attempt to start a backend which
64 died. Value cannot be lower than 0. Default value: 3
65
66 MonoXSPStartWaitTime
67 Number of seconds to wait after starting the backend. This is to
68 let the backend initialize properly before attempting to connect
69 to it. Value cannot be lower than 2. Default value: 2
70
71 MonoAutoRestartMode
72 Set the auto-restart mode for the backend(s). Three modes are
73 available: None - do not auto-restart, Requests - restart after
74 a configured number of requests served, Time - restart after the
75 backend has been up for the specified period of time. Note that
76 if you enable auto-restart you should consider using off-process
77 state server, since on every restart your application state will
78 be lost. Default value: None
79
80 MonoAutoRestartRequests
81 Number of requests for a backend to serve before auto-restart‐
82 ing. The value here is taken into account only when MonoAu‐
83 toRestartMode is set to Requests. Default value: 10000
84
85 MonoAutoRestartTime
86 Time after which the backend should be auto-restarted. The time
87 format is: DD[:HH[:MM[:SS]]]. Default value: 00:12:00:00
88
89 MonoExecutablePath (Obsoleted, ignored)
90 Don't use this. It is ignored and has been left here for compat‐
91 ibility purposes. Default value: "/usr/bin/mono"
92
93 MonoPath
94 This value will be used to set the MONO_PATH environment vari‐
95 able. Default value: ""
96
97 MonoServerPath
98 The full path to the mod-mono-server script. Default value:
99 "/usr/bin/mod-mono-server"
100
101 MonoTargetFramework
102 If MonoRunXSP is True, this option selects the .NET framework
103 version to use. This affects the backend that is started to ser‐
104 vice the requests. The MonoServerPath option takes precedence
105 over this setting. Available values are "2.0", "3.5" and "4.0".
106 Default value: "2.0"
107
108 MonoWapiDir
109 The directory where mono runtime will create the ".wapi" direc‐
110 tory used to emulate windows I/O. It's used to set
111 MONO_SHARED_DIR. Default value: "/tmp"
112
113 MonoDocumentRootDir
114 The directory passed in --root argument when launching mod-mono-
115 server.
116
117 MonoMaxCPUTime
118 If MonoRunXSP is True, CPU time limit in seconds allowed for the
119 spawned mono process. Beyond that, it will be restarted. If this
120 capability is not available on your system, the directive will
121 be ignored. Default value: system default
122
123 MonoMaxMemory
124 If MonoRunXSP is True, the maximum size of the process's data
125 segment (data size) in bytes allowed for the spawned mono
126 process. It will be restarted when the limit is reached. If
127 this capability is not available on your system, the directive
128 will be ignored. Default value: system default
129
130 MonoApplications
131
132 AddMonoApplications
133 This value will be passed to mod-mono-server.exe in the --appli‐
134 cations option. See xsp(1) manual page for details.
135
136 MonoApplicationsConfigFile
137 The argument passed in --appconfigfile argument to mod-mono-
138 server. Default value: NULL.
139
140 MonoApplicationsConfigDir
141 The argument passed in --appconfigdir argument to mod-mono-
142 server. Default value: config/mod-mono-applications
143
144 Note that you must specify at least one of MonoApplications, MonoAppli‐
145 cationsConfigFile and MonoApplicationsConfigDir.
146
147 MonoAutoApplication
148 Enables or disables automatic ASP.NET applications discovery. By
149 default it is enabled if you have no application configured.
150 Otherwise, it's disabled. The possible values are 'enabled' or
151 'disabled'.
152
153 MonoDebug
154 Runs mono in debug mode, which produces stack traces with line
155 numbers. Default value: False.
156
157 MonoSetServerAlias
158 Takes a server alias name. This is to be used inside <Directory>
159 or <Location>. Default value: 'default' if the directive is not
160 used.
161
162 MonoSetEnv
163 Takes a string of 'name=value' pairs separated by semicolons.
164 For each pair, it calls setenv (name, value) before running mod-
165 mono-server.
166
167 MonoIOMAP
168 Takes alias name and a string of the same format and meaning as
169 the MONO_IOMAP environment variable (see the mono(1) manpage).
170 The effect is that mod_mono performs the same actions as mono
171 runtime with MONO_IOMAP in effect, as well as that the
172 MONO_IOMAP variable with the specified value is exported in the
173 backend environment. This option is necessary when you're using
174 MONO_IOMAP in your application and there might be static files
175 with mixed case names - in such case mod_mono attempts to open
176 the file directly and sends it using apache facilities. Default
177 value: none
178
179 MonoMaxActiveRequests
180 The maximum number of concurrent requests mod_mono will pass off
181 to the ASP.NET backend. Set to zero to turn off the limit.
182 Default value: 0.
183
184 MonoMaxWaitingRequests
185 The maximum number of concurrent requests mod_mono will hold
186 while the ASP.NET backend is busy with the maximum number of
187 requests specified by MonoMaxActiveRequests. Requests that can't
188 be processed or held are dropped with Service Unavailable.
189 Default value: 150.
190
191 MonoCheckHiddenFiles
192 Do not protect hidden files/directories from being accessed by
193 clients. Hidden files/directories are those with Hidden
194 attribute on Windows and whose name starts with a dot on Unix.
195 Any file/directory below a hidden directory is inacessible. This
196 option turns the default behavior of protecting such locations
197 off. If your application does not contain any hidden
198 files/directories, you might want to use this option as the
199 checking process has a per-request cost. Accepts a boolean value
200 - 'true' or 'false' Default value: true. AppSettings key name:
201 MonoServerCheckHiddenFiles.
202
204 Note that the configuration below requires the mod_mono module to be
205 loaded by Apache. How it is done is distribution-specific - please
206 check your distribution documentation for details.
207
208 This one using <Directory>:
209 Alias /mono "/usr/lib/xsp/test"
210 AddMonoApplications default "/mono:/usr/lib/xsp/test"
211 <Directory /usr/lib/xsp/test>
212 SetHandler mono
213 <IfModule mod_dir.c>
214 DirectoryIndex index.aspx
215 </IfModule>
216 </Directory>
217
218 This one using <Location>:
219 Alias /demo "/usr/lib/xsp/test"
220 AddMonoApplications default "/demo:/usr/lib/xsp/test"
221 <Location /demo>
222 SetHandler mono
223 </Location>
224
225
226 If you prefer to .webapp configuration file(s) (see manual page of
227 xsp), you can change MonoApplications in the above samples by:
228
229 MonoApplicationsConfigFile default "/var/www/applications.webapp"
230
231 replacing the path to the file with yours.
232
233 If you want to use several .webapp files, use this instead:
234
235 MonoApplicationsConfigDir default "/var/www/webapp"
236
237 and all the .webapp files found in the directory /var/www/webapp will
238 be loaded.
239
240 Refer to monodoc documentation on configuring mod_mono for more exam‐
241 ples.
242
244 mod_mono provides a simple web-based control panel for restarting the
245 mod-mono-server, which is useful when assemblies need to be reloaded
246 from disk after they have been changed. To activate the control panel,
247 place the following in your httpd.conf:
248
249 <Location /mono>
250 SetHandler mono-ctrl
251 Order deny,allow
252 Deny from all
253 Allow from 127.0.0.1
254 </Location>
255
256 The control panel is then accessible at http://yourdomain.com/mono.
257 Clicking the link to restart mod-mono-server will immediately restart
258 it.
259
260 The Order/Deny/Allow access controls above restrict access to the con‐
261 trol panel to the computer with IP address 127.0.0.1. Replace this (or
262 add more Allow lines) with the IP address of your own computer so that
263 you can access the control panel. You can also use Apache's htaccess
264 features to password protect it, too.
265
267 It may modify MONO_PATH, PATH and MONO_SHARED_DIR when starting mod-
268 mono-server.
269
270 The MOD_MONO_CCV variable may be used to select which component will do
271 client certificate validity (CCV) checks. By default both Apache and
272 Mono will verify the client certificates. This can be changed to either
273 "apache" or "mono" to limit the validity check to either environment.
274 This variable can be set using MonoSetEnv to allow different vhost to
275 use separate validation techniques.
276
277 The MOD_MONO_LOCKING_MECHANISM variable may be used to choose the APR
278 locking mechanism for the dashboard. The currently defined mechanism
279 names are: DEFAULT, FCNT, FLOCK, SYSVSEM, PROC_PTHREAD, POSIXSEM. Note
280 that not every mechanism may be available for your platform. In such
281 case, mod_mono will fallback to using the DEFAULT value which lets the
282 APR decide which locking mechanism to use. DEFAULT is also the default
283 value for the option if the environment variable is not set or its
284 value is unknown. This value MUST NOT be set using MonoSetEnv - it MUST
285 be present in the Apache environment before the module is initialized
286 and its configuration parsed.
287
289 httpd.conf
290
292 mod_mono was started by Daniel Ridruejo (daniel rawbyte com). Cur‐
293 rently, Marek Habersack (mhabersack@novell.com) is the maintainer.
294
296 See http://mail.ximian.com/mailman/mono-list for details.
297
299 Visit http://mono-project.com/Mod_mono for details.
300
302 xsp(1),mod-mono-server(1),mono(1),mcs(1)
303
304
305
306
307mod_mono 3.13 28 Jan 2009 mod_mono(8)