服务器+宝塔+Chevereto 搭建个人图床

服务器+宝塔+Chevereto 搭建个人图床

先附上我的demo: http://img.xubean.top/

步骤:

  • 前去github下载压缩包。
  • 在宝塔面板新建网站,并且创建一个数据库。
  • 将下载的压缩包解压至你新建的网站的目录。注意这里需要更改一个东西。
  • 打开新建的网站,跟着提示一步步配置。

1. 下载压缩包

你可以点这里去github下载,也就4MB,一会就下载完了。

2. 在宝塔新建一个网站这个就不用多说了吧。

然后创建一个数据库。记住数据库名、用户名、密码等
在这里插入图片描述

3. 把下载好的压缩包上传到你新建的网站的目录里面然后解压。

在这里插入图片描述

4. 注意这里需要更改一个东西

首先找到网站的设置
在这里插入图片描述
找到配置文件
在最后一个大括号前加入下面的代码
在这里插入图片描述
加完之后是这样的
在这里插入图片描述

代码如下:

# Disable access to .ht* files
location ~ /\.ht {
    deny all;
}
 
# Disable access to sensitive files in app path
location ~ /(app|content|lib)/.*\.(po|php|lock|sql)$ {
   deny all;
}
 
# Disable log on not found images + image replacement
location ~* (jpe?g|png|gif) {
    log_not_found off;
    error_page 404 /contenthttps://qn.cndrew.cn/system/default/404.gif;
}
 
# Enable CORS header (needed for CDN)
location ~* \.(ttf|ttc|otf|eot|woff|woff2|css|js)$ {
    add_header Access-Control-Allow-Origin "*";
}
 
# Force serve upload path as static content (match your upload folder if needed)
location https://qn.cndrew.cn {}
 
# Route dynamic request to index.php
location / {
    try_files $uri $uri/ /index.php?$query_string;
}

5. 然后进入到你新建的网站,跟随着设置一步一步来就行。这里会让你输入一次你的数据库的名字账号和密码,把你上面新建的那个输进去就好了。

全部设置好之后你会获得一个管理员账号(名字密码都是自己设置的。点击登陆进去可以进入仪表盘设置网站的外观和配置。可以切换语言。
然后到这里就搭建结束了。

我是用宝塔搭建的,适合像我这样的小白参考。大佬轻喷。

参考链接:https://cndrew.cn/2019/08/30/img/

发布了61 篇原创文章 · 获赞 21 · 访问量 9098

猜你喜欢

转载自blog.csdn.net/xbean1028/article/details/104382861