这次选择了从源代码安装。
准备
1. CentOS 6.0
2. 从http://ftp.novell.com/pub/mono/sources-stable/下载的mono 2.10.2版本的源代码
3. 关闭了selinux
预装包
yum install gcc gcc-c++ bison pkgconfig glib2-devel libpng-devel libjpeg-devel libtiff-devel giflib-devel libX11-devel freetype-devel fontconfig-devel libexif-devel cairo-devel httpd-devel
安装
解压并安装Mono:
libgdiplus-2.10.tar.bz2
mono-2.10.2.tar.bz2
配置Mono路径:
vi ~/.bash_profile
PKG_CONFIG_PATH=/opt/mono/lib/pkgconfig:$PKG_CONFIG_PATH
export PKG_CONFIG_PATH
PATH=$PATH:/opt/mono/bin
export PATH
LD_LIBRARY_PATH=/opt/mono/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
(mono -V 可以显示版本信息,说明mono安装成功)
解压并安装xsp和mod mono:
xsp-2.10.2.tar.bz2
mod_mono-2.10.tar.bz2
Mod mono配置:
cp /etc/httpd/conf/mod_mono.conf /etc/httpd/conf.d/mod_mono.conf
在conf中加入如下配置
MonoServerPath /opt/mono/bin/mod-mono-server4
Done! 拷贝ASP.Net项目到www/html目录,aspx文件可以访问了。