惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

MongoDB | Blog
MongoDB | Blog
大猫的无限游戏
大猫的无限游戏
H
Help Net Security
V
Visual Studio Blog
G
Google Developers Blog
Blog — PlanetScale
Blog — PlanetScale
Last Week in AI
Last Week in AI
C
Check Point Blog
D
Docker
M
MIT News - Artificial intelligence
P
Proofpoint News Feed
博客园 - 叶小钗
博客园 - 聂微东
The Cloudflare Blog
云风的 BLOG
云风的 BLOG
Martin Fowler
Martin Fowler
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
酷 壳 – CoolShell
酷 壳 – CoolShell
MyScale Blog
MyScale Blog
WordPress大学
WordPress大学
Engineering at Meta
Engineering at Meta
腾讯CDC
S
SegmentFault 最新的问题
博客园 - 【当耐特】

博客园 - 天天天蓝

JDK 国内源 jenkins spring cloud springboot spring 文章索引 java文章索引 小程序 AWAIT ASYNC ES6转ES5解决 centos vsftpd linux 修改配色 mac 常用技巧 ryzen nvidia hackintosh mysql count 主键之坑 git命令 MYSQL 注释 yaf twig配置 1.YAF 的安装 yaf nginx 设置 ubuntu 16 阿里云 vsftpd win10下 homestead 安装
centos nginx
天天天蓝 · 2019-01-21 · via 博客园 - 天天天蓝

1.下载  http://nginx.org/en/download.html

2.解压   tar -zxvf xxxx.tar.gz

3.安装依赖

yum install gcc-c++

yum install pcre-devel

yum install zlib-devel

4.安装

./configure --prefix=/opt/nginx  --with-http_ssl_module

or

 sudo ./configure --prefix=/opt/nginx  --with-openssl=/usr/bin/openssl

sudo make

sudo make install

5.服务

sudo vim /usr/lib/systemd/system/nginx.service
[Unit]
Description=The nginx HTTP and reverse proxy server
After=network.target remote-fs.target nss-lookup.target

[Service]
Type=forking
PIDFile=/opt/nginx/logs/nginx.pid
ExecStartPre=/usr/bin/rm -f /opt/nginx/logs/nginx.pid
ExecStartPre=/opt/nginx/sbin/nginx -t
ExecStart=/opt/nginx/sbin/nginx
ExecReload=/bin/kill -s HUP $MAINPID
KillSignal=SIGQUIT
TimeoutStopSec=5
KillMode=process
PrivateTmp=true

[Install]
WantedBy=multi-user.target