I've also published this in ubuntu's forums:
It got me a few days to find out how to solve this problem. And it was rather frustrating. But finally I got to run mod_mono on apache, and get some asp.net 2.0 working on Ubuntu 8.04! I searched around the internet, and many have the same problem: It's annoying that Ubuntu Hardy doesn't let you install mod_mono on apache 2 without uninstalling PHP, though it was possible on Ubuntu 7.10.
We'll assume a new Ubuntu 8.04 installation, with an apache 2 and php 5 installed and working fine. It's annoying that Ubuntu Hardy doesn't let you install libapache2-mod-mono without uninstalling libapache2-mod-php5 (which will then not serve php pages, and will only serve them as downloadable files), though it was possible on Ubuntu 7.10. It's further annoying that it's all too complicated to get mod_mono working! Let's solve the problem. I'm assuming you know a bit about linux commands, just enough to edit a file at least. I'll not explain all commands, but you can find some explanations about what we're doing in the referenced pages i've written in the bottom of the post.
First steps:
References:
Many thanks for your detailed installation instructions.
I encounter the following problem after testing the XSP:
root@obs:/usr/local/lib/xsp/test# xsp2
xsp2
Listening on address: 0.0.0.0
Root directory: /usr/local/lib/xsp/test
Listening on port: 8080 (non-secure)
Hit Return to stop the server.
Next, the response from http://localhost:8080/ is:
Firefox can't establish a connection to the server at localhost:8080.
Though the site seems valid, the browser was unable to establish a connection.
* Could the site be temporarily unavailable? Try again
later.
* Are you unable to browse other sites? Check the
computer's network connection.
* Is your computer or network protected by a firewall or
proxy? Incorrect settings can interfere with Web
browsing.
How to overcome the above problem? Once again, thousands
of thanks.
Salang
lagenda238@yahoo.com
Dear Salang,
As far as the Mono installation is concerned, it should have successfully installed, as you can open successfully the XSP2 web server. So your problem should be a networking problem.
Your browser says it can't find localhost. The most usual problem should be if you're trying to browse localhost from a different machine. 'localhost' always refers to the machine it is run. So, if you're browsing from a different machine than the one where ubuntu is, that won't work.
If ubuntu is installed on a different machine on your LAN, you should find its IP, or assign that machine a fixed IP in your router's configuration. When you find its IP, then you can browse it by typing http://192.168.2.2:8080 for example.
Installing mod_mono module for apache 2:
sudo apt-get install apache2 apache2-threaded-dev
apache2-threaded-dev will be needed for apxs, which automates the loading of apache modules.
cd ~/src/
wget ftp.novell.com/.../mod_mono-1.9.tar.bz2
tar -xvf mod_mono-1.9.tar.bz2
cd mod_mono-1.9
sudo ./configure --prefix=/usr --with-apxs=/usr/bin/apxs2
sudo make
sudo make install
cp -r /usr/local/lib/xsp/test /var/www/test
This will copy the XSP test site to Apache's default root website (/var/www), so that we may later test mod_mono and see if everything works fine.
sudo a2enmod mod_mono
i can't do this , it reports
root@ubuntu:/usr/lib/apache2/modules# a2enmod mod_mono
This module does not exist!
i follow your article step by step, what can i do ?
thank you. please send mail to me 361571@qq.com.
It seems the installation of mod_mono doesn't automatically install the module to apache. So, after the installation you can still activate the module on apache manually:
Visit my first reference page at blog.ruski.co.za/.../Install-Mono-126-on-Ubuntu-710.aspx, and follow the steps of the section "Installing Mod_Mono" just after the "make install" command. These steps are equivalent with the "a2enmod" step of my guide, and you'll be able to continue from there.
thank you for your reply so quickly.
i have found how to solve that. but i don't know how to add the website to sites-aviable document, i follow the article ,it doesn't work.
here is my sites-avaiable
<VirtualHost 192.168.0.1:80>
ServerName test.goddz.net
MonoServerPath "/usr/local/bin/mod-mono-server2"
MonoApplications "/test:/var/www/test"
<Directory /var/www/test>
SetHandler mono
AddHandler mod_mono .aspx .ascx .asax .ashx .config .cs .asmx
DirectoryIndex index.html index.aspx default.aspx Default.aspx
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>
is there anything wrong ? that doesn't work.
beside. the link you have gaved me, it can 't be accessed, something error.
now i have successed made xsp test can be accessed.
but it can't parase asp, is it only parase aspx and the version above ?
can i say mono only support asp.net but not asp?
thank you.
dear flourishing,
As I've updated my guide also, please ensure you've made these steps, and if there was any error, I'll be glad to hear about it and fix it on the guide.
I don't think classic ASP will run with mono or XSP, only asp.net, not sure though. Because the two are very different technologies. ASP.NET is the newest of the two, and is designed to substitute ASP. You can also read Microsoft's own guide on migrating.
What page I gave you cannot access? And what error does apache give you when it starts up and tries to load the website configuration file?
About the apache websites:
You can define websites in the /etc/apache2/sites-available folder, but only those that exist under /etc/apache2/sites-enabled will work. The sites-enabled folder basically contains only links to the sites defined in sites-available folder.
In the default configuration of apache, there's only one site enabled: /etc/apache2/sites-enabled/000-default which points to /etc/apache2/sites-available/default. So instead of "sudo vi /etc/apache2/sites-enabled/000-default" you can "sudo vi /etc/apache2/sites-available/default".
In that file, assuming you only have one virtual host (a.k.a only one website on your server), try this configuration, which is based on the one that currently works for me:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
<Directory /var/www/>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Allow from all
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
Failed to destroy the '/tmp/mod_mono_dashboard_XXGLOBAL_1' shared memory dashboard ....
message is received when trying to do /etc/init.d/apache2 restart
Any ideas
Seems to be a general problem with mod_mono. You get a few results if you search your error on google. But I have no clue about it.
If you find a solution, you can share it with us.
Thanks
it worked for me toooo....
im too glad
thanks for your helping post.