Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
CoCo_Code_Op2
NoteBook
提交
eaba56d6
NoteBook
项目概览
CoCo_Code_Op2
/
NoteBook
与 Fork 源项目一致
Fork自
酥脆的小菠萝 / hexbook
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
NoteBook
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
eaba56d6
编写于
9月 11, 2020
作者:
S
star
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
nginx安装
上级
7941a383
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
70 addition
and
0 deletion
+70
-0
软件安装手册/Image/Snipaste_2020-09-11_00-45-37.png
软件安装手册/Image/Snipaste_2020-09-11_00-45-37.png
+0
-0
软件安装手册/中间件安装/CentOS8下安装NGINX.md
软件安装手册/中间件安装/CentOS8下安装NGINX.md
+70
-0
未找到文件。
软件安装手册/Image/Snipaste_2020-09-11_00-45-37.png
0 → 100644
浏览文件 @
eaba56d6
41.6 KB
软件安装手册/中间件安装/CentOS8下安装NGINX.md
0 → 100644
浏览文件 @
eaba56d6
#### DNF安装NGINX
1.
安装NGINX
```
shell
[
root@localhost /]# dnf
install
nginx
-y
```
系统会自动解决相关依赖并安装NGINX。
2.
NGINX基本命令
```
shell
[
root@localhost /]# systemctl start nginx 启动nginx
[
root@localhost /]# systemctl stop nginx 停止nginx
[
root@localhost /]# systemctl status nginx 查看nginx状态
● nginx.service - The nginx HTTP and reverse proxy server
Loaded: loaded
(
/usr/lib/systemd/system/nginx.service
;
disabled
;
vendor preset: disabled
)
Active: inactive
(
dead
)
9月 11 00:20:15 localhost.localdomain systemd[1]: nginx.service: Unit cannot be reloaded because it is inactive.
9月 11 00:20:58 localhost.localdomain systemd[1]: Starting The nginx HTTP and reverse proxy server...
9月 11 00:20:58 localhost.localdomain nginx[27331]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
9月 11 00:20:58 localhost.localdomain nginx[27331]: nginx: configuration file /etc/nginx/nginx.conf
test
is successful
9月 11 00:20:59 localhost.localdomain systemd[1]: Started The nginx HTTP and reverse proxy server.
9月 11 00:30:10 localhost.localdomain systemd[1]: Stopping The nginx HTTP and reverse proxy server...
9月 11 00:30:10 localhost.localdomain systemd[1]: Stopped The nginx HTTP and reverse proxy server.
[
root@localhost /]# systemctl restart nginx 重启nginx
[
root@localhost /]# systemctl reload nginx 重新加载nginx配置
[
root@localhost /]# systemctl
enable
nginx 添加nginx开机启动
Created symlink /etc/systemd/system/multi-user.target.wants/nginx.service → /usr/lib/systemd/system/nginx.service.
[
root@localhost /]# systemctl disable nginx 关闭nginx开机启动
Removed /etc/systemd/system/multi-user.target.wants/nginx.service.
```
3.
开放系统防火墙的80端口(NGINX默认已配置监听80端口)
```
shell
[
root@localhost /]# firewall-cmd
--query-port
=
80/tcp 查询80端口是否对外开放
no
[
root@localhost /]# firewall-cmd
--add-port
=
80/tcp
--permanent
永久对外开放80端口
success
[
root@localhost /]# firewall-cmd
--reload
重启防火墙
success
```
4.
NGINX启动后,登录网页查看NGINX配置的默认页面
```
http
http://192.168.253.128/
```
默认页面如图:
!
[](
D:\GitRepository\MyBook\软件安装手册\Image\Snipaste_2020-09-11_00-45-37.png
)
5.
DNF安装NGINX后各个文件目录位置
-
安装位置:
***/etc/nginx/**
*
,各种配置文件,参数文件都在此目录下。
```shell
[root@localhost nginx]# ls
conf.d fastcgi.conf fastcgi_params koi-utf mime.types nginx.conf scgi_params uwsgi_params win-utf
default.d fastcgi.conf.default fastcgi_params.default koi-win mime.types.default nginx.conf.default scgi_params.default uwsgi_params.default
```
-
web服务器默认目录:
***/usr/share/nginx/**
*
,此目录下有一个html目录用来存放网页文件,其中的 index.html 即为 NGINX 配置的默认页面。
-
日志存放路径:
***/var/log/nginx/**
*
-
帮助文档存放路径:
***/usr/share/doc/nginx/**
*
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录