前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Nginx搭建小型图片服务器

Nginx搭建小型图片服务器

作者头像
全栈程序员站长
发布2022-06-29 16:56:05
1.6K0
发布2022-06-29 16:56:05
举报
文章被收录于专栏:全栈程序员必看

IP

版本

备注

192.168.1.10

CentOS Linux release 7.6.1810 (Core)

Nginx

关闭防火墙

代码语言:javascript
复制
[root@localhost etc]# systemctl stop firewalld
[root@localhost etc]# systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@localhost etc]# setenforce 0

直接安装nginx

安装epel源

代码语言:javascript
复制
[root@localhost etc]# yum -y install epel-release

安装nginx

代码语言:javascript
复制
[root@localhost etc]# yum -y install nginx
[root@localhost ~]# nginx -v
nginx version: nginx/1.16.1

nginx检查

代码语言:javascript
复制
[root@localhost ~]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

文件:

在这里插入图片描述
在这里插入图片描述

/usr/share/nginx/html 默认路径

nginx启动访问测试

代码语言:javascript
复制
[root@localhost ~]# nginx
在这里插入图片描述
在这里插入图片描述

放入默认路径图片,测试

代码语言:javascript
复制
[root@localhost ~]# cd /usr/share/nginx/html/
导入图片
重启nginx
[root@localhost ~]# nginx -s reload

访问图片

在这里插入图片描述
在这里插入图片描述

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/101878.html原文链接:https://javaforall.cn

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2021年6月1,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 关闭防火墙
  • 直接安装nginx
  • nginx启动访问测试
  • 放入默认路径图片,测试
  • 访问图片
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档