有了一臺自己的服務器,或者是虛擬機,當然要物盡其用了,這一次,我們用Chevereto網站程序,來搭建自己的圖床。
為什么呢?
- 給自己喜歡的圖片,在網絡上能有一個自己的家
- 自己搭建的程序,自己用著放心
- 對于經常使用M?arkdown編輯文字的用戶,文字中插入圖片更方便了
- 避免網站中儲存過量圖片,管理不便
本站下載安裝包:
Chevereto-Free-1.1.3.zip
相關幫助:
官方幫助文檔:https://chevereto.com/docs/install
Github下載源碼,地址:https://github.com/Chevereto/Chevereto-Free(免費版)
CSDN 的一個方法:https://blog.csdn.net/qq_28616789/article/details/79340236
創建頁面,將內容放置再以下代碼內:
[cc lang="php"]
我的代碼
[/cc]
菜單圖標:https://chevereto.com/src/icomoon/
自定義圖片鏈接,如:http://tu.npc.ink/my/Up6.jpg,那么,這個my,怎么來的?
首先,在網站根目錄新建文件夾my,然后在“儀表盤-圖片上傳-圖像路徑一欄,填寫my”即可
錯誤集合:
1.文件放置后,打開鏈接404
填寫一下偽靜態Rewrite規則,網站-設置-偽靜態
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;
}
順利出現安裝頁面
2.安裝完畢,提示錯誤:
Warning: count(): Parameter must be an array or an object that implements Countable in /www/wwwroot/tu.baimu.org/app/lib/integrity-check.php on line 167
PHP版本為7.2,更改為7.1,原因是php7.2更改了一些配置,
參考鏈接:參考
因為種種復雜的原因(精力有限,效果不佳。。。),我已關閉了自建的圖床,轉而使用阿里云的OSS技術來存儲圖片,前幾天轉移博客的時候,全站打包,才50M的樣子。
關于OSS,可以看這篇: