How to Implement Mono and Asp.net running in CentOS 5.1

Source: Internet
Author: User

Download the compilation environment:
The 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 the mono environment:
Cd/root/mydir/mono-2.6.3
./Configure -- prefix =/opt/mono; 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 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 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-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 program that comes with xsp (multiple pages to check whether gdiplus. dll DllNotFoundException will appear ):
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

Reprinted please keep the link: How to Run Mono and Asp.net in CentOS 5.1

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.