一、准备安装包
百度网盘链接:下载
二、安装c++编译环境
yum install gcc-c++
注:已安装可跳过
三、安装nginx
1、安装openssl
[root@localhost src]# tar zxvf openssl-fips-2.0.10.tar.gz
[root@localhost src]# cd openssl-fips-2.0.10
[root@localhost src]# ./config && make && make install
2、安装pcre
[root@localhost src]# tar zxvf pcre-8.40.tar.gz
[root@localhost src]# cd pcre-8.40
[root@localhost src]# ./configure && make && make install
3、安装zlib
[root@localhost src]# tar zxvf zlib-1.2.11.tar.gz
[root@localhost src]# cd zlib-1.2.11
[root@localhost src]# ./configure && make && make install
4、安装nginx
[root@localhost src]# tar zxvf nginx-1.10.2.tar.gz
[root@localhost src]# cd nginx-1.10.2
[root@localhost src]# ./configure && make && make install
四、运行nginx
找到sbin下边的nginx运行即可,命令如下:
启动:sbin/nginx
重启:sbin/nginx -s reload
关闭:sbin/nginx -s stop