【笔记】部署Chevereto图床服务器

前言

在Linux上部署Chevereto开源版)图床服务器

准备工作

部署Nginx+PHP环境

传送门

部署Mysql环境

传送门

创建一个Chevereto数据库

1
mysql> CREATE DATABASE Chevereto;

修改Nginx配置文件

  • 添加try_files配置
/etc/nginx/nginx.conf
1
2
3
4
5
location / {
root html;
index index.html index.htm index.php;
try_files $uri $uri/ /index.php?$query_string;
}

重载配置

1
/usr/sbin/nginx -s reload

部署图床服务器

上传项目到服务器

<ip>:服务器ip地址

1
scp 1.5.1.zip root@<ip>:/usr/share/nginx/html/chevereto.zip

解压到网站根目录

1
2
3
yum install -y unzip

unzip chevereto.zip

踩坑(添加配置文件)

  • 直接访问,报错:Chevereto can't create the app/settings.php file. You must manually create this file.

原因

  • 缺少配置文件

解决问题

  • 创建配置文件,并提升写入权限
1
2
touch app/settings.php
chmod +x app/settings.php

踩坑(修改权限)

  • 再次访问,报错:The system has encountered errors that must be fixed to allow proper Chevereto functionality. Chevereto won't work until the following issues are solved:

原因

  • 权限不足

解决问题

1
chmod 777 images/ content/ app/content/ app/install/update/temp/

初始化图床服务器

  • 浏览器访问/,自动跳转到/install,初始化数据库配置

  • 编辑setting.php配置文件

app/settings.php
1
2
3
4
5
6
7
8
9
10
11
12
13
<?php
$settings = array (
'db_host' => 'localhost',
'db_name' => 'Chevereto',
'db_user' => 'root',
'db_pass' => '',
'db_table_prefix' => 'chv_',
'db_driver' => 'mysql',
'db_pdo_attrs' =>
array (
),
'debug_level' => 1,
);
  • 配置完后点击click here

  • 初始化管理员配置

  • 完成初始化

完成

  • 截图纪念

参考文献

CSDN——深海神奇舰舰长
Rat的博客