howto: mod mono / asp.net

vandal

Verified User
Joined
Oct 22, 2003
Messages
696
Location
Calgary, AB
Hey everyone I decide to try this on my dabox last night and it appears i have it working.

I am running redhat ES 3.0 with apache 1.3.x

here is how i did it.

============================

1) install glib 2.0

in redhat i just ran up2date glib2-devel. for your distro it may be a bit different

2) download the packages and untar.

I grabbed the source code from this page: http://go-mono.com/sources-stable/

Code:
cd /usr/src 

wget [url]http://go-mono.com/sources/mono/mono-1.1.13.8.tar.gz[/url]

wget [url]http://go-mono.com/sources/xsp/xsp-1.1.13.7.tar.gz[/url]

wget [url]http://go-mono.com/sources/mod_mono/mod_mono-1.1.13.5.tar.gz[/url]

tar xvfz mono-1.1.13.2.tar.gz; tar xvfz xsp-1.1.13.tar.gz; tar xvfz mod_mono-1.1.13.tar.gz;

3) configure and install mono. I chose to install it to /opt/mono/

Code:
cd mono-1.1.13.2

./configure --prefix=/opt/mono/
make
make install

4) configure and install xsp server, this is required even if you want to run mod_mono.

Code:
cd ../xsp-1.1.13

./configure --prefix=/opt/mono
make
make install

5) configure and install mod_mono

Code:
cd ../mod_mono-1.1.13

./configure --prefix=/opt/mono
make
make install

6) edit httpd.conf. Here we will add in the demo files.

[code]
pico -w or vi /etc/httpd/conf/httpd.conf

scroll to the bottom to find where DA has included all the user httpd.conf files. At the end of those add:

Code:
Include /etc/httpd/conf/mod_mono.conf

Next, find where DA has added aliases for phpmyadmin/webmail etc.. should look something like this:

Code:
Alias /config /var/www/html/redirect.php
Alias /phpMyAdmin /var/www/html/phpMyAdmin/
Alias /phpmyadmin /var/www/html/phpMyAdmin/
Alias /webmail /var/www/html/webmail/

now at the bottom of that add:

Code:
Alias /demo "/opt/mono/lib/xsp/test"

Restart apache and load up, www.yourdomain.com/demo/ and your should see the aspx demo files.

Good luck, please post fixes, suggestions on this thread.

van.
 
Last edited:
Sir,

I try to install but wothoud any succes..

I`m getting this error:

checking for -Wdeclaration-after-statement option to gcc... yes
checking for pkg-config... no
configure: error: You need to install pkg-config

I have also done this:

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig

I didnt work for me..

Cant you help me please..

I have running FC 3
 
Chek first:

pkg-config --version

( i didn`t pkg-config)
download it: yum - y install pkgconfig

check rpm -q gtk+ | glib
check the list have, you need:
gtk2-devel
glib2.0

download it: yum -y install gtk2-devel

Check also gcc :)

than you can ./configure, make and make install use.
 
Hello,

I experience problems with XSP.

The versions I use from http://go-mono.com/sources-stable/ :

* mono-1.1.13.8.tar.gz
* xsp-1.1.13.7.tar.gz
* mod_mono-1.1.13.5.tar.gz

I tried to compile as in the how-to, here are my errors :

[root@web01 xsp-1.1.13.7]# ./configure --prefix=/opt/mono
checking build system type... i686-pc-linux
checking host system type... i686-pc-linux
checking target system type... i686-pc-linux
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for a BSD-compatible install... /usr/bin/install -c
checking for pkg-config... /usr/bin/pkg-config
checking for csc... no
checking for mcs... /usr/bin/mcs
checking for gmcs... /usr/bin/gmcs
checking for mono... /usr/bin/mono
checking whether gmcs is actually able to compile...... no
C# compiler: /usr/bin/mcs
configure: creating ./config.status
config.status: creating Makefile
config.status: creating man/xsp.1
config.status: creating man/dbsessmgr.1
config.status: creating man/asp-state.1
config.status: creating man/Makefile
config.status: creating scripts/Makefile
config.status: creating src/Makefile
config.status: creating src/AssemblyInfo.cs
config.status: creating src/AssemblyInfoModMono.cs
config.status: creating src/Mono.WebServer/AssemblyInfo.cs
config.status: creating src/Mono.WebServer/AssemblyInfo2.cs
config.status: creating src/Mono.WebServer/Makefile
config.status: creating src/Mono.WebServer/xsp.pc
config.status: creating src/Mono.WebServer/xsp-2.pc
config.status: creating test/Makefile
config.status: creating test/1.1/Makefile
config.status: creating test/1.1/authtest/Makefile
config.status: creating test/1.1/asp.net/Makefile
config.status: creating test/1.1/webcontrols/Makefile
config.status: creating test/1.1/html/Makefile
config.status: creating test/1.1/webservice/Makefile
config.status: creating test/1.1/databind/Makefile
config.status: creating test/1.1/handlers/Makefile
config.status: creating test/1.1/customcontrol/Makefile
config.status: creating test/2.0/Makefile
config.status: creating test/2.0/menu/Makefile
config.status: creating test/2.0/treeview/Makefile
config.status: creating test/2.0/masterpages/Makefile
config.status: creating tools/Makefile
config.status: creating tools/asp_state/Makefile
config.status: creating tools/asp_state/AssemblyInfo.cs
config.status: creating tools/dbsessmgr/Makefile
config.status: creating tools/dbsessmgr/AssemblyInfo.cs
[root@web01 xsp-1.1.13.7]# make
Making all in man
make[1]: Entering directory `/usr/src/xsp-1.1.13.7/man'
cp xsp.1 mod-mono-server.1
make[1]: Leaving directory `/usr/src/xsp-1.1.13.7/man'
Making all in src
make[1]: Entering directory `/usr/src/xsp-1.1.13.7/src'
Making all in Mono.WebServer
make[2]: Entering directory `/usr/src/xsp-1.1.13.7/src/Mono.WebServer'
/usr/bin/mcs -debug+ -debug:full -nologo -unsafe -nowarn:618 -r:System.Web.dll -r:Mono.Security.dll /target:library /out:Mono.WebServer.dll ./ApplicationServer.cs ./BaseApplicationHost.cs ./BaseRequestBroker.cs ./IApplicationHost.cs ./InitialWorkerRequest.cs ./IWebSource.cs ./LingeringNetworkStream.cs ./MonoWorkerRequest.cs ./XSPApplicationHost.cs ./XSPWorkerRequest.cs ../../src/Mono.WebServer/AssemblyInfo.cs
error CS0006: Cannot find assembly `System.Web.dll'
Log:

Compilation failed: 1 error(s), 0 warnings
make[2]: *** [Mono.WebServer.dll] Error 1
make[2]: Leaving directory `/usr/src/xsp-1.1.13.7/src/Mono.WebServer'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/xsp-1.1.13.7/src'
make: *** [all-recursive] Error 1

the line : "checking whether gmcs is actually able to compile...... no" is not good, but I'm ghetting lost.
 
Hey,

if i install this on my server can the users use ASP applications than?

and is FreeBSD 4.11 supported?

Greets,
 
[Sun Mar 04 23:39:03 2007] [notice] child pid 23694 exit signal Segmentation fault (11)
[Sun Mar 04 23:39:03 2007] [notice] child pid 23695 exit signal Segmentation fault (11)
[Sun Mar 04 23:39:03 2007] [notice] child pid 23696 exit signal Segmentation fault (11)
[Sun Mar 04 23:39:03 2007] [notice] child pid 23697 exit signal Segmentation fault (11)
[Sun Mar 04 23:39:03 2007] [notice] child pid 23698 exit signal Segmentation fault (11)
[Sun Mar 04 23:39:03 2007] [notice] child pid 23699 exit signal Segmentation fault (11)
[Sun Mar 04 23:39:03 2007] [notice] child pid 23700 exit signal Segmentation fault (11)
[Sun Mar 04 23:39:03 2007] [notice] child pid 23701 exit signal Segmentation fault (11)
[Sun Mar 04 23:39:03 2007] [notice] child pid 23702 exit signal Segmentation fault (11)
[Sun Mar 04 23:39:03 2007] [notice] child pid 23703 exit signal Segmentation fault (11)

Server keeps segfaulting hehe
 
Last edited:
An easier way

Code:
 $ yum install mono* xsp*
Then install mod_mono
 
@Imtek - mono has their own yum repository. Click here:
http://www.mono-project.com/Downloads
Choose your distribution, on the next page should be a link to the .repo file - or at least there was for RHEL 4.

Notes on this install:
I installed through Yum. I could not get it to work with Apache 1.x, but once I upgraded to Apache 2 (using instructions found elsewhere on this forum) I was able to make it work. I also had to make some changes to my httpd.conf not mentioned here. The top of mod_mono.conf specifically says not to edit it because it could be overwritten (by upgrading through Yum, I suppose) so I made the necessary changes directly in /etc/httpd/conf/httpd.conf. Here's the relevant portion, I placed this directly below the other Alias lines as mentioned by vandal:

Code:
#mono settings
Alias /demo /usr/lib/xsp/test
MonoApplications "/demo:/usr/lib/xsp/test"
MonoServerPath /usr/lib/mono/1.0/mod-mono-server.exe
<Directory /usr/lib/xsp/test>
              SetHandler mono
</Directory>

You may have to adjust these based on where the files end up on your system. So far there does not seem to be a consensus across the various distros.

I gather that I'll have to update the httpd.conf to change the MonoApplications line and add another SetHandler line any time a client wants to use Mono apps in a new directory. That can probably be added through DA's control panel to their own domain's httpd.conf, making that somewhat easier, but can anyone offer a suggestion to make it easier? It would be great if clients could upload their ASP apps and it would "just work" the way that PHP apps do already.
 
Can someone please answer.

Will mod_mono run standard old .asp pages as well?
 
I have gone through all of the steps and successfully installed mod_mono, in addition to upgrading my Apache version to 2.0.59. The install for both went all the way through without errors. I also made the necessary changes to HTTPD.CONF as described by BlueNoteWeb.

I can see the demo pages fine.

Will ASP pages now work for any of the domains on my server, or do I have to make any further changes on a per-domain basis?

Thank you in advance!

-R
 
Compile

I get an error that there is no c# compiler..

[root@server xsp-1.2.4]# ./configure --prefix=/opt/mono
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for a BSD-compatible install... /usr/bin/install -c
checking for pkg-config... /usr/bin/pkg-config
checking if tracing is requested... no
checking for csc... no
checking for mcs... no
checking for gmcs... no
checking for mono... no
checking for gacutil... no
checking for sn... no
configure: error: No C# compiler found

How can i fix this?
 
no luck

Im trying to get this working.. Who could help me setup mono ASPx on Directadmin?
 
PHP:
yum install mono* xsp* mod_mono*

But when I add The reference from mod_mono to the httpd.conf file

It al goes wrong! :(
Yes asp.net/mono is installt, but my domains are redirecting to other files
 
Working, but....

I followed some of the How to with a little tweaking and got it working (sorry, the only tweaking I remember is downloading the latest installs and modifying the path so the compiles could find the C# compiler).

I had a customer that had a site already in asp that we loaded up. When I went to the index.asp page explicitly, it works just fine. But it didn't find the default document on it's own but rather threw a Forbidden, You don't have access to this directory error. I added index.asp to the DirectoryIndex directive and it displayed the contents of the file instead of processing it. I am looking now to see if I need to add something like a handler directive.

Another thing I did that worked right away was to rename index.asp to index.aspx.
 
Okay, noob question here... How do I get onto the terminal to the cmd line to even start the installation of mono?
 
You can only do this if you own the server. Do you own the server? Or are you buying hosting from someone?

If you own the server then you need root access through a shell program. If you don't know what this means you may not have the skillset necessary to risk making these kinds of changes to your server.

Jeff
 
Back
Top