Nginx安装部署手册

 

1、准备离线安装包

  • openssl-fips-2.0.10.tar.gz
  • pcre-8.40.tar.gz
  • zlib-1.2.11.tar.gz
  • nginx-1.19.0.tar.gz

2、上传并解压离线包

(1)将离线包上传至服务器,如/data/tools目录

(2)解压离线包

  • cd /data/toos
  • tar -zxvf nginx-1.19.0.tar.gz
  • tar -zxvf openssl-fips-2.0.10.tar.gz
  • tar -zxvf zlib-1.2.11.tar.gz
  • tar -zxvf nginx-1.19.0.tar.gz

3、安装gcc-c++环境

(1)监测gcc-c++环境是否已安装

yum list gcc-c++

如图表示已安装

(2)安装gcc-c++

yum install -y gcc-c++

4、安装nginx依赖组件

(1)openssl 安装

cd /data/tools/openssl-fips-2.0.10
./config && make && make install

(2)pcre 安装

cd /data/tools/pcre-8.40
./configure && make && make install

(3)zlib 安装

cd /data/tools/zlib-1.2.11
./configure && make && make install

5、安装nginx

(1)编译nginx

cd /data/tools/nginx-1.19.0
./configure --with-http_stub_status_module --with-http_ssl_module --with-mail_ssl_module --with-stream  --prefix=/data/nginx && make && make install
nginx集成ssl模块:
--with-http_stub_status_module --with-http_ssl_module
nginx集成stream模块:
--with-mail_ssl_module --with-stream
nginx指定安装路径:
--prefix=(后跟安装路径)

(2)nginx基础命令

启动:/data/nginx/sbin/nginx
停止:/data/nginx/sbin/nginx -s stop
不停服务更改配置文件:/data/nginx/sbin/nginx -s reload

(3)访问服务:ip:80(默认端口为80)

 

posted @ 2021-07-01 09:48  元奇  阅读(83)  评论(0编辑  收藏  举报