安装与部署
# package下载
$ wget http://nginx.org/download/nginx-1.10.2.tar.gz
$ wget http://www.openssl.org/source/openssl-fips-2.0.10.tar.gz
$ wget http://zlib.net/zlib-1.2.11.tar.gz
$ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.40.tar.gz
# gcc安装
$ yum install gcc-c++
# openssl安装
$ tar zxvf openssl-fips-2.0.10.tar.gz
$ cd openssl-fips-2.0.10
$ ./config && make && make install
# pcre安装
$ tar zxvf pcre-8.40.tar.gz
$ cd pcre-8.40
$ ./configure && make && make install
# zlib安装
$ tar zxvf zlib-1.2.11.tar.gz
$ cd zlib-1.2.11
$ ./configure && make && make install
# nginx安装
$ tar zxvf nginx-1.10.2.tar.gz
$ cd nginx-1.10.2
$ ./configure && make && make install
启动与校验
# 建立libpcre软链接
$ whereis libpcre.so.1
$ ln -s /usr/local/lib/libpcre.so.1 /lib64
# 启动nginx服务
$ sbin/nginx
# 查看启动状态
$ ps -aux | grep nginx
nginx命令
# 配置文件路径
$ vi /usr/local/nginx/conf/nginx.conf
# 启动
$ /usr/local/nginx/sbin/nginx
# 停止
$ /usr/local/nginx/sbin/nginx -s stop
# 重启
$ /usr/local/nginx/sbin/nginx -s reload