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

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Other Community Discussions > Tutorials & Tips
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Tutorials & Tips
The place to find Ubuntu related Tips & Tricks.

 
Thread Tools Display Modes
Old July 29th, 2006   #1
scottwill
First Cup of Ubuntu
 
scottwill's Avatar
 
Join Date: Jun 2006
Location: MN, USA
Beans: 9
Ubuntu 6.06
Arrow HOWTO: apache2 w/ mono, xsp & mod_mono **NEW**

OK, so getting ASP.NET to run on apache is not as easy as it may seem. It took me 4-5 hours over 10+ sites and a lot of retries before I got it going. So I figured I'd put it all together so hopefully it would help someone else.

* I don't give any kind of warranty for this howto. But if you follow this correctly you shouldn't have any problem.
*This howto does not use the mono packages in apt but rather the current stable sources.


First things First

Open your terminal

make sure you enable root

sudo -s

and get up to date

apt-get update && apt-get dist-upgrade



Apache

Apache we do want from apt so

apt-get install apache2 apache2-mpm-prefork apache2-threaded-dev


apt will of course want to install the required debs as well.

Even if you already have apache installed make sure to get apache2-mpm-prefork & apache2-threaded-dev

Once it's done you can test it http://localhost


Mono

Before we download and build mono, we need to have the appropriate tools

apt-get install libglib2.0-0 libglib2.0-dev pkg-config bison make


Download the mono, xsp and mod_mono sources from go-mono

*Note that the build number's of the source packages will change eventually.

cd /tmp

wget http://go-mono.com/sources/mono/mono-1.1.13.8.tar.gz
wget http://go-mono.com/sources/xsp/xsp-1.1.13.7.tar.gz
wget http://go-mono.com/sources/mod_mono/....1.13.5.tar.gz


Unpack mono-1.1.13.8.tar.gz

tar xzf mono-1.1.13.8.tar.gz

Build mono

cd mono-1.1.13.8
./configure --prefix=/usr
make
make install


XSP

We'll do the same for xsp. xsp and mod_mono won't take nearly as long as mono does to make.

cd /tmp
tar xzf xsp-1.1.13.7.tar.gz
cd xsp-1.1.13.7
./configure --prefix=/usr
make
make install


mod_mono

and finally

cd /tmp
tar xzf mod_mono-1.1.13.5.tar.gz
cd mod_mono-1.1.13.5
./configure --prefix=/usr
make
make install



Immense happiness, we are installed and ready to go! Well, not quite yet. We still need to configure apache to use mod_mono. See, the way it works, as far as I can tell, is apache takes the web request, sees it's a .aspx file that's being requested and passes it to xsp. xsp then compiles it using mono and gives the html output back to apache to serve. It's mod_mono that makes this conversation possible.

Configure Apache

cd /etc/apache2
vi httpd.conf
OR nano httpd.conf if that's your editor of choice

Append to the file Include mod_mono.conf

Now edit mod_mono.conf

vi mod_mono.conf

At the end of the file append

Alias /test "/usr/lib/xsp/test"
AddMonoApplications default "/test:/usr/lib/xsp/test"
<Location /test>
SetHandler mono
</Location>


Save and exit. Then restart apache

/etc/init.d/apache2 force-reload

Now we test it http://localhost/test

It works!

Last edited by scottwill; September 21st, 2006 at 07:12 PM..
scottwill is offline   Reply With Quote
Old September 6th, 2006   #2
HAL98 SE
5 Cups of Ubuntu
 
Join Date: Apr 2006
Beans: 21
Re: HOWTO: apache2 w/ mono, xsp & mod_mono **NEW**

hi scottwill,

thanks for the howto, I'd been trying to get this to work for a while using various tutorials, followed yours to the letter and it works fine, i uninstalled all the synaptic versions of the software and used wget as you stated and it worked a treat.

Many Thanks! Now I just need to come up with a revolutionary, world enhancing app that will improve the lives of millions! as you can see, you helped me get the hard part out of the way.
HAL98 SE is offline   Reply With Quote
Old September 12th, 2006   #3
DA_uf
5 Cups of Ubuntu
 
Join Date: Mar 2005
Beans: 37
Re: HOWTO: apache2 w/ mono, xsp & mod_mono **NEW**

Hello scottwill,
Thanks! Your method worked for me as well.

Now can I create an app with Visual Web Developer 2005 Express Edition and deploy it to this Apache server?

http://msdn.microsoft.com/vstudio/ex.../vwd/10vcs.wvx

I had trouble with the VWD "Copy Web Site", so I just used FileZilla to ftp the entire site directory "Lesson10cs" under the existing test directory as "/usr/lib/xsp/test/Lesson10cs".

If I try http://localhost/test/Lesson10cs/Default.aspx
I get
Quote:
Server error in '/test' application
Description: Error processing request.

Error Message: HTTP 500.

Stack Trace:

System.Configuration.ConfigurationException: Unrecognized attribute in root element (/usr/lib/xsp/test/Lesson10cs/Web.config line 10)
in <0x00043> System.Web.Configuration.ConfigurationData:ThrowEx ception (System.String text, System.Xml.XmlTextReader reader)
in <0x00082> System.Web.Configuration.ConfigurationData:InitRea d (System.Xml.XmlTextReader reader)
in <0x0009e> System.Web.Configuration.ConfigurationData:LoadFro mFile (System.String fileName)
If append the following below the mod_mono.conf "/test" information entry:
Alias /test2 "/usr/lib/xsp/test/Lesson10cs"
AddMonoApplications default "/test2:/usr/lib/xsp/test/Lesson10cs"
<Location /test2>
SetHandler mono
</Location>

and try http://localhost/test2
I get
500 Internal Server Error
DA_uf is offline   Reply With Quote
Old September 12th, 2006   #4
scottwill
First Cup of Ubuntu
 
scottwill's Avatar
 
Join Date: Jun 2006
Location: MN, USA
Beans: 9
Ubuntu 6.06
Re: HOWTO: apache2 w/ mono, xsp & mod_mono **NEW**

Sorry but the answer is no. Visual Web Developer 2005 Express Edition uses the 2.0 .Net framework, whereas this howto only covers the 1.1 .Net framework. (Someone let me know if I am mistaken.)

There is a solution for Mono to use 2.0 over 1.1, but I have yet to try it myself.
scottwill is offline   Reply With Quote
Old September 12th, 2006   #5
DA_uf
5 Cups of Ubuntu
 
Join Date: Mar 2005
Beans: 37
Re: HOWTO: apache2 w/ mono, xsp & mod_mono **NEW**

Thanks for your reply.

So, had I been developing with 1.1, my deployment steps would have been correct?

Please post here if you find out how to enable 2.0 support.

Which 1.1 development tool would you recommend?

EDIT: Hey, let me put you onto this:
http://lists.ximian.com/pipermail/mo...er/015880.html
And maybe you can distill it down for us

Last edited by DA_uf; September 12th, 2006 at 04:28 PM.. Reason: Found new post
DA_uf is offline   Reply With Quote
Old September 17th, 2006   #6
book36worm
First Cup of Ubuntu
 
Join Date: Aug 2006
Beans: 3
Ubuntu 6.06
Send a message via AIM to book36worm Send a message via Yahoo to book36worm
Re: HOWTO: apache2 w/ mono, xsp & mod_mono **NEW**

Hi, I'm a newbie trying to get apache up and running, fraid that i'm lost on this simple how to. so please bare with me. i'm able to get the downloads and unpack them. but i have a problem when i comes to the build. there must be a step between these two lines that need to be written that either you did w/o writing or did earlier. i can't get the cd comand to work, i get "bash: cd: mono-1.1.13.8.tar.gz: Not a directory" as an error. please help! thanks

bookworm
ps. will this need to be done for each of these installs?


tar xzf mono-1.1.13.8.tar.gz
===> something happen here? or not<====
Build mono

cd mono-1.1.13.8.tar.gz
./configure --prefix=/usr
make
make install
book36worm is offline   Reply With Quote
Old September 21st, 2006   #7
scottwill
First Cup of Ubuntu
 
scottwill's Avatar
 
Join Date: Jun 2006
Location: MN, USA
Beans: 9
Ubuntu 6.06
Re: HOWTO: apache2 w/ mono, xsp & mod_mono **NEW**

Quote:
Originally Posted by book36worm View Post
tar xzf mono-1.1.13.8.tar.gz
===> something happen here? or not<====
Build mono

cd mono-1.1.13.8.tar.gz
./configure --prefix=/usr
make
make install
you're mistaking the files for the folders. After you tar, the directory by default will be the name of the file minus the extension.

In other words, tar will take the file 'xzf mono-1.1.13.8.tar.gz' and make a subfolder called 'xzf mono-1.1.13.8' in the current directory you are in.

Change: cd mono-1.1.13.8.tar.gz to cd mono-1.1.13.8

--edit--
It appears that was a typo in my original howto. It has been edited with the correction.
scottwill is offline   Reply With Quote
Old September 17th, 2006   #8
MrBrownstone3g
First Cup of Ubuntu
 
Join Date: Mar 2005
Beans: 9
Re: HOWTO: apache2 w/ mono, xsp & mod_mono **NEW**

Hi all

Does mod_mono/xps also allow you to server asp 1.0 and 2.0 pages?

Cheers
Graham
MrBrownstone3g is offline   Reply With Quote
Old September 21st, 2006   #9
scottwill
First Cup of Ubuntu
 
scottwill's Avatar
 
Join Date: Jun 2006
Location: MN, USA
Beans: 9
Ubuntu 6.06
Re: HOWTO: apache2 w/ mono, xsp & mod_mono **NEW**

Quote:
Originally Posted by MrBrownstone3g View Post
Hi all

Does mod_mono/xps also allow you to server asp 1.0 and 2.0 pages?

Cheers
Graham
xps uses mcs to compile your pages. mcs in turn uses the equivalent of the .NET Framework 1.1.xxxx. There is xps2 and mcs2 (I think) which use the 2.0 framework.
scottwill is offline   Reply With Quote
Old October 18th, 2006   #10
DSn0wMan
Dipped in Ubuntu
 
DSn0wMan's Avatar
 
Join Date: Apr 2006
Location: San Diego
Beans: 559
Ubuntu Karmic Koala (testing)
Send a message via Yahoo to DSn0wMan
Re: HOWTO: apache2 w/ mono, xsp & mod_mono **NEW**

There seems to be a problem with libglib2.0-dev.

I cant install it through apt-get. The prompt just barfs the following:

josh@josh-desktop:~/download/mono-1.1.17.2$ sudo apt-get install libglib2.0-devReading package lists... Done
Building dependency tree... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.

Since you only requested a single operation it is extremely likely that
the package is simply not installable and a bug report against
that package should be filed.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
libglib2.0-dev: Depends: libglib2.0-0 (= 2.10.2-1ubuntu3) but 2.10.3-0ubuntu1 is to be installed
E: Broken packages

Has anyone else had this problem?
__________________
-- There's no place like ~

My Blog
DSn0wMan 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 12:13 AM.


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