My Adventures Installing mono 2.0 on CentOS 4 to work with apache via mod_mono
Apparently the good folks over at the mono project decided to discontinue binary packages for the Red Hat line of linux distributions. It’s a shame in a way, there are a lot of those installation out there, so it would be nice to keep things updated through yum or apt-install or rhupdate, etc..
On the up side, installing from source has never been easier. In the past I have went through many hours of trying to get the right versions of different libraries that were needed. With the official release of 2.0 it seems much better. I thought I would share the steps that I went through.
Disclaimer: This worked on a fairly fresh install of CentOS 4.7. I have not tried it on 5.x, nor on any other flavor of linux (SUSE, Ubuntu, etc..) so your mileage may vary.
At the time of the install (and this writing) the current mono stable version is 2.0.1 so all references will be to that version. Here are the steps that I went through.
Preparation
Always be prepared – Boy Scouts motto…
In rooting around the web I did find a few helpful pointers. First, make sure you have gcc installed. Now this is one of those duh pieces of information, but in the fairness of completeness I thought I would mention it. (Note: If you do not have gcc or bison, install them! Credit The_Assimilator’s comment)
# yum install gcc-c++
# yum install bison
yum install httpd-devel
You may also require the glib-2.0 libraries (thanks to Michael Walsh for that bit). If you receive the error “Package glib-2.0 was not found in the pkg-config search path” you can install it via yum as well.
yum install glib2-devel
The Main Dance
Next comes the meat of the installation. First, I downloaded the necessary source packages. I simply used wget to snag the core mono package, xsp (mono web server) and mod_mono (apache integration).
wget http://ftp.novell.com/pub/mono/sources/mono/mono-2.0.1.tar.bz2
wget http://ftp.novell.com/pub/mono/sources/xsp/xsp-2.0.tar.bz2
wget http://ftp.novell.com/pub/mono/sources/mod_mono/mod_mono-2.0.tar.bz2
Next we install the mono core
tar -vxjf mono-2.0.1.tar.bz2 cd mono-2.0.1 ./configure make make install cd ..
Next comes xsp
tar -vxjf xsp-2.0.tar.bz cd xsp-2.0 ./configure make make install cd ..
At this point I recevied an error (I believe it was in the make process) that the compiler could not find the file dotnet.pc. I found that it was indeed on my system so I simply had to export the path and then finsih the compile.
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig make make install cd..
Note: Make sure the file dotnet.pc is in that location. If not, adjust the path above.
Finally we install mod_mono
tar -vxjf mod_mono-2.0.tar.bz2
cd mod_mono-2.0
./configure
make
make install
There, easy huh?
Configuration
You may want to verify a few thigns to make sure the configuration is ready to rock. In my case, I am keeping the mono configuration in a separate file for sanity sake. You can do that or put it all in your httpd.conf, it’s up to you.
<IfModule !mod_mono.c> LoadModule mono_module /usr/lib/httpd/modules/mod_mono.so AddType application/x-asp-net .aspx AddType application/x-asp-net .asmx AddType application/x-asp-net .ashx AddType application/x-asp-net .asax AddType application/x-asp-net .ascx AddType application/x-asp-net .soap AddType application/x-asp-net .rem AddType application/x-asp-net .axd AddType application/x-asp-net .cs AddType application/x-asp-net .config AddType application/x-asp-net .Config AddType application/x-asp-net .dll DirectoryIndex index.aspx DirectoryIndex Default.aspx DirectoryIndex default.aspx </IfModule>
November 6, 2008 Posted by palehorse | .NET, C#, Development, Operating Systems | CentOS, Linux, mono | 13 Comments
Pale Tweets
- Chicken on the grill, sauce on the stove, beer in the hand. Ah summer! 4 days ago
- @JTRobinette hah, maybe that's it! I could use some of those #jedimindtricks 4 days ago
- Wow, how does boondocks make it if they are this dead on az friday night #inbend 5 days ago
The Cloud
Archives
Pale’s Social Graph
Google Reader Shared Stuff- Adobe Joins Microsoft's MAPP Program
- Requiem for the G1
- Pour one out: T-Mobile G1 no longer for sale
- Review: Samsung Galaxy S
- Android Users Aren't As Disloyal As Reported
- Acer's Android-powered Stream confirmed for Expansys-exclusive August 9th launch
- Samsung dispatching free Galaxy S handsets to iPhone 4 whiners on Twitter?
- OnStar expands smartphone control over entire 2011 GM lineup
- Samsung Galaxy S review shootout: Captivate for AT&T and Vibrant for T-Mobile
- “As Administrator” only a CTRL-Shift-Click away (and other keyboard shortcuts you might not know)
Pale Tweets
- Chicken on the grill, sauce on the stove, beer in the hand. Ah summer! 4 days ago
- @JTRobinette hah, maybe that's it! I could use some of those #jedimindtricks 4 days ago
- Wow, how does boondocks make it if they are this dead on az friday night #inbend 5 days ago
Blogroll