centos7下编译安装nginx-1.16.0
发布时间:2021-01-17 04:00:57 所属栏目:Nginx 来源:互联网
导读:一、下载nginx源码 如:nginx-1.16.0.tar.gz 二、创建用户和组,并解压 三、下载openssl,编译高版本openssl 如:openssl-1.0.2r.tar.gz 四、编译
|
一、下载nginx源码 http://nginx.org/en/download.html 如:nginx-1.16.0.tar.gz 二、创建用户和组,并解压 groupadd www useradd -g www www tar xf nginx-1.16.0.tar.gz
三、下载openssl,编译高版本openssl https://www.openssl.org/source/ 如:openssl-1.0.2r.tar.gz tar xf openssl-1.0.2r.tar.gz
四、编译安装nginx cd nginx-1.16.0 ./configure --prefix=/data/nmp/nginx --user=www --group=www --with-pcre --with-openssl=/data/openssl-1.0.2r --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-http_image_filter_module --with-http_slice_module --with-mail --with-threads --with-file-aio --with-stream --with-mail_ssl_module --with-stream_ssl_module --with-openssl 的路径设置为第3步中openssl源码解压路径。 上面的有些模块大家可以按需安装。 make -j8 && make install
五、配置systemd服务 创建nginx.service 文件 vi /usr/lib/systemd/system/nginx.service [Unit] Description=The nginx HTTP and reverse proxy server After=syslog.target network.target remote-fs.target nss-lookup.target [Service] Type=forking ExecStartPre=/data/nmp/nginx/sbin/nginx -t ExecStart=/data/nmp/nginx/sbin/nginx -c /data/nmp/nginx/conf/nginx.conf ExecReload=/data/nmp/nginx/sbin/nginx -s reload ExecStop=/data/nmp/nginx/sbin/nginx -s stop PrivateTmp=true [Install] WantedBy=multi-user.target 启用 nginx.service systemctl enable nginx.service 启动 nginx systemctl start nginx.service
六、设置firewalld防火墙,开放80端口 firewall-cmd --zone=public --add-port=80/tcp --permanent firewall-cmd --reload
(编辑:南阳站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- node.js – 你应该如何处理auth并在微服务之间共享用户信息
- python – Nginx fastcgi截断问题
- 获取视频文件的实际时间,以便使用nginx_mod_h264_streaming
- 如何根据标题args – nginx重写动态更改文件名
- ruby-on-rails – 搬到rbenv打破乘客(nginx)
- uWSGI python高负载配置
- node.js – socket.io nginx配置WebSocket握手期间出错:’
- 在Digital ocean上部署Django,Gunicorn,Nginx,Virtualenv给
- ruby-on-rails – Rails 4 nginx unicorn ssl = 502 Bad Ga
- ruby-on-rails – 独角兽超时处理
推荐文章
站长推荐
- apache-2.2 – 是否可以通过Content-Type将请求路
- node.js-是否应将Nginx和HAProxy都用于生产节点应
- 使用NGINX的WAF owasp modsecurity crs中“尚不支
- jQuery ajax不会发出HTTPS请求
- apache-2.2 – Nginx作为反向代理:如何正确配置
- 如何使用NGINX反向代理,以及代理上游URL的端口和
- python – uwsgi_params文件应该放在哪里以及它的
- utf-8-使用pcre 8.3在nginx上的unicode url重写规
- nginx:try_files找不到静态文件,回到PHP
- 为nginx中的上游所有服务器设置max_fails和fail_
热点阅读
