
在前一篇教程中,你已经成功地搭建了Chevereto图床程序。然而,为了确保其正常运行,还需要进行一些其他关键配置。本文将重点介绍这些重要的设置,以确保你的Chevereto图床能够运行顺利。
使用注册码
打开管理员仪表盘,点击这个按钮,把你在
这里的Key填写进去就好了。

中文设置
当我们第一次进入网站时,网站显示为中文。但是一登陆管理员账户,就变成英文了。这是怎么回事?
首先,你需要先进入管理员仪表盘,设置网站的默认语言为中文。
右上角,点击头像,找到管理员一栏,点击设置。

在这里面,将默认语言修改为中文。自动选择语言选项和语言选择器选项根据自己需求选择开启或关闭。
修改之后,网站还是英文怎么办?
我们要把账户的语言也改成中文。


这样,就可以了。
Cron设置
Chevereto 需要设置cron 来运行后台作业。
SSH中,运行下面代码
cat >/etc/cron.d/chevereto <<EOM
* * * * * www php /site/app/bin/legacy -C cron
EOM
根据实际情况更改权限和目录。
配置真实连接 IP
如果未配置真实连接IP,Chevereto将无法检测真实访问者的IP,从而无法执行基于IP的限制和防滥用控制。

当我们建立网站,并且如果你套上CloudFlare的CDN之后,会获取不到真实IP。
我们回到之前的AAPanel,找到网站,点开nginx配置文件。(URL rewrite)
location / {
index index.php;
try_files $uri $uri/ /index.php$is_args$query_string;
找到之前设置的这一行代码。在下面添加上以下代码。
set_real_ip_from 103.21.244.0/22;
set_real_ip_from 103.22.200.0/22;
set_real_ip_from 103.31.4.0/22;
set_real_ip_from 104.16.0.0/13;
set_real_ip_from 104.24.0.0/14;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 131.0.72.0/22;
set_real_ip_from 141.101.64.0/18;
set_real_ip_from 162.158.0.0/15;
set_real_ip_from 172.64.0.0/13;
set_real_ip_from 173.245.48.0/20;
set_real_ip_from 188.114.96.0/20;
set_real_ip_from 190.93.240.0/20;
set_real_ip_from 197.234.240.0/22;
set_real_ip_from 198.41.128.0/17;
set_real_ip_from 2400:cb00::/32;
set_real_ip_from 2606:4700::/32;
set_real_ip_from 2803:f800::/32;
set_real_ip_from 2405:b500::/32;
set_real_ip_from 2405:8100::/32;
set_real_ip_from 2a06:98c0::/29;
set_real_ip_from 2c0f:f248::/32;
#use any of the following two
real_ip_header CF-Connecting-IP;
#real_ip_header X-Forwarded-For;
这样就可以了。
用其他CDN一个道理。参考

set_real_ip_from 192.168.1.0/24;
set_real_ip_from 192.168.2.1;
set_real_ip_from 2001:0db8::/32;
real_ip_header X-Forwarded-For;
real_ip_recursive on;
根据自己的实际情况进行修改配置


文件系统
为了更加安全,可能需要修改文件系统权限。
运行的用户php
必须位于安装目录的所有者组中,并且 Chevereto 需要对该目录的递归读取访问权限。除此之外,以下路径需要递归读/写访问:
- Session path
- Temp folder
- ./content
- ./images
- ./importing
用户生成的内容存储在:
- ./images
- ./content/images/users
- ./content/pages
PHP 配置
建议 Chevereto 安装使用以下值。
Property | 描述 | 示例 |
---|---|---|
upload_max_filesize | 最大上传大小 | 64M 表示 64 MB |
post_max_size | 最大POST大小 | 同上 |
max_execution_time | 软件执行的最大时间,以秒为单位 | 30 表示 30 秒 |
memory_limit | 分配的最大内存 | 512M 表示 512 MB |
你可以切换这些限制以反映你的硬件和服务器负载。查阅这篇文章以获取更多信息。
我们在AAPanel打开App Store,找到对应的PHP版本,进行设置就好了。

最后
几乎所有的配置都已经设置完成了,接下来,你可以根据下面的官方文档进行网站的自定义了。包括LOGO,注册,SMTP,外部存储等都可以在官方文档里找到非常详细的设置教程。