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

推荐订阅源

WordPress大学
WordPress大学
T
Threatpost
阮一峰的网络日志
阮一峰的网络日志
美团技术团队
F
Fortinet All Blogs
The GitHub Blog
The GitHub Blog
月光博客
月光博客
V
Visual Studio Blog
T
Tailwind CSS Blog
Stack Overflow Blog
Stack Overflow Blog
博客园 - 聂微东
Jina AI
Jina AI
J
Java Code Geeks
Martin Fowler
Martin Fowler
大猫的无限游戏
大猫的无限游戏
Recorded Future
Recorded Future
C
Check Point Blog
腾讯CDC
N
Netflix TechBlog - Medium
aimingoo的专栏
aimingoo的专栏
罗磊的独立博客
Hacker News: Ask HN
Hacker News: Ask HN
SecWiki News
SecWiki News
博客园 - Franky
Hacker News - Newest:
Hacker News - Newest: "LLM"
N
News | PayPal Newsroom
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
S
Security @ Cisco Blogs
W
WeLiveSecurity
The Last Watchdog
The Last Watchdog
Cloudbric
Cloudbric
F
Full Disclosure
The Cloudflare Blog
Y
Y Combinator Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
S
Schneier on Security
Schneier on Security
Schneier on Security
Spread Privacy
Spread Privacy
L
LINUX DO - 热门话题
AI
AI
N
News and Events Feed by Topic
T
Tor Project blog
P
Palo Alto Networks Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More
G
Google Developers Blog

博客园 - Lil-K

VM-16-pro 安装Centos Stream 9 spring-cloud-alibaba-整合spring-cloud-gateway-3.1.4 Nginx在Windows下的基本介绍安装以及基本使用 window7下 cmd命令行 Mysql导出表结构 + 表数据 【一】Spark基础 【二】Spark 核心 【八】将日志写入log(glog) - Lil-K - 博客园 【七】ab压测 【六】tf和cgi进行联合试验,完成日志服务器 - Lil-K - 博客园 【五】安装fcig - Lil-K - 博客园 【四】搭建Nginx服务器 - Lil-K - 博客园 【三】多语言互通 - Lil-K - 博客园 【二】调通单机版的thrift-C++版本 - Lil-K - 博客园 【一】调通单机版的thrift-python版本 - Lil-K - 博客园 Spark在实际项目中分配更多资源 - Lil-K - 博客园 Spark实际项目中调节并行度 - Lil-K - 博客园 IDEA中大小写转换快捷键 使用maven下载cdh版本的大数据jar包 【Hive六】Hive调优小结 - Lil-K - 博客园
基于CentOS7.x安装Nginx-1.18.0
Lil-K · 2021-04-17 · via 博客园 - Lil-K

基于CentOS7.x安装Nginx-1.18.0

下载

进入目录下载nginx安装包

官网地址

cd /usr/local/xxxx
wget http://nginx.org/download/nginx-1.18.0.tar.gz

解压

tar -xzvf nginx-1.18.0.tar.gz

安装依赖环境

gcc环境:基本运行环境
pcre:用于nginx的http模块解析正则表达式
zlib:用户进行gzip压缩
openssl:用于nginx https协议的传输

yum install -y gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel

编译安装

指定安装目录

cd /usr/local/xxxx/nginx-1.18.0
./configure --prefix=/usr/local/xxxx/nginx
make && sudo make install
cd /usr/local/xxxx/nginx/

测试配置是否成功

/usr/local/xxxx/nginx/sbin/nginx -t -c /usr/local/xxxx/nginx/conf/nginx.conf

出现一下提示就说明安装成功了!!!

image.png

启动Nginx

/usr/local/xxxx/nginx/sbin/nginx

nginx默认是80端口, 先检查80端口是否加入防火墙

# 查看端口是否开启 yes/no
firewall-cmd --query-port=80/tcp

# 添加指定端口
firewall-cmd --add-port=80/tcp --permanent

# 重载入添加的端口
firewall-cmd --reload

image.png

Nginx安装成功!!

Nginx 常用命令

nginx -s reopen #重启Nginx

nginx -s reload #重新加载Nginx配置文件,然后以优雅的方式重启Nginx

nginx -s stop #强制停止Nginx服务

nginx -s quit #优雅地停止Nginx服务(即处理完所有请求后再停止服务)

nginx -t #检测配置文件是否有语法错误,然后退出

nginx -?,-h #打开帮助信息

nginx -v #显示版本信息并退出

nginx -V #显示版本和配置选项信息,然后退出

nginx -t #检测配置文件是否有语法错误,然后退出

nginx -T #检测配置文件是否有语法错误,转储并退出

nginx -q #在检测配置文件期间屏蔽非错误信息

nginx -p prefix #设置前缀路径(默认是:/usr/share/nginx/)

nginx -c filename #设置配置文件(默认是:/etc/nginx/nginx.conf)

nginx -g directives #设置配置文件外的全局指令

killall nginx #杀死所有nginx进程