安装步骤:

一、获取开源相关程序:

1、利用CentOS Linux系统自带的yum命令安装、升级所需的程序库:

1
sudo
-sLANG=Cyum -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

2、下载程序源码包:

Nginx安装包:下载地址:http://nginx.org/en/download.html

1
mkdir
-p
/downcd
/downwget
http:
//nginx
.org
/download/nginx-1
.1.11.
tar
.gz

Mono下载:官网:http://download.mono-project.com/sources/mono/(请下载最新版)

1
wget http:
//download
.mono-project.com
/sources/mono/mono-2
.10.7.
tar
.bz2

libgdiplus下载:http://download.mono-project.com/sources/libgdiplus/(请下载最新版)

1
wget http:
//download
.mono-project.com
/sources/libgdiplus/libgdiplus-2
.10.
tar
.bz2

xsp下载:http://download.mono-project.com/sources/xsp/(请下载最新版)

1
wget http:
//download
.mono-project.com
/sources/xsp/xsp-2
.10.2.
tar
.bz2

pcre下载(Nginx所需的pcre库):ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/(请下最新版)

1
wget
ftp
:
//ftp
.csx.cam.ac.uk
/pub/software/programming/pcre/pcre-8
.21.
tar
.gz

二、安装编译Nginx:

1、安装安装Nginx所需的pcre库:

1
cd
/downtar
zxvf pcre-8.21.
tar
.gzcd pcre-8.21/.
/configuremake
&&
make
installcd ../

2、创建www用户和组

1
/usr/sbin/groupadd
www
/usr/sbin/useradd
-g www wwwmkdir -p
/data0/webchmod
+w
/data0/webchown
-R www:www
/data0/web

3、安装Nginx

1
tar
zxvf nginx-1.1.11.
tar
.gzcd nginx-1.1.11/.
/configure
--user=www --group=www --prefix=
/opt/nginx
--with-http_stub_status_module --with-http_ssl_modulemake &&
make
installcd ../

4、开放80端口:

1
iptables -I INPUT -p tcp --dport 80 -j ACCEPT启动nginx
/opt/nginx/sbin/nginx

在浏览器上输入访问地址 http://192.168.1.1(根据个人本机地址页定),正常会看到默认nginx页面

三、安装编译Mono

1、安装libgdiplus:

1
cd
/downtar
-jxvf libgdiplus-2.10.
tar
.bz2cd libgdiplus-2.10.
/configure
--prefix=
/opt/mono
make
&&
make
installecho
"/opt/mono/lib"
>
/etc/ld
.so.conf.d
/mono
.confldconfig

2、安装Mono:

1
tar
–jxvf mono-2.10.7.
tar
.bz2cd mono-2.10.7.
/configure
--prefix=
/opt/monomake
&&
make
install
//
此处时间较长
echo
export
PKG_CONFIG_PATH=
/opt/mono/lib/pkgconfig
:$PKG_CONFIG_PATH>>~/.bash_profileecho
export
LD_LIBRARY_PATH=
/opt/mono/lib
:$LD_LIBRARY_PATH>>~/.bash_profileecho
export
PATH=
/opt/mono/bin
:$PATH>>~/.bash_profilesource ~/.bash_profile

输入 mono -V 如有mono版本信息,则安装成功.

发表评论

邮箱地址不会被公开。 必填项已用*标注