Mono provides the necessary software to develop and run .NET client
and server applications on Linux, Solaris, Mac OS X, Windows, and Unix.
- Mono is the core module.
- XSP is a simple way to get started, a lightweight and simple webserver written in C#.
- Mod_Mono is an Apache 1.3/2.0/2.2 module that provides ASP.NET support for the web's favorite server.
There are three basic steps of mono installation:
- Install the mono software;
- Configure the mono service together with Apache;
- Restart Apache.
The details of installation are discussed below:
1. Install the mono
Log onto your server;
Use vi to create a file named mono.repo and save it in /etc/yum.repos.d will allow you to install mono and related packages.
name=Mono for rhel-4-i386 (stable)
Then, use yum to install mono and xsp package:
#sudo yum install mono
#sudo yum install xsp
#sudo yum install mod_mono
Currently, the packed mod_mono is not running smooth on x86-64. So we install it from source, instead of installation by yum.
Place the download file to /tmp and unpack it to /usr/local (or other directory you like):
#tar jxvf /tmp/mod_mono-1.9.tar.bz2
Compile the source code:
2. Configure the mono together with Apache
To run ASP.NET applications within the Apache, we need apache, the web server, installed. So, we can publish the mono service on web site though Apache.
After install the mono, you can find a default configure file name mod_mono.conf in mono's directory(In this instance, it is /etc/mono/conf.d/mod_mono.conf). mod_mono.conf loads the mod_mono module, associates ASP.NET file extensions with the ASP.NET MIME type and adds index.aspx, Default.aspx, and default.aspx as automatic directory index pages.
To load the mod_mono, add 1 line in the Apache configuration file like this:
Now, we need edit the mod_mono.conf file to meet our special needs. As example, we publish the mono's build in test files, add these lines at the end of mod_mono.conf:
#This is the mono's examples
Alias /mono_test "/usr/lib/xsp/test"
#This is the controller of mono
Deny from all
Allow from 192.168.1.0/24
Run the following command to check the configurations:
3. Restart Apache
Restart Apache to start mono web service by the following command:
#service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
Now, the mono project it is available on web with this address:
If you are new to mono, get start with the The sample of writing code using mono on Linux, and have a look at the examples.
Further information about mono can be found at mono's website: http://www.mono-project.com/Mod_mono