| Server IP : 182.53.201.61 / Your IP : 216.73.217.175 Web Server : Apache/2.2.15 (Fedora) System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686 User : apache ( 48) PHP Version : 5.3.3 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/doc/mod_mono-2.4.2/ |
Upload File : |
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: Webapp file format
* APPENDIX C: 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.
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.
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: 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