Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Mod-mono  (Read 2795 times)

0 Members and 1 Guest are viewing this topic.

Karun

  • Guest
Mod-mono
« on: November 18, 2013, 11:24:06 pm »
                           Mod-Mono


mod_mono is an Apache module that makes it possible to run ASP.NET applications in Linux environments running Apache. While ASP.NET is a Microsoft technology and is traditionally used with IIS, mod_mono has become a viable option for deploying ASP.NET applications on Linux.


The module passes off requests for ASP.NET pages to an external program, mod-mono-server, which actually handles the requests. The communication between the Apache module and mod-mono-server is established using a Unix socket or a TCP socket.


Prerequisites


You will need apache, the web server, installed.
From the Mono project 'Downloads' page you can get mono, XSP and mod_mono. XSP is the module where mod-mono-server resides


Compiling mod_mono:


$ tar xzf mod_mono-X.Y.Z.tar.gz
$ cd mod_mono-X.Y.Z
$ ./configure
$ make
$ make install


Your first time :


When you installed XSP, a bunch of sample ASP.NET pages and web services were installed too. If the prefix used to configure XSP was /usr, the sample files are located in /usr/share/doc/xsp/test.
Let's say you want those file to be available under the virtual path /test. Edit your httpd.conf file (hint: /etc/httpd, /etc/apache2) and append the following lines (remove the numbers ;-):
- LoadModule mono_module modules/mod_mono.so
- Alias /test "/usr/share/doc/xsp/test"
- AddMonoApplications default "/test:/usr/share/doc/xsp/test"
- <Location /test>
- SetHandler mono
- </Location>


Ok. Now start/restart apache and browse http://127.0.0.1/test/index.aspx.
Voila ! welcome to ASP.NET!


So next time when a customer ask a simple question like “Can I run asp pages in my Linux server?” don't startle  :o ( like I did : :P :D ). Remember the word “mod-mono” 8)