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
好先生!
- 粉丝: 687
- 资源: 9
最新资源
- 技术资源分享-我的运维人生-《Django 项目数据初始化与管理脚本》
- formatted-task022-cosmosqa-passage-inappropriate-binary.json
- formatted-task021-mctaco-grammatical-logical.json
- 大模型使用技巧入门教程.docx
- formatted-task020-mctaco-span-based-question.json
- formatted-task019-mctaco-temporal-reasoning-category.json
- 技术资源分享-我的运维人生-Vue 应用数据交互与状态管理脚本
- formatted-task018-mctaco-temporal-reasoning-presence.json
- formatted-task017-mctaco-wrong-answer-generation-frequency.json
- 一个基于用手写的非常正常的图片
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈