Mod mono on Apache

From openSUSE

Geeko This HOWTO will guide you through whole instalation and configuration process (including Apache web server and Mono framework), that will allow you to host ASP.NET webpages on your OpenSUSE server.

Note: It is assumed here, that you have completed minimal server installation of OpenSUSE.

mod_mono is a module for the Apache web server allowing it to host ASP.NET pages.

Contents

Availability

Image:susemini.png
Version:
10.3
mod_mono 1.2.5-22
Newer versions are available in recommended repository
Image:susemini.png
Version:
11.0
mod_mono 1.9-20.1
Newer versions are available in recommended repository
Image:susemini.png
Version:
11.1
mod_mono 2.0-1.40
Newer versions are available in recommended repository

Installing Apache2

If you have already have Apache installed, you can skip this chapter. Ain't sure? Run following command:

# httpd2 -v

If you got Server version and Server built info, you already have Apache installed. Otherwise you got command not found error and you need install apache. Here's how:

# zypper refresh
# zypper in apache2

Installing mono

We're focusing here only on installation itself. For additional information see Mono page.

You can install mono from the default repositories, but it's recommended to add mono-stable repo to get the latest stable release. You can find the URL of the repo suiting your version of OpenSUSE on mono download page. Simply select OpenSUSE, then your version and platform and you'll get the according repo address. Here we're adding the repo for OpenSUSE 11.1 as an example:

# zypper addrepo http://ftp.novell.com/pub/mono/download-stable/openSUSE_11.1 mono-stable
# zypper refresh --repo mono-stable

Once done, you you're good to install mono:

# zypper in --repo mono-stable mono-core

Installing XSP

XSP is a small http server written in C#, that can serve ASP webpages. You could use it even without apache, but its possibilities are very limited, so for most purposes apache is needed anyway. Apache itself serves the ASP webpages by proxying the requests to the mod-mono-server, which is a part of XSP instalation.

# zypper in --repo mono-stable xsp

Installing mod_mono

Finally you need to install mod_mono itself. It's an apache module, that enables it to proxy ASP requests to mod-mono-server.

# zypper in --repo mono-stable apache2-mod_mono

You also need to install libgdiplus0 library.

# zypper in libgdiplus0

Configuration

All the configuration files were made during the instalation and they are ready for a basic test run. You only need to include mod_mono.conf in your httpd.conf. Edit /etc/apache2/httpd.conf and add following line:

Include /etc/apache2/conf.d/mod_mono.conf

then you have to enable mod_mono module. Run

# a2enmod mod_mono

The default apache home directory is in /srv/www/htdocs/ copy there some of your ASP webpages, or use the test pages that come with XSP - you can find them in /usr/lib/xsp/test.

Finally start up your apache and make it start with the system for the future:

# service apache2 start
# chkconfig -a apache2


That's it! Your ASP server should now be up and running.

External Links