首页 > 代码库 > CentOS安装Nginx

CentOS安装Nginx

一、安装编译工具及库文件

yum -y install make zlib zlib-devel gcc-c++ libtool  openssl openssl-devel

二、首先要安装 PCRE
PCRE 作用是让 Ngnix 支持 Rewrite 功能。
1、下载 PCRE 安装包,下载地址: http://downloads.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz

# wget http://downloads.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz
#tar zxvf pcre-8.35.tar.gz
#cd pcre-8.35
#./configure
#make && make install
#pcre-config --version

三、安装nginx

1、下载

wget http://nginx.org/download/nginx-1.10.1.tar.gz

2、#tar -zxf nginx-1.10.1.tar.gz

#cd nginx-1.10.1

#./configure --prefix=/usr/local/nginx--with-http_stub_status_module --with-http_ssl_module --with-file-aio --with-http_realip_module --with-pcre=/root/soft/pcre-8.35

#make && make install

四、php安装

#wget http://cn2.php.net/distributions/php-5.6.26.tar.gz

#tar -zxf php-5.6.26.tar.gz

#cd php-5.6.26

#./configure --prefix=/usr/local/php  --enable-fpm --with-mcrypt --enable-mbstring --disable-pdo --with-curl --disable-debug  --disable-rpath --enable-inline-optimization --with-bz2  --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --with-mhash --enable-zip --with-pcre-regex --with-mysql --with-mysqli --with-gd --with-jpeg-dir

#make && make install

CentOS安装Nginx