nginx之安装过程

1.安装make

yum -y install gcc automake autoconf libtool make

2.安装gcc

yum install gcc gcc-c++

3.安装PCRE库

https://ftp.pcre.org/pub/pcre/ 下载最新的 PCRE 源码包,使用下面命令下载编译和安装 PCRE 包:

cd /usr/local/src/

wget https://nchc.dl.sourceforge.net/project/pcre/pcre/8.44/pcre-8.44.tar.gz

tar -zxvf pcre2-10.36.tar.gz

cd pcre2-10.36

./configure

make && make install

4.安装zlib库

http://zlib.net/zlib-1.2.11.tar.gz 下载最新的 zlib 源码包,使用下面命令下载编译和安装 zlib包:

​cd /usr/local/src/

wget http://zlib.net/zlib-1.2.11.tar.gz

tar -zxvf zlib-1.2.11.tar.gz

cd zlib-1.2.11

编译安装 

./configure

make && make install

查看pcre版本

pcre-config --version

5.安装ssl

​cd /usr/local/src

wget https://www.openssl.org/source/openssl-fips-2.0.16.tar.gz

tar -zxvf openssl-fips-2.0.16.tar.gz

./config

make && make install

6.安装nginx

​cd /usr/local/src

wget http://nginx.org/download/nginx-1.18.0.tar.gz

tar -zxvf nginx-1.18.0.tar.gz

cd /nginx-1.18.0

./configure --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/usr/local/src/pcre-8.44

7.nginx常用命令

./nginx -t # 验证配置文件是否能正常启动 

./nginx #启动nginx 

./nginx -s quit #正常停止 

./nginx -s stop #快速停止 

./nginx -s reload #重新加载 

./nginx -v #查看版本信息

猜你喜欢

转载自blog.csdn.net/zsx_xiaoxin/article/details/122240083