Advertisment

ASP.NET on PCQLinux

author-image
CIOL Bureau
Updated On
New Update

ASP.NET can be done on Linux and Mono is the key to implementing this. Currently, Mono only implements the compiler for C# and not other languages like VB.NET or J#. The complete Mono 1.0 is available for PCQLinux 2005. You will need to have already installed PCQLinux with the Apache web server for this to work. Let's now install Mono and configure it to work with Apache.



Installing Mono



To include Mono at installation time you can select the Developer Workstation type, which automatically selects the packages for you.You can manually select them from the PCQLinux Specials > Developer section.



To install it manually, pop in the PCQLinux 2005 CD3 into your drive and issue the following commands.



# cd /media/cdrom/PCQLinux/RPMS

# rpm -ivh mono*

# rpm -ivh xsp*

# rpm -ivh mod_mono*



This will install all the required packages for you. We'll now set up the ASP.NET part of Mono that will allow you work with some basic ASP.NET applications.



Enabling ASP.NET



There are two ways you can host ASP.NET applications. One, using the Mono XSP web server, or the other, more preferred method-using the mod_mono module with Apache Web server. To set up apache, go to the /etc/httpd/conf directory on your hard disk and open up the httpd.conf file there. Add the following lines to it to enable the Mono module.



LoadModule mono modules/mod_mono.so



Alias /aspnet "/usr/share/doc/xsp/test"

MonoApplications "/aspnet:/usr/share/doc/xsp/test"



SetHandler mono





These lines perform the following functions:





Load the mod_mono module that was installed
Create a new virtual directory called 'aspnet' to the server

Set the handler to the Mono module you created earlier

Once you have saved this file, go to the shell prompt and issue the command to restart Apache with ASP.NET enabled:




# service httpd restart



Running ASP.NET




To test out whether ASP.NET works, open up FireFox and browse to http://localhost/aspnet. If things are fine you will see a list of sample ASPX files that you can execute.



To work with ASP.NET, you can code either with the tools in PCQLinux or you can develop them on a Windows machine and deploy it here to the virtual directory in Apache. You would need to add a Directory directive for each directory of ASP.NET applications you want to deploy — or, they would not run.



Mono attempts to make .NET platform-independent. It works well with the current crop of ASP.NET applications (made in ASP.NET version 1.x). You can quite easily host your ASP.NET applications on this platform.

*Sourced from PC Quest

tech-news