PDA

View Full Version : Mono / Mod_mono installation instructions (for 3.0 accounts)



dattas
01-26-2008, 10:11 AM
NOTE: WESTHOST TECHNICAL SUPPORT CANNOT HELP YOU INSTALL OR CONFIGURE MONO OR MOD_MONO, IT IS A CUSTOM SCRIPT.
NOTE 2: Please don't send me messages saying that regular ASP doesn't work for you. That is a given, Mono does not support regular ASP (Please see the second question down at: http://www.mono-project.com/FAQ:_ASP.NET)

You need to have GNU Compiler Collection 1.0 installed on your VPS first, then ssh into your account.

First, create a folder for dependencies, my folder is going to be
~/monodep


mkdir ~/monodep

then lets go into this folder


cd ~/monodep

Now we will need to download a few dependencies.


wget ftp://ftp.gtk.org/pub/glib/2.12/glib-2.12.0.tar.gz

wget ftp://ftp.gnu.org/pub/gnu/gettext/gettext-0.17.tar.gz

wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.12.tar.gz

now lets open these bad boys up


tar -zxvf glib-2.12.0.tar.gz

tar -zxvf gettext-0.17.tar.gz

tar -zxvf libiconv-1.12.tar.gz

We are going to throw up some paths for ldconfig to read here


pico /etc/ld.so.conf

At the end of the file, add the following lines


/usr/local/gettext/lib
/usr/local/glib/lib
/usr/local/libiconv/lib

press control(ctrl) and x at the same time then press y then enter to save the changes
We need to install gettext first


cd gettext-0.17

./configure --prefix=/usr/local/gettext

make

make install

Now to install libiconv


cd ../libiconv-1.12

./configure --prefix=/usr/local/libiconv

make

make install

And now we need to add a path so that glib will install


export PATH=$PATH:/usr/local/gettext/bin:/usr/local/libiconv/bin:/usr/local/mono/bin

We will also change this in our .bashrc so we will not have to repeat this process


pico /.bashrc

Find a line that looks like

export PATH="$PATH:/usr/local/apache/bin"

and add this inside the quotes at the end of the line


:/usr/local/gettext/bin:/usr/local/libiconv/bin:/usr/local/mono/bin

So my line now looks like


export PATH="$PATH:/usr/local/apache/bin:/usr/local/gettext/bin:/usr/local/libiconv/bin:/usr/local/mono/bin"

We also need to run ldconfig, you can ignore any and all output here,


ldconfig

Now we need to make glib


cd ../glib-2.12.0

./configure --prefix=/usr/local/glib

make

make install

And we gotta run ldconfig once again to update the cache for the glib libraries


ldconfig

Now we can finally get the mono installer


cd ../../

wget ftp://www.go-mono.com/archive/1.2.6/linux-installer/6/mono-1.2.6_6-installer.bin

chmod a+x mono-1.2.6_6-installer.bin

./mono-1.2.6_6-installer.bin

Read through the license and hit y when it asks you if you accept this license

When it asks for the installation directory put in /usr/local/mono
When it asks if you want to add Mono to your PATH hit n because we already did that.
When it asks if you want to continue installing Mono on your computer hit y
after it installs it will say that some libraries are missing, that is for the GUI stuff that is included in the setup, you can safely ignore it and just press enter, we are going to skip reading the Readme file, so hit n

Now we need to get mod_mono


wget http://ftp.novell.com/pub/mono/archive/1.9/linux-installer/5/mono-1.9_5-installer.bin

tar -jxvf mod_mono-1.2.6.tar.bz2

cd mod_mono-1.2.6

Now lets build mod_mono


./configure --prefix=/usr/local/mono

make

make install

Now that we have everything installed we need to change some configurations.

We will now move the configuration file to the correct location


mv /etc/httpd/conf/mod_mono.conf /etc/httpd/conf.d/

Now if you are going to be using ASP .net (2.0) then we will need to make one more change, Open up your mod_mono.conf and before </IfModule> which is right at the end put


MonoServerPath /usr/local/mono/bin/mod-mono-server2

Save the file and then execute the command
restart and you should have mod_mono successfully installed, to test it you can create a new file in your webroot with the following information inside (This is a ASP 2.0 script, so make sure the file extention is .aspx)


<script language="VB" runat=server>

Sub RenderSomething()
Response.Write("<font color=red> ")
Response.Write("Here is the time: " & Now & "<br>")
End Sub

</script>

<%
RenderSomething()
%>

And there you have it, ASP on Linux, simply amazing and beautiful to behold Microsoft and Linux blending.

wildjokerdesign
01-27-2008, 08:43 AM
Great tutorial. Thanks for taking the time to share the process. Reading through it I began to wonder if it would be worth creating a single directory that could be used for installing custom scripts like this.

For example to combine the step where you created the directories and added the references to them for each dependency if you simply created a single directory at /usr/local/mycustom.

Then add to the /etc/ld.so.conf file: /usr/local/mycustom/lib

To .bashrc you would add: export PATH="$PATH:/usr/local/mycustom/bin" (Note: This could be a separate line after the existing export PATH="$PATH:/usr/local/apache/bin")

Once you have done the above and ran ldcofig you should be able to do the following.

For each install you would use: ./configure --prefix=/usr/local/mycustom

Does anyone see any fault with my thoughts above?

dattas
01-29-2008, 02:07 PM
Great tutorial. Thanks for taking the time to share the process. Reading through it I began to wonder if it would be worth creating a single directory that could be used for installing custom scripts like this.

For example to combine the step where you created the directories and added the references to them for each dependency if you simply created a single directory at /usr/local/mycustom.

Then add to the /etc/ld.so.conf file: /usr/local/mycustom/lib

To .bashrc you would add: export PATH="$PATH:/usr/local/mycustom/bin" (Note: This could be a separate line after the existing export PATH="$PATH:/usr/local/apache/bin")

Once you have done the above and ran ldcofig you should be able to do the following.

For each install you would use: ./configure --prefix=/usr/local/mycustom

Does anyone see any fault with my thoughts above?
Thanks I am hoping to make more tutorials, just let me know what you might like to install on a VPS and I will see if I can do it. I do not see any fault with your thoughts it will work as far as my knowledge extends, but I like to be able to go to /usr/local and see exactly what is installed and if I want to uninstall something I want it easy as removing a folder and removing some paths. I do not want to have to go looking through subfolders to find everything that the particular application installed and hoping and praying that I do not remove a file that was needed or installed by another application.

wildjokerdesign
01-30-2008, 09:22 AM
The ease of uninstalling something makes a lot of sense to me. I think maybe it is worth the extra steps in installing something. :)

What do you do with the tar.gz files you downloaded and the directories you decompressed them to once you have configured and installed? Am I correct in assuming they are no longer needed and could be deleted? Just thinking about Disk Usage.

devospice
01-30-2008, 02:33 PM
I just went through the whole tutorial and everything seemed to work, but the ASP pages are not being processed as you can see here:
http://cardeneiv.com.whsites.net

It looked like everything went through OK. How do I begin trouble-shooting this? I'm out of my element here.

devospice
01-30-2008, 03:08 PM
I'm running through it again. I know you said we could ignore all the output from the ldconfig line, but I'm getting this error:

Can't link /usr/lib/libstdc++-libc6.1.so.2 to libstdc++-2-libc6.1-1-2.0.0.so

Does that matter?

devospice
01-30-2008, 03:19 PM
OK one more. After the restart command I got this:

Stopping httpd:
Starting httpd: [Wed Jan 30 15:16:52 2008] [crit] (17) File exists: Failed to create shared memory segment for backend 'XXGLOBAL'

Does that mean anything? Those are the only errors I see. Everything else worked flawlessly, except that the ASP pages aren't working.

devospice
01-31-2008, 07:49 AM
I put your test code up on the site and I'm getting a page full of errors that "Compilation of Visual Basic code is not supported." You can see it here:

http://cardeneiv.com.whsites.net/test.aspx

dattas
01-31-2008, 11:44 AM
You forgot to do this step:
Now if you are going to be using ASP .net (2.0) then we will need to make one more change, Open up your mod_mono.conf and before </IfModule> which is right at the end put


MonoServerPath /usr/local/mono/bin/mod-mono-server2
Save the file and then execute the command

restart

tomhogans
08-16-2008, 11:03 PM
Incredibly helpful, worked exactly as described. Thanks a lot.