Wiki / tutorial:stack:xsp_asp.net_mysql

 

Ubuntu

Mono

Run this command to install Mono, XSP (the Mono webserver) and the Mono implementation of System.Data (required for interfacing with databases)

apt-get install mono-runtime libmono-data2.0-cil mono-xsp

MySQL

This is the command to install the MySQL server, client:

apt-get install mysql-client mysql-common mysql-server

Now you'll need to grab the MySQL .NET connector from MySQL's website:

mkdir mysql_data
cd mysql_data
wget http://dev.mysql.com/get/Downloads/Connector-Net/mysql-connector-net-1.0.10.1-noinstall.zip/from/http://ftp.gwdg.de/pub/misc/mysql/

Install 'unzip', and unzip it:

apt-get install unzip
unzip mysql-connector-net-1.0.10.1-noinstall.zip

Install the MySql.Data.dll assembly into the Mono GAC (Global Assembly Cache):

gacutil -i bin/MySql.Data.dll

Clean up our temporary directory:

cd ..
rm -rf mysql_data

Testing the server

Go to your document root, usually /var/www, and create a new file called 'index.aspx'. Put the following code inside:

<%= DateTime.Now %>

Drop back to bash, and start xsp. You should get something similar to the following:

root@ubuntu:/var/www# xsp
xsp2
Listening on address: 0.0.0.0
Root directory: /var/www
Listening on port: 8080 (non-secure)
Hit Return to stop the server.

Browse to http://your-vps-ip:8080/ in your browser, and you should get the time. If so, congratulations! You got XSP working.