CentOS 5.5 安裝 MONO 2.10.6

來源:互聯網
上載者:User

說明:本篇文章參考CentOS 6.0 安裝 MONO 2.10.6 一文,結合自己實際安裝後遇到的一些問題,對原文進行了一些mark。

1.更新系統   

yum update

2.安裝必要的相關庫   

yum install gcc gcc-c++ bison pkgconfig glib2-devel gettext make libpng-devel libjpeg-devel libtiff-devel libexif-devel giflib-devel libX11-devel freetype-devel fontconfig-devel  cairo-devel httpd httpd-devel

3.升級sqlite(安裝mono xsp-2.10時需要sqlite3.5以上版本)

wget -c http://dl.atrpms.net/el5-i386/atrpms/testing/sqlite-3.6.20-1.el5.i386.rpm

rpm -Uvh sqlite-3.6.20-1.el5.i386.rpm

4.安裝 libgdiplus

cd /usr/local/src/

wget http://download.mono-project.com/sources/libgdiplus/libgdiplus-2.10.tar.bz2

tar -jxvf libgdiplus-2.10.tar.bz2

cd libgdiplus-2.10

./configure --prefix=/opt/mono

make

make install

echo "/opt/mono/lib" > /etc/ld.so.conf.d/mono.conf

ldconfig

5.安裝 mono  

cd /usr/local/src/

wget http://download.mono-project.com/sources/mono/mono-2.10.6.tar.bz2

tar -jxvf mono-2.10.6.tar.bz2

cd mono-2.10.6

./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

輸入 mono -V 如有mono版本資訊,則安裝成功. 

6.安裝mono xsp-2.10

cd /usr/local/src/ 

wget http://download.mono-project.com/sources/xsp/xsp-2.10.tar.bz2

tar jxvf xsp-2.10.tar.bz2

cd xsp-2.10

./configure -prefix=/opt/mono

make

make install

7.安裝mod_mono-2.10

cd /usr/local/src/ 

wget http://download.mono-project.com/sources/mod_mono/mod_mono-2.10.tar.bz2

tar jxvf mod_mono-2.10.tar.bz2

cd mod_mono-2.10

./configure -prefix=/opt/mono

make; 

make install

注意:安裝完mod_mono模組之後,設定檔mod_mono.conf 預設會被拷貝到/etc/httpd/conf/ 目錄下,但是由於apache預設只會載入/etc/httpd/conf.d/目錄下的配置,這就需要將mod_mono.conf 移到/etc/httpd/conf.d/目錄下。

mv /etc/httpd/conf/mod_mono.conf  /etc/httpd/conf.d/mod_mono.conf

測試能否運行aspx,由於mono xsp內建了一個demo,位於opt/mono/lib/xsp/test目錄下,我們就依此為例。

修改mod_mono.conf

vi /etc/httpd/conf.d/mod_mono.conf

在檔案末尾加上以下幾行:

Alias /demo "/opt/mono/lib/xsp/test"
MonoApplications "/demo:/opt/mono/lib/xsp/test"
MonoServerPath /opt/mono/bin/mod-mono-server2
<Location /demo>
SetHandler mono
</Location>

重啟apache

service httpd restart

在瀏覽器輸入:http://localhost/demo/

若出現 Welcome to Mono XSP! 提示資訊說明成功。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.