Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Forum Archive > Main Support Categories > Server Platforms
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Hello, Unregistered You are browsing a READ only archive of the main support categories pre 4/21/2008. You will not be able to post or reply any threads in this section.
Ubuntu 9.10 is out!!!

When downloading Ubuntu 9.10 please consider using bittorrent to get your copy of Ubuntu.

The Ubuntu Developers Summit for Lucid Lynx will be held the week of 16-Nov-2009 till 20-Nov-2009 in Dallas, TX USA. Visit the the Ubuntu wiki for more information about UDS and how to participate remotely.

Server Platforms
Discussion regarding any server based ubuntu release.

 
Thread Tools Display Modes
Old July 20th, 2005   #1
ben ogle
First Cup of Ubuntu
 
Join Date: Jul 2005
Beans: 3
Serving ASP.NET pages with mod_mono and apache2

Well, I *finally* got mod_mono working on my ubuntu box. I did quite a bit of searching so i thought I would post up and tell you folks some of the notable things I learned about it.

First of all, dont use the deb/ubuntu package. It is mono v1.0.5 or something which doesnt come with windows forms and many other things as well. Compile it from source. Its really not all that difficult. I originally installed the apt-get package then tried to use the mod_mono package but nothing worked. I had also read that there were problems with the package on apache2, which I am using. So I found this guide and followed it pretty closely:

http://www.codeproject.com/cpnet/introtomono2.asp

Essentially all you have to do is download and install mono, xsp, mod_mono, then add a few lines to some config files. So go to here:

http://go-mono.com/sources/

And download mono, xsp, and mod_mono. Then you tar -xvzf whatever-package.gz and cd into the unzipped directory. At the command line run ./configure --prefix=/usr then make, then make install.

To install mono I needed a crapload of utilities I did not have. Most, though, could be downloaded from the apt-get install goodness.

I originally tried to install all the mono stuff with a prefix /etc because I thought apache was installed in /etc (I used the package), but it had a lot of problems installing xsp because it could not find any of the utilities it needed. So I ended up installing everything with --prefix=/usr. Also, I ran into an odd make error with mod_mono. When i tried to compile it I got this error:

apxs:Error: no config variable PREFIX

After searching I found the solution was to run this in the command line when in the mod_mono unzipped directory:

sed -i -e 's/ -S PREFIX="$(prefix)"//' src/Makefile.in

Once I got everything installed I, of course, had more problems. XSP was working fine. But when i added the module to apache and all the info I needed to the config files I was getting a "503: Service Temporarily Unavailable" error. This was a big problem because it seemed like no one was having the same issue. Well it turns out that this error occurs when there is no unix socket file created for mono. The mod-mono-server app is supposed to create this file but it was not. So I looked in the apache logs and there were errors concerning the version of corlib. It needed 37 and I had version 22. It was looking at the version of mono I had installed from the package. So I uninstalled all the packages and I reinstalled the 3 apps (it broke mono when i uninstalled the packages, then xsp was broken when I reinstalled mono). I restarted apache and it worked!

Then to allow other folks to see it I put this in the apache config file:

<Directory /the/dir/of/the/asp/pages>
Order Allow,Deny
Allow all
</Directory>

and everything worked.


More links:
http://www.gotmono.net/documentation...ono-howto.html
http://www.mono-project.com/Mod_mono
and there is an INSTALL file in the mod_mono source download.

I hope this helps someone out.

Ben

Last edited by ben ogle; July 20th, 2005 at 02:57 AM..
ben ogle is offline   Reply With Quote
Old July 20th, 2005   #2
Hikaru79
Gee! These Aren't Roasted!
 
Hikaru79's Avatar
 
Join Date: Dec 2004
Location: Waterloo Ontario (Canada)
Beans: 171
Kubuntu 5.10
Send a message via AIM to Hikaru79 Send a message via MSN to Hikaru79 Send a message via Yahoo to Hikaru79
Re: Serving ASP.NET pages with mod_mono and apache2

This DEFINETLY helps me out. You should mark it as a HOWTO and ask somemod to move it to the HOWTO forum. This is great!
__________________
I seem to have discovered a truly remarkable proof for Fermat's Last Theorem, which this siggie is too small to contain.
Hikaru79 is offline   Reply With Quote
Old August 12th, 2005   #3
Mr. Electric Wizard
Ubuntu Extra Shot
 
Mr. Electric Wizard's Avatar
 
Join Date: Jun 2005
Location: Houston, Texas
Beans: 352
Re: Serving ASP.NET pages with mod_mono and apache2

I wonder when Mono will be taking on ASP.NET 2.0?
That is going to be the ULITMATE solution, I can't wait!
Mr. Electric Wizard is offline   Reply With Quote
Old October 15th, 2005   #4
rush_ad
5 Cups of Ubuntu
 
Join Date: May 2005
Beans: 37
Re: Serving ASP.NET pages with mod_mono and apache2

i think i need more help. how do i test the i have setup mono correctly?
rush_ad is offline   Reply With Quote
Old February 28th, 2006   #5
hallikpapa
5 Cups of Ubuntu
 
Join Date: Dec 2005
Beans: 15
Re: Serving ASP.NET pages with mod_mono and apache2

Anyone know what compilers I need to have installed to do this?

Also, anyone got ASP.NET 2.0 working?

I have some intranet pages from work built in Windows I want to see if they can be hosted on an ubuntu box.
hallikpapa is offline   Reply With Quote
Old April 26th, 2006   #6
ifeelcool.com
First Cup of Ubuntu
 
Join Date: Jan 2006
Beans: 8
Re: Serving ASP.NET pages with mod_mono and apache2

Hello after a few nights of programming i got it finally working..... Not really only a pre-compiled project worked.....
I have been trying to build my own simple hello world app, but it is not working.

What is the best way to create/compile/run an asp.net application?
I have tried the following for compiling:
-
Code:
mcs /t:library /out:./bin/Program.dll Program.cs
Adding to config files:
-
Code:
mod-server2-admin add --path=/var/www/program --app=program
-edit /etc/apache2/mods-enabled/mono.conf adding lines:
Code:
Alias /program "/var/www/program"
AddMonoApplications default "/program:/var/www/program"
<Location /program >
    SetHandler mono
</Location>
-finally i surf to http://localhost/program/ and then i am getting the error it can't not find Program.dll

And one other question, do i need to add the parameters -r:System.* to the mcs command?

Any help on building a ASP.Net application on ubuntu apache2 would be nice!
__________________
ubuntu makes me (i)feelcool.com
ifeelcool.com is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:59 PM.


vBulletin ©2000 - 2009, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. bilberry