liunx 中Nginx 安装

发布时间:2026/6/15 15:49:53

liunx 中Nginx 安装 1.参考https://blog.csdn.net/fhf2424045058/article/details/1064992832.Nginx下载1)Nginx http://nginx.org/en/download.html 版本nginx-1.16.1 tar.gz 2)Pcre https://sourceforge.net/projects/pcre/files/pcre/8.41/版本pcre-8.41.tar.gz 3)Zlib http://www.zlib.net/版本zlib-1.2.11.tar.gz 4)Oppenssl https://www.openssl.org/source/版本openssl-1.1.1g.tar.gz3.Nginx安装创建 nginx 目录 mkdir nginx 1) 进入nginx 解压 1.tar -xzvf nginx-1.16.1 tar.gz 2.tar -xzvf pcre-8.41.tar.gz 3.tar -xzvf zlib-1.2.11.tar.gz 4.tar -xzvf openssl-1.1.1g.tar.gz 2)安装 1.进入nginx目录cd nginx-1.16.1 2.创建安装目录mkdir installs 3.编译nginx ./configure --prefix/usr/local/nginx/ ./configure --prefix/usr/local/nginx/ --with-stream //--with-stream 转发服务 ./configure --prefix/home/ZDHQX/Nginx/nginx-1.16.1/installs –-with-pcre../pcre-8.41 --with-openssl../openssl-1.1.1g --with-zlib../zlib-1.2.11 4.安装nginxmake make install5.修改配置文件1)cd conf 2)vi nginx.conf 3)i编辑、esc退出、:wq保存 3)查看版本 1.cd installs/sbin 2.查看版本./nginx -V 3.检测./nginx -t 4)启动与停止 1.启动./nginx 2.停止./nginx -s stop 3.重启./nginx -s reload 4.指定conf文件检测与启动 1)检测 ./nginx -t -c path/conf/nginx.conf 2)启动 ./nginx -c path/conf/nginx.conf

相关新闻