Nginx搭建小型图片服务器

2022-11-21 19:15:19 浏览数 (1)

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

访问图片

0 人点赞