- 下载Nginx
wget http://nginx.org/download/nginx-1.13.12.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 安装C++编译环境,如已安装忽略此步
yum -y install gcc-c++开始安装Nginx
- 安装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
–prefix指定安装目录 –with-stream添加TCP模块
tar zxvf nginx-1.10.2.tar.gz
cd nginx-1.10.2
./configure --prefix=/usr/local/webserver/nginx --with-stream
make && make install
- 启动Nginx
cd /usr/local/nginx/sbin
检查配置文件是否正确
./nginx -t
启动
./nginx