centos 6.5 mono + asp.net 配置
####首先关闭
由于CentOS自带的SELinux的原因,使得Apache无法连接到mod-mono-server,所以我们现在还需要配置SELinux。当然,这里为了简单就仅仅禁用SELinux,有兴趣的可以自己创建安全策略,使mod-mono-server可以生效。这里修改/etc/sysconfig/selinux文件。将“SELINUX=enforcing”修改为“SELINUX=permissive”或“SELINUX=disabled”,例如下图,保存重启系统即可。
centos 6.5 mono + asp.net 配置
yum update
yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel bison pkgconfig glib2-devel gettext make
cd /home
mkdir -p down
cd down
wget http://nginx.org/download/nginx-1.6.1.tar.gz
wget http://download.mono-project.com/sources/mono/mono-3.6.0.tar.bz2
wget http://download.mono-project.com/sources/libgdiplus/libgdiplus-2.10.9.tar.bz2
wget http://download.mono-project.com/sources/xsp/xsp-2.10.2.tar.bz2
yum install pcre-devel
yum install pcre-static
/usr/sbin/groupadd www
/usr/sbin/useradd -g www www
mkdir /home/web
mkdir -p /home/web
chmod +w /home/web
chown -R www:www /home/web
#####使用 nginx
tar zxvf nginx-1.6.1.tar.gz
cd nginx-1.6.1
yum install openssl-devel
./configure --user=www --group=www --prefix=/opt/nginx --with-http_stub_status_module --with-http_ssl_module
make && make install
cd ../
iptables -I INPUT -p tcp --dport 80 -j ACCEPT
/opt/nginx/sbin/nginx
#####安装 mono 组件
tar -jxvf libgdiplus-2.10.9.tar.bz2
cd libgdiplus-2.10.9
yum install libX11-devel
yum install cairo-devel
./configure --prefix=/opt/mono
make && make install
cd ..
tar -jxvf mono-3.6.0.tar.bz2
cd mono-3.6.0
./configure --prefix=/opt/mono
make && make install
echo export PKG_CONFIG_PATH=/opt/mono/lib/pkgconfig:$PKG_CONFIG_PATH>>~/.bash_profile
echo export LD_LIBRARY_PATH=/opt/mono/lib:$LD_LIBRARY_PATH>>~/.bash_profile
echo export PATH=/opt/mono/bin:$PATH>>~/.bash_profile
source ~/.bash_profile
mono -V
###安装 xsp
cd /home/down
tar -jxvf xsp-2.10.2.tar.bz2
cd xsp-2.10.2
./configure --prefix=/opt/mono
make && make install
fastcgi-mono-server2 /applications=/:/home/web /socket=tcp:127.0.0.1:9000 &
#fastcgi-mono-server4 /applications=/:/home/web /socket=tcp:127.0.0.1:9000 &
4.0 .net framework 出错不知道为什么
########使用apache mod_mono ##########
cd /home/down
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
configure: error: **** apxs was not found, DSO compilation will not be available.
yum install httpd
yum search apxs
yum install httpd-devel
./configure --prefix=/opt/mono
make && make install