CentOS 5.1 rundown Mono and Asp.net implementation method sharing

  • 2020-05-06 12:03:20
  • OfStack

Download the compilation environment:
yum install gcc bison pkgconfig glib2-devel gettext make httpd-devel gcc-c++ libstdc++-devel

Download and unzip the source 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 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 command find / -iname apr*config to find out "-- with-apr-config =/usr/bin/ apr-1-config" (I don't know -- with-apr-config =/usr/bin/ apr-1-config) Then execute 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 prevents httpd from accessing mod-mono-server, so execute the following statement:
setsebool -P httpd_disable_trans=1

Restart httpd server:
service httpd restart

Open port 80 in the firewall to allow access to other machines in the same Lan:
Method 1. Allow port 80
to be opened by turning off the firewall when not using GUI tools service iptables stop
(PS: I tried the following method,
vi /etc/sysconfig/iptables
Add: -A RH-Firewall-1-INPUT-m state service iptables restart
Although http
is seen in iptables-L The server cannot be accessed from another machine.
If anyone succeeds, please let me know

Method 2. With the GUI tool installed, enter the GUI with startx and open port 80 with "Security Level and Firewall".

Install libgdiplus(many of the test pages for xsp require 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 node: < dllmap dll="gdiplus.dll" target="/usr/lib/libgdiplus.so.0" / >
Otherwise, an DllNotFoundException exception will 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: Included Boehm (with typed GC and Parallel Mark)
SIGSEGV: altstack
Notifications: epoll
Architecture: x86
Disabled: none
b. Run mono-test-install output:
Active Mono: /opt/mono/bin/mono
Your have a working System.Drawing setup
Your file system watcher is: System.IO.InotifyWatcher

Test Asp.Net server
a. Test whether aspx:
can be executed In/var www html/directory built a test aspx page, content is
< %="Hello World!"% >
Through wget http: / / localhost test aspx to download the page content.

b. Test whether the same Lan can be accessed by other machines:
Use other machines browser open http: / / ip/test aspx

c. Run xsp's own test program (a few more pages to see if gdiplus.dll DllNotFoundException) :
1. Modify the configuration of Apache and open port
of firewall 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/opt/mono/lib/xsp/test
under the var www / 3.service httpd restart
4. Use the browser open http: / / ip: 8080 /

Reference:
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

CentOS 5.1 runs down Mono and Asp.net implementation method


Related articles: