Download the compilation environment:
The yum install GCC bison pkgconfig glib2-devel gettext make httpd-devel gcc-C ++ libstdc ++-devel
Download and decompressSource code:
Wget http://ftp.novell.com/pub/mono/sources/mono/mono-2.6.3.tar.bz2
Wget http://ftp.novell.com/pub/mono/sources/mod_mono/mod_mono-2.6.3.tar.bz2
Wget http://ftp.novell.com/pub/mono/sources/xsp/xsp-2.6.3.tar.bz2
Tar-jxvf mono-2.6.3.tar.bz2
Tar-jxvf xsp-2.6.3.tar.bz2
Tar-jxvf mod_mono-2.6.3.tar.bz2
Install the mono environment:
CD/root/mydir/mono-2.6.3
./Configure -- prefix =/opt/MONO; Make; make install
Echo export pkg_config_path =/opt/MONO/lib/pkgconfig: $ pkg_config_path> ~ /. Bash_profile
Echo export Path =/opt/MONO/bin: $ PATH >> ~ /. Bash_profile
Source ~ /. Bash_profile
Install xsp:
CD/root/mydir/xsp-2.6.3
./Configure -- prefix =/opt/MONO; Make; make install
Install mod_mono:
First use the find/-iname apr * config command to find the "-- with-Apr-Config =/usr/bin/apr-1-config" (do not know -- With-Apr-Config =/usr/bin /What is the use of apr-1-config, I don't seem to be able to do that either. Please tell me if you know it)
Run the following command:
CD/root/mydir/mod_mono-2.6.3
./Configure -- prefix =/opt/MONO -- With-mono-Prefix =/opt/MONO -- With-Apr-Config =/usr/bin/apr-1-config; Make; make install
CP/etc/httpd/CONF. d/etc/httpd/CONF/mod_mono.conf
SELinux blocks HTTPD Access to mod-mono-server, so execute the following statement:
Setsebool-P httpd_disable_trans = 1
Restart the httpd server:
Service httpd restart
Enable port 80 in the firewall to allow access from other machines on the same LAN:
Method 1. Disable the firewall to allow port 80 to be opened without using graphical interface tools.
Service iptables stop
(PS: I tried the following method,
VI/etc/sysconfig/iptables
Add:-A RH-Firewall-1-INPUT-M state -- state new-m tcp-p tcp -- dport 80-J accept
Service iptables restart
Although HTTP is displayed in iptables-l
However, the server cannot be accessed from other machines.
If anyone succeeds, please inform the younger brother ):
Method 2. When a graphical interface tool is installed, use startx to enter the graphic interface and enable port 80 with "security level and firewall.
Install libgdiplus ):
Yum install httpd build-essential GCC bzip bison pkgconfig glib-devel \
Glib2-devel httpd-devel libpng-devel libX11-devel FreeType fontconfig \
Pango-devel Ruby ruby-rdoc gtkhtml38-devel wget
Wget http://ftp.novell.com/pub/mono/sources/libgdiplus/libgdiplus-2.6.2.tar.bz2
Tar-jxvf libgdiplus-2.6.2.tar.bz2
CD/root/mydir/libgdiplus-2.6.2
./Configure
Make; make install
Echo export LD_LIBRARY_PATH =/usr/local/lib/: $ LD_LIBRARY_PATH> ~ /. Bash_profile
Source ~ /. Bash_profile
VI/opt/MONO/etc/MONO/config
Add a node: <dllmap DLL = "gdiplus. dll" target = "/usr/lib/libgdiplus. so.0"/>
Otherwise, the exception of dllnotfoundexception may occur.
Test:
I. Test mono
A. Run mono-V output:
Mono JIT compiler version 2.6.3 (tarball Fri APR 2 06:13:46 CST 2010)
Copyright (c) 2002-2010 Novell, INC and contributors. http://www.mono-project.com/
TLS: _ thread
GC: encoded ded Boehm (with typed GC and parallel mark)
SIGSEGV: altstack
Specifications: epoll
Architecture: x86
Disabled: None
B. Run mono-test-install and output:
Active Mono:/opt/MONO/bin/mono
Your have a working system. Drawing setup
Your file system watcher is: system. Io. inotifywatcher
Ii. Test the ASP. NET Server
A. Test whether aspx can be executed:
Create a test. ASPX page under the/var/www/html/directory with the content
<% = "Hello world! "%>
Download the content of this page through wget http: // localhost/test. aspx.
B. Test whether other machines can access the same LAN:
Open http: // ip/test. aspx in the browser of another machine
C. Run the test provided by xspProgram(Check whether gdiplus. dll dllnotfoundexception is displayed on several pages ):
1. Modify Apache configuration and open firewall port 8080
Listen 8080.
Namevirtualhost*: 8080
<Virtualhost *: 8080>
Serveradmin hlfstephen@gmail.com
DocumentRoot/var/www/test/
Servername local.mydomain.com
Errorlog logs/local.mydomain.com-error_log
Customlog logs/local.mydomain.com common
</Virtualhost>
2. Copy the/opt/MONO/lib/xsp/test directory to var/www /.
3. Service httpd restart
4. Open http: // ip: 8080/in a browser/
Refer:
Http://blog.rubypdf.com/2009/10/23/how-to-install-mono-2-4-2-3-on-centos-5/
Http://blog.rubypdf.com/2009/10/23/how-to-install-xsp-and-integrate-xsp-with-apache-2-under-centos-5/
Http://blog.bennyland.com/2010/02/06/serving-asp-net-pages-in-apache-on-centos-5/
Http://mingster.com/site? Q = content/mono-2x-centos-5
Http://mono-project.com/DllNotFoundException
Http://mono-project.com/Config_DllMap