首页 > 其他 > 详细

Nginx编译安装、ssl、rewrite

时间:2019-01-30 18:17:47      阅读:170      评论:0      收藏:0      [点我收藏+]
一、安装环境


技术分享图片


Nginx下载地址:nginx
zlib下载页面:zlib
pcre下载页面:pcre


二、编译安装:
#useradd nginx -s /sbin/nologin
#yum install gcc-c++ -y
#./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_stub_status_module --user=nginx --group=nginx --with-pcre=/opt/pcre-8.42 --with-zlib=/opt/zlib-1.2.11 --with-http_geoip_module --with-http_gzip_static_module --with-http_flv_module --with-http_mp4_module
#make && make install


三、启动脚本(/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
PIDFile=/usr/local/nginx/logs/nginx.pid
ExecStartPre=/usr/local/nginx/sbin/nginx -t
ExecStart=/usr/local/nginx/sbin/nginx
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true

[Install]
WantedBy=multi-user.target


四、启动服务:
systemctl enable nginx
systemctl start nginx
systemctl reload nginx
systemctl restart nginx

Nginx编译安装、ssl、rewrite

原文:http://blog.51cto.com/13777088/2347974

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!