CentOS 5.1 run down mono and asp.net implementation method sharing

Source: Internet
Author: User
Tags bz2 file system ftp centos iptables firewall

Download the compilation Environment:
Yum install GCC bison pkgconfig glib2-devel gettext make Httpd-devel gcc-c++ libstdc++-devel

Download and extract 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 find out "--with-apr-config=/usr/bin/apr-1-config" with the finding/-iname apr*config command (don't know--with-apr-config=/usr/bin/ Apr-1-config have what use, as if not also can, trouble know to tell the younger brother)
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 blocked httpd access to Mod-mono-server, so execute the following statement:
Setsebool-p Httpd_disable_trans=1

Restart the httpd server:
Service httpd Restart

Open port 80 in the firewall to allow access to other machines on the same LAN:
Method 1. To allow open 80 ports by shutting down the firewall without using a graphical interface tool
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 seen in Iptables-l
However, the server cannot be accessed from another machine.
If anyone succeeds, please tell the younger brother:

Method 2. In the case of installing a graphical interface tool, use STARTX to enter the graphical interface, with "security level and Firewall" to open 80 ports.

There are a lot of libgdiplus to install Libgdiplus (XSP test pages):
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, a dllnotfoundexception exception will appear.

Test:
First, 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

Second, test asp.net server
A. Testing whether ASPX can be performed:
Build a Test.aspx page in the/var/www/html/directory, which reads
<%= "Hello world!" %>
Download the contents of the page by Wget http://localhost/test.aspx.

B. Test whether other machines under the same LAN can access:
Open http://ip/test.aspx with another machine's browser

C. Run XSP test program (a few more pages to see if there will be a gdiplus.dll dllnotfoundexception):
1. Modify Apache configuration, open firewall 8080 port
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 directory to var/www/
3.service httpd restart
4. Open the http://ip:8080/with the browser

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

Reprint please keep the link : CentOS 5.1 running mono and ASP.net implementation method

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.