Download version: http://blog.chinaunix.net/uid-20682147-id-3453384.html
Mono-3.0.2 Installation Guide
See 2012/12/27
Directory
1. Preface 1
1.1. What is mono? 1
1.2. Objective 1
2. Download URL 1
3. Dependency 2
4. Installation Step 2
4.1. Mono 2
4.2. xsp 2
4.3. mod_mono 2
5. Modify httpd. conf 3 of Apache
6. Appendix 1: one-click script 4
6.1 one-click script prerequisite 4
6.2. Full text of one-click script 4
7. Appendix 2: mod_mono.diff 6
1. Preface 1.1. What is mono?
Mono is an open-source Project hosted by Novell to create. Net on Linux, FreeBSD, Mac OS X, and Solaris.
1.2. Purpose
This document attempts to clarify the installation of mono-3.0.2 in the simplest way. Mono uses the automake compilation method, including the libraries it depends on. Because of this dependency, the compilation and installation process is slightly complicated.
2. Download URL
Download URLs for mono, xsp, and mod_mono are:
Http://download.mono-project.com/sources/
3. Dependency
1) Mono is not dependent;
2) XPS depends on Mono;
3) The installation of mod_mono depends on Apache. For more information about Apache installation, see the apache2.4 Installation Guide.
4. Installation Steps 4.1. Mono
1)./configure -- prefix =/usr/local/MONO (Note: Install mono in the/usr/local/MONO directory)
2) Make
3) make install
4.2. xsp
Note the following steps for installing XPS:
1) Export Path =/usr/local/MONO/bin: $ PATH (commands such as DMCS and GMCs provided by mono are required)
2) Export pkg_config_path =/usr/local/MONO/lib/pkgconfig: $ pkg_config_path (xsp depends on Mono)
3) Sed-I-e's! Test !! 'Makefile. Am (do not compile test, because test may fail to compile)
4)./configure -- prefix = $ xsp_home -- disable-Docs (the document is not compiled, reducing the probability of errors)
5) make
6) make install
4.3. mod_mono
For the mod_mono-2.10 version, if it depends on apache2.4, You need to modify mod_mono.c before compilation can pass, to modify the places see "Appendix 2: mod_mono.diff ". For apache2.2, no modifications are required.
1 ). /configure -- prefix =/usr/local/mod_mono -- With-apxs =/usr/local/httpd/bin/apxs (assuming that Apache is installed in the/usr/local/httpd directory))
2) Make
3) make install
5. Modify httpd. conf of Apache
After Mono is successfully installed, You need to modify the httpd. conf file of Apache. The modification points include:
1) Add: Include/usr/local/httpd/CONF/mod_mono.conf
2) Add the following content (this part needs to be modified according to the actual situation ):
<Virtualhost *: 80>
Servername mono.com
Serveralias mono.com
Serveradmin web-admin@mono.com
DocumentRoot/usr/local/xsp/lib/xsp/test
# Monoserverpath can be changed to specify which version of ASP. NET is hosted
# Mod-mono-server1 = ASP. NET 1.1/mod-mono-server2 = ASP. NET 2.0
# For SuSE Linux Enterprise mono extension, uncomment the line below:
# Monoserverpath mono.com "/opt/Novell/MONO/bin/mod-mono-server2"
# For mono on opensuse, uncomment the line below instead:
Monoserverpath mono.com "/usr/local/xsp/bin/mod-mono-server4"
# To obtain line numbers in stack traces you need to do two things:
#1) enable debug code generation in your page by using the DEBUG = "true"
# Page directive, or by setting <compilation DEBUG = "true"/> in
# Application's web. config
#2) uncomment the monodebug true directive below to enable mod_mono debugging
Monodebug mono.com true
# The mono_iomap environment variable can be configured to provide platform into action
# For file access in Linux. Valid values for mono_iomap are:
# Case
# Drive
# All
# Uncomment the line below to alter file access behavior for the configured Application
Monosetenv mono.com mono_iomap = all
#
# Additional environtment variables can be set for this server instance using
# The monosetenv directive. monosetenv takes a string of 'name = value' Pairs
# Separated by semicolons. For instance, to enable platform into action * and *
# Use mono's old regular expression interpreter (which is slower, but has
# Shorter setup time), uncomment the line below instead:
# Monosetenv mono.com mono_iomap = All; mono_old_rx = 1
Monoapplications mono.com "/:/usr/local/xsp/lib/xsp/test"
<Location "/">
Allow from all
Order allow, deny
Monosetserveralias mono.com
Sethandler mono
Setoutputfilter deflate
Setenvifnocase request_uri "\.(? : GIF | jpe? G | PNG) $ "no-gzip dont-vary
</Location>
<Ifmodule mod_deflate.c>
Addoutputfilterbytype deflate text/HTML text/plain text/XML text/JavaScript
</Ifmodule>
</Virtualhost>
6. Appendix 1: one-click script 6.1. one-click script prerequisite
1) Use the root user;
2) install Apache in the/usr/local/httpd directory;
3) The mono, XPS, and mod_mono installation packages are all placed in the same directory, for example:
~ /APP # ls
Mod_mono-2.10.tar.bz2 mono-3.0.2.tar.bz2 xsp-2.10.2.tar.bz2
4) for apache2.4, you also need to put the mod_mono.diff file and the installation package in the same directory.
6.2. Full text of one-click script
#! /Bin/sh
# Writed by yijian on 2012/12/27
# A key to install mono on Linux
Export apache_home =/usr/local/httpd
Export mono_home =/usr/local/mono
Export xsp_home =/usr/local/xsp
Export mod_mono_home =/usr/local/mod_mono
Mono = 'basename mono-* .tar.bz2 .tar.bz2'
Xsp = 'basename xsp-* .tar.bz2 .tar.bz2'
Mod_mono = 'basename mod_mono-* .tar.bz2 .tar.bz2'
Basedir = 'pwd'
Apache_version = '$ apache_home/bin/httpd-v | awk-F "[/.]"'/Server version/{print $5 }''
Echo "Apache version: $ apache_version"
# Compile & Install mono
Echo "Tar xjf unzip mono.tar.bz2"
CD $ basedir
# Tar xjf unzip mono.tar.bz2
CD $ basedir/$ mono
#./Configure -- prefix = $ mono_home
# If test $? -Ne 0; then
# Exit 1
# Fi
# Make
# Make install
# Compile & Install xsp
Export Path = $ mono_home/bin: $ path
Export pkg_config_path = $ mono_home/lib/pkgconfig: $ pkg_config_path
CD $ basedir
Tar xjf release xsp.tar.bz2
CD $ basedir/$ xsp
Sed-I-e's! Test !! 'Makefile. AM
./Configure -- prefix = $ xsp_home -- disable-docs
If test $? -Ne 0; then
Exit 1
Fi
Make
If test $? -Ne 0; then
Exit 1
Fi
Make install
If test $? -Ne 0; then
Exit 1
Fi
# Compile & Install mod_mono
CD $ basedir
Tar xjf $mod_mono.tar.bz2
If test $ apache_version-GT 2; then
If test-F./mod_mono.diff; then
Echo "CP./mod_mono.diff $ mod_mono/src /"
CP./mod_mono.diff $ mod_mono/src/
If test $? -Ne 0; then
Exit 1
Fi
Fi
Fi
CD $ basedir/$ mod_mono/src
If test-F./mod_mono.diff; then
Echo "patch mod_mono.c mod_mono.diff"
Patch mod_mono.c mod_mono.diff
Fi
CD $ basedir/$ mod_mono
./Configure -- prefix = $ mod_mono_home -- With-apxs = $ apache_home/bin/apxs
If test $? -Ne 0; then
Exit 1
Fi
Make
If test $? -Ne 0; then
Exit 1
Fi
Make install
If test $? -Ne 0; then
Exit 1
Fi
CD $ basedir
Echo "finished! "
Exit 0
7. Appendix 2: mod_mono.diff
389c389
<Return unixd_config.user_id;
---
> Return ap_unixd_config.user_id;
399c399
<Return unixd_config.group_id;
---
> Return ap_unixd_config.group_id;
409c409
<Return unixd_config.user_name;
---
> Return ap_unixd_config.user_name;
488c488
<Rv = unixd_set_global_mutex_perms (xsp-> dashboard_mutex );
---
> Rv = ap_unixd_set_global_mutex_perms (xsp-> dashboard_mutex );
850,857 c850
<# If defined (apache22)
<Return C-> remote_addr-> port;
<# Else
<Apr_port_t port;
<Apr_sockaddr_port_get (& Port, C-> remote_addr );
<Return port;
<# Endif
<
---
> Return C-> client_addr-> port;
863d855
<# If defined (apache22)
865,869 d856
<# Else
<Apr_port_t port;
<Apr_sockaddr_port_get (& Port, R-> connection-> local_addr );
<Return port;
<# Endif
1981c1968
<Info. remote_ip_len = strlen (R-> connection-> remote_ip );
---
> Info. remote_ip_len = strlen (R-> connection-> client_ip );
2029c2016
<PTR + = write_string_to_buffer (PTR, 0, R-> connection-> remote_ip, info. remote_ip_len );
---
> PTR + = write_string_to_buffer (PTR, 0, R-> connection-> client_ip, info. remote_ip_len );