This repository has been archived by the owner on Nov 19, 2022. It is now read-only.
/
INSTALL
330 lines (226 loc) · 9.94 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
Last updated: Jul 25, 2005
Index
-------
* Installing mod_mono
o Prerrequisites
o Assumptions
o Step by step (everything in /usr!)
-Tip: If mono was not installed in /usr
* APPENDIX A: Typical configuration without virtual hosts
* APPENDIX B: Configuration directives for mod_mono
* APPENDIX C: Webapp file format
* APPENDIX D: More information
* CREDITS
Installing mod_mono
--------------------
The following are instructions on getting mod_mono working with
Apache, either 1.3 or 2. Once you set it up, Apache will be able to
serve ASP.NET pages.
* Prerrequisites
-----------------
You will need:
* mono (http://www.go-mono.com)
* apache 1.3 or 2 and its development package. Usually called
apache2-dev, apache-dev...
* Latest xsp and mod_mono tarballs (http://go-mono.com/download.html)
* Assumptions
-------------
The next steps assume you have installed mono, xsp and apache in
/usr. Notice that you will need to be root in order to run 'make
install'.
* Step by step (everything in /usr!)
-------------------------------------
1. Install mod_mono.
tar xvfz mod_mono-X.Y.Z.tar.gz
cd mod_mono-X.Y.Z
(*) ./configure --prefix=/usr
make
make install
(*) If it complains about not finding apxs because you installed
apache in a non-common directory or the configuration summary
reports an apache version different from what you expected, use
the --with-apxs argument. Example:
./configure --prefix=/usr --with-apxs=/usr/sbin/apxs
(Apache 2 only) If you get errors while compiling due to apr.h
header not found, you'll need to use the --with-apr-config option
and provide the full path to 'apr-config':
./configure --prefix=/usr --with-apr-config=/usr/bin/apr-config
After running 'make install', the module is installed in the
proper location and the apache configuration file has been
updated to load the module. apxs automatically adds this line (or
similar) to httpd.conf if not already present:
LoadModule mono_module modules/mod_mono.so
2. Configure apache.
We're going to configure apache so that we can browse the samples
installed by XSP under /usr/lib/xsp/test.
Edit your httpd.conf file, which should be in /etc/httpd,
/etc/apache, /etc/apache2...
Add the following lines:
Alias /demo "/usr/lib/xsp/test"
MonoApplications "/demo:/usr/lib/xsp/test"
so that apache redirects requests from /demo to /demo/ and looks
for everything requested as /demo/xxx under
/usr/lib/xsp/test/xxx.Don't forget the quotes.
For Apache 1.3 and, optionally, for Apache 2.0, add these lines:
<Directory /usr/lib/xsp/test>
SetHandler mono
<IfModule mod_dir.c>
DirectoryIndex index.aspx
</IfModule>
</Directory>
If you are using Apache 2.0, you can use get the same results with
this:
<Location /demo>
SetHandler mono
</Location>
Take a look at Appendix A below for typical configuration
samples and Appendix B for detailed descriptions on available
configuration directives.
3. Restart apache.
4. Point your browser to http://127.0.0.1/demo/index.aspx
Nice, huh?
-TIP: If mono was not installed in /usr
In this case, when running ./configure for mod_mono, you can do:
./configure --prefix=/usr --with-mono-prefix=/usr/local
so that the default paths for locating mono and mod-mono-server
are set to /usr/local/bin/mono and so on.
APPENDIX A: Typical configuration without virtual hosts
--------------------------------------------------------
This samples assume that you have mono and mod-mono-server installed
in /usr prefix. If you installed them in other place, take a look at
Appendix C.
Your configuration should be something like:
LoadModule mono_module /usr/lib/apache/1.3/mod_mono.so
AddModule mod_mono.c
Alias /demo "/usr/lib/xsp/test"
AddMonoApplications default "/demo:/usr/lib/xsp/test"
<Directory /usr/lib/xsp/test>
SetHandler mono
# The following lines required for apache 1.3
<IfModule mod_dir.c>
DirectoryIndex index.aspx
</IfModule>
</Directory>
or like this:
LoadModule mono_module modules/mod_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.
If you don't want mod-mono-server to handle all the files, but only
ASP.NET ones, you can replace the 'SetHandler mono' by:
AddHandler mono .aspx .ascx .asax .ashx .config .cs .asmx
but this will make PathInfo unusable.
APPENDIX B: Configuration directives for mod_mono
---------------------------------------------------
For the default values that have a path beginning with /usr, replace
that /usr with your installation prefix if you installed elsewhere.
These are the directives supported under both apache 1.3 and 2.0. All
of them 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, it will apply to the
'default' mod-mono-server instance. Refer to the monodoc documentation
on configuring mod_mono for more examples.
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.
Default value: "/tmp/mod_mono_server".
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', the rest of
directives are useless.
Default value: True
MonoExecutablePath
The full path to mono executable.
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 mod-mono-server.exe.
Default value: "/usr/bin/mod-mono-server.exe"
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
Value passed in --root argument when running mod-mono-server. This
tells mod-mono-server to change the directory to the value specified
before doing anything else.
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
This value will be passed to mod-mono-server.exe in the
--applications option. See xsp(1) manual page for details.
AddMonoApplications
Same as MonoApplications, but the alias argument is mandatory.
MonoApplicationsConfigFile
Adds application definitions from the XML configuration file.
See Appendix C for details on the file format.
Default value: ""
MonoApplicationsConfigDir
Adds application definitions from all XML files found in the
specified directory DIR. Files must have '.webapp' extension.
Default value: config/mod-mono-applications
Note that you must specify at least one of MonoApplications,
MonoApplicationsConfigFile and MonoApplicationsConfigDir.
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.
APPENDIX C: Webapp file format
---------------------------------
The format of the .webapp files is:
<apps>
<web-application>
<name>{appname}</name>
<vhost>{virtual host for application}</vhost>
<vport>{port for the application}</vport>
<vpath>{virtual directory in apache}</vpath>
<path>{physical path to aspx files}</path>
<!-- Default value for <enabled> is true -->
<enabled>{true|false}</enabled>
</web-application>
</apps>
You can include any number of <web-application> nodes, one per
ASP.NET application to run.
There's a sample.webapp file in the XSP samples directory.
APPENDIX D: More information
-----------------------------
You can find more information in the manual pages of mono, xsp,
mod-mono-server and mod_mono.
There are more commented examples in monodoc.
CREDITS
--------
Daniel Lopez Ridruejo <daniel @ rawbyte.com>
http://www.apacheworld.org
Daniel started the development of mod_mono using the embedding mono approach.
Gonzalo Paniagua Javier <gonzalo @ ximian.com>
Maintainer