1. 安装pcre库
cd /usr/local
tar -zxvf pcre-8.35.tar.gz
cd pcre-8.35.tar.gz
./configure
make
make install
pcre下载路径
安装pcre 出现错误
configure: error: You need a C++ compiler for C++ support.
apt-get install g++
2. 安装zlib库
cd /usr/local
tar -zxvf zlib-1.2.8.tar.gz
cd zlib-1.2.8
./configure
make
make install
3. 安装ssl
cd /usr/local
tar -zxvf openssl-1.0.1l.tar.gz
cd openssl-1.0.1l
./config
make
make install
4. 安装nginx
cd /usr/local
tar -zxvf nginx-1.7.8.tar.gz
cd nginx-1.7.8
./confiure —prefix=/usr/local/nginx
make
make install
启动
/usr/local/nginx/sbin/nginx
检查启动
netstat -ano | grep 80
打开浏览器,输入本机IP访问
重启
/usr/local/nginx/sbin/ngnix -s reload
修改配置文件
cd /usr/local/nginx/conf
vi nginx.conf