1 Last updated: Jan 28, 2009
9 o Step by step (everything in /usr!)
10 -Tip: If mono was not installed in /usr
12 * APPENDIX A: Typical configuration without virtual hosts
13 * APPENDIX B: Webapp file format
14 * APPENDIX C: More information
21 The following are instructions on getting mod_mono working with
22 Apache 2. Once you set it up, Apache will be able to serve ASP.NET
29 * mono (http://www.go-mono.com)
30 * apache 2.0 or later and its development packages. Usually called
31 apache2-dev, apache2-devel...
32 * Latest xsp and mod_mono tarballs (http://go-mono.com/download.html)
36 The next steps assume you have installed mono, XSP and Apache in
37 /usr. Notice that you will need to be root in order to run 'make
40 * Step by step (everything in /usr!)
41 -------------------------------------
44 tar xvfz mod_mono-X.Y.Z.tar.gz
46 (*) ./configure --prefix=/usr
50 (*) If it complains about not finding apxs because you installed
51 apache in a non-common directory or the configuration summary
52 reports an apache version different from what you expected, use
53 the --with-apxs argument. Example:
55 ./configure --prefix=/usr --with-apxs=/usr/sbin/apxs
57 If you get errors while compiling due to apr.h header not found,
58 you'll need to use the --with-apr-config option and provide the
59 full path to 'apr-config':
61 ./configure --prefix=/usr --with-apr-config=/usr/bin/apr-config
63 After running 'make install', the module is installed in the
64 proper location and the apache configuration file has been
65 updated to load the module. apxs automatically adds this line (or
66 similar) to httpd.conf if not already present:
68 LoadModule mono_module modules/mod_mono.so
72 We're going to configure Apache so that we can browse the samples
73 installed by XSP under /usr/lib/xsp/test.
75 Edit your httpd.conf file, which should be in /etc/httpd, /etc/apache2...
77 Add the following lines:
79 Alias /demo "/usr/lib/xsp/test"
80 MonoApplications "/demo:/usr/lib/xsp/test"
82 so that apache redirects requests from /demo to /demo/ and looks
83 for everything requested as /demo/xxx under
84 /usr/lib/xsp/test/xxx.Don't forget the quotes.
88 <Directory /usr/lib/xsp/test>
91 DirectoryIndex index.aspx
95 Alternatively, you can use get the same results with this:
101 Take a look at Appendix A below for typical configuration
102 samples and Appendix B for detailed descriptions on available
103 configuration directives.
106 4. Point your browser to http://127.0.0.1/demo/index.aspx
110 -TIP: If mono was not installed in /usr
112 In this case, when running ./configure for mod_mono, you can do:
114 ./configure --prefix=/usr --with-mono-prefix=/usr/local
116 so that the default paths for locating mono and mod-mono-server
117 are set to /usr/local/bin/mono and so on.
119 The mod_mono Control Panel
120 --------------------------
122 mod_mono provides a simple web-based control panel for restarting the
123 mod-mono-server, which is useful when assemblies need to be reloaded
124 from disk after they have been changed. To activate the control panel,
125 place the following in your httpd.conf:
134 The control panel is then accessible at http://yourdomain.com/mono.
135 Clicking the link to restart mod-mono-server will immediately restart
138 The Order/Deny/Allow access controls above restrict access to the
139 control panel to the computer with IP address 127.0.0.1. Replace this
140 (or add more Allow lines) with the IP address of your own computer so
141 that you can access the control panel. You can also use Apache's
142 htaccess features to password protect it, too.
146 APPENDIX A: Typical configuration without virtual hosts
147 --------------------------------------------------------
149 This samples assume that you have mono and mod-mono-server installed
150 in /usr prefix. If you installed them in other place, take a look at
153 Your configuration should be something like:
155 Alias /demo "/usr/lib/xsp/test"
156 AddMonoApplications default "/demo:/usr/lib/xsp/test"
157 <Directory /usr/lib/xsp/test>
159 # The following lines required for apache 1.3
161 DirectoryIndex index.aspx
167 LoadModule mono_module modules/mod_mono.so
168 Alias /demo "/usr/lib/xsp/test"
169 AddMonoApplications default "/demo:/usr/lib/xsp/test"
174 If you prefer to .webapp configuration file(s) (see manual page
175 of XSP), you can change MonoApplications in the above samples by:
177 MonoApplicationsConfigFile default "/var/www/applications.webapp"
179 replacing the path to the file with yours.
181 If you want to use several .webapp files, use this instead:
183 MonoApplicationsConfigDir default "/var/www/webapp"
185 and all the .webapp files found in the directory /var/www/webapp
188 If you don't want mod-mono-server to handle all the files, but only
189 ASP.NET ones, you can replace the 'SetHandler mono' by:
191 AddHandler mono .aspx .ascx .asax .ashx .config .cs .asmx
193 but this will make PathInfo unusable.
196 APPENDIX B: Webapp file format
197 ---------------------------------
199 The format of the .webapp files is:
203 <name>{appname}</name>
204 <vhost>{virtual host for application}</vhost>
205 <vport>{port for the application}</vport>
206 <vpath>{virtual directory in apache}</vpath>
207 <path>{physical path to aspx files}</path>
208 <!-- Default value for <enabled> is true -->
209 <enabled>{true|false}</enabled>
213 You can include any number of <web-application> nodes, one per
214 ASP.NET application to run.
216 There's a sample.webapp file in the XSP samples directory.
219 APPENDIX D: More information
220 -----------------------------
222 You can find more information in the manual pages of mono, xsp,
223 mod-mono-server and mod_mono.
225 There are more commented examples in monodoc.
231 Daniel Lopez Ridruejo <daniel @ rawbyte.com>
232 http://www.apacheworld.org
233 Daniel started the development of mod_mono using the embedding mono approach.
235 Gonzalo Paniagua Javier <gonzalo @ ximian.com>
238 Marek Habersack <mhabersack @ novell.com>