NGINX官网下载版本
http://nginx.org/
通过 wget http://nginx.org/download/nginx-1.17.6.tar.gz 下载文件
1.安装必要插件
yum -y install gcc pcre pcre-devel zlib zlib-devel openssl openssl-devel
2.解压下载好的文件
tar -zxvf nginx-1.17.6.tar.gz
3.进入到 nginx-1.17.6文件夹下面
开始安装
指定安装路径
./configure \
--prefix=/etc/nginx \
--sbin-path=/usr/sbin/nginx \
--modules-path=/usr/lib64/nginx/modules \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/run/nginx.lock \
--http-client-body-temp-path=/var/cache/nginx/client_temp \
--http-proxy-temp-path=/var/cache/nginx/proxy_temp \
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \
--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \
--http-scgi-temp-path=/var/cache/nginx/scgi_temp \
--user=nginx \
--group=nginx \
--with-compat \
--with-file-aio \
--with-threads \
--with-http_addition_module \
--with-http_auth_request_module \
--with-http_dav_module \
--with-http_flv_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_mp4_module \
--with-http_random_index_module \
--with-http_realip_module \
--with-http_secure_link_module \
--with-http_slice_module \
--with-http_ssl_module \
--with-http_stub_status_module \
--with-http_sub_module \
--with-http_v2_module \
--with-mail \
--with-mail_ssl_module \
--with-stream \
--with-stream_realip_module \
--with-stream_ssl_module \
--with-stream_ssl_preread_module \
4,编译
make & make install
5, 进入到安装nginx目录下面的sbin
启动命令
./nginx
挺住
./nginx -s stop
5,配置systemctl
vim /etc/systemd/system/nginx.conf
[Unit]
Description=nginx - high performance web server
Documentation=http://nginx.org/en/docs/
After=network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target
[Service]
Type=forking
PIDFile=/var/run/nginx.pid
ExecStartPost=/bin/sleep 0.1
ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf
ExecReload=/bin/sh -c "/bin/kill -s HUP $(/bin/cat /var/run/nginx.pid)"
ExecStop=/bin/sh -c "/bin/kill -s TERM $(/bin/cat /var/run/nginx.pid)"
LimitNOFILE=65536
[Install]
WantedBy=multi-user.target
6,启动测试
systemctl start nginx
7,开机自启
systemctl enable nginx
systemctl daemon-reload

好先生!
- 粉丝: 826
- 资源: 10
最新资源
- 84105929555134世界网络收音机 .apk
- 【毕业设计】基于Python的Django-html人脸表情的分类算法的设计源码(完整前后端+mysql+说明文档+LW+PPT).zip
- 中移铁通操作手册.docx
- 【毕业设计】基于Python的Django-html人信息管理系统及安全策略分析系统源码(完整前后端+mysql+说明文档+LW+PPT).zip
- 狮子座12025年一定要.txt
- 【毕业设计】基于Python的Django-html深度学习文本相似度检测系统(bert)源码(完整前后端+mysql+说明文档+LW+PPT).zip
- 【毕业设计】基于Python的Django-html深度学习的web端多格式纠错系统源码(完整前后端+mysql+说明文档+LW+PPT).zip
- 【毕业设计】基于Python的Django-html图像取证技术研究与实现系统源码(完整前后端+mysql+说明文档+LW+PPT).zip
- 【毕业设计】基于Python的Django-html手写数字识别系统源码(完整前后端+mysql+说明文档+LW+PPT).zip
- 2025误差理论作业参考.zip
- 【毕业设计】基于Python的Django-html图像去雾算法研究系统源码(完整前后端+mysql+说明文档+LW+PPT).zip
- 【毕业设计】基于Python的Django-html图像信息隐藏技术设计源码(完整前后端+mysql+说明文档+LW+PPT).zip
- esp32配置 light-sleep 和 adc button 运行一段时间后系统重启
- 龙岩市乡镇边界,shp格式
- 宁德市乡镇边界,shp格式
- 景德镇市乡镇边界,shp格式
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈


