ASP and PHP running under Apache on Linux

So for years I’ve been developing on PHP, I’m even certified and certainly it’s a great language but unfortunately ASP programmers are way better paid so I decided to start learning ASP. I do have windows installed on my lap but my server is a CentOs with Apache hosted on my home.

Since I have quite a lot of things hosted there installing IIS on a Windows and set it to answer on another port wasn’t my desire so I wento to google for a couple of hours and after I typed “Apache ASP” I found this project called Mono. Very interesting but the main thing is that through a couple of installations and onfigurations you may get your linux/apache server running asp pages, even .Net Wow!

What did I do? First I installed the mono module for apache which is called after that I only added the module to my apache with the following lines:

LoadModule mono_module /etc/httpd/modules/

Then installed the following with yum: XSP and mono-devel (mono-devel will also instal mono-web and mono-winforms).

Then after installing XSP I created a Virtual host on apache to host asp apps.

The Virtual Host entry looks something like this:

<VirtualHost *:80>

ServerName asp.localdomain

ServerAlias *.asp.localdomain

DocumentRoot /var/www/html/localdomain/asp

MonoAutoApplication disabled

AddHandler mono .asp .aspx .ascx .asax .ashx .config .cs .asmx .axd

MonoApplications “/:/var/www/html/localdomain/asp”


After this I copied the files under /usr/lib/xsp/test to the folder I specified as the DocumentRoot

Then I restarted apache and typed on a browser: http://asp.localdomain/index.aspx

And Bingo!!!! It’s aliiiive!

Oh don’t forget to read mono documentation here and here!

Tags: , , ,

Comments are closed.