nginx的安装与配置
一、安装编译工具及库文件
[root@mfComputer ~]# yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel
安装PCRE(作用是让Nginx支持重写功能)
[root@mfComputer software]# wget http://downloads.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz
[root@mfComputer local]#tar zxvf /root/software/pcre-8.35.tar.gz
编译安装
[root@mfComputer pcre-8.35]# ./configure
[root@mfComputer local]# make && make install
检验是否安装成功
[root@mfComputer local]# pcre-config --version
二、安装Nginx
[root@mfComputer software]# wget http://nginx.org/download/nginx-1.6.2.tar.gz
解压安装包
[root@mfComputer local]# tar -zxvf nginx-1.6.2.tar.gz
编译安装
[root@mfComputer nginx-1.6.2]# ./configure --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/usr/local/pcre-8.35
[root@mfComputer nginx-1.6.2]# make
[root@mfComputer nginx-1.6.2]# make install
查看版本
[root@mfComputer nginx-1.6.2]# /usr/local/webserver/nginx/sbin/nginx -v
启动Nginx
[root@mfComputer nginx]# cd /usr/local/webserver/nginx/sbin/nginx
关闭Nginx
[root@mfComputer nginx]# cd /usr/local/webserver/nginx/sbin/nginx