0%

搭建 Chevereto 个人图床

平时写写文什么的,图床还是要一个的,分享啊、插入图片啊,都挺方便的。(为什么要叫「图床」啊,叫「图库」多好听呢,或者「画廊」?)

Chevereto 是一款常用的图床服务,这里使用的是「免费版」,个人使用也足够了。

环境:CentOS 7

需求:NginxPHP 7.0-7.2(PHP 7.3 是不支持的,为此我特地把 PHP 换成了 7.2 版),MySQL

下载

前往 GitHub,下载最新发布。

1
2
3
4
5
6
7
# 创建安装目录
mkdir -p /var/www/chevereto && cd /var/www/chevereto

# 下载
wget -O chevereto.zip https://github.com/Chevereto/Chevereto-Free/releases
# 解压
x chevereto.zip

配置 Nginx

需要 伪静态 + php-fpm

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
server {
server_name www.vksir.zone;
root /var/www/chevereto;
client_max_body_size 20m;

# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;

location / {
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
rewrite (.*) /index.php;
}
try_files $uri $uri/ /api.php;
}

location /admin {
try_files $uri /admin/index.php?$args;
}
}

配置 MySQL

为 Chevereto 新建一个数据库 chevereto ,并为该数据库创建一个用户名为 chevereto 并设置密码,参考:MySQL 的安装与配置

完成安装

打开浏览器,输入 http://IP 根据指示完成安装。