Press "Enter" to skip to content

Synology NAS with chevereto self-hosted image hosting software

這篇教學是利用NAS架設圖床,因為剛開始架設WordPress關係,就發覺圖床可能不能用內建媒體,會造成縮圖過多,速度變慢,備份檔案也會變大,所以逛了一下谷歌大神的方法,不外乎使用子網域去做另外的圖床放置,這邊就來記錄一下。

一、配置Synology NAS 環境

先至 Synology 套件中心 下載以下套件

1.MariaDB10
2.Webstation
3.PHP7.0 (以上
4.phpMyAdmin

接下來設定Webstation虛擬主機配置

1.打開 Webstation 的虛擬主機 – 新增自己的子網域
2.主目錄指定至自己想要的圖床路徑
3.開啟HTTPS – 打勾 HSTS & HTTP/2
4.使用Apache HTTP Sever
5.使用PHP

-2020-01-13-10.30.24.png

記得也去自己 domain 設定子網域 DNS

_2020-01-13_10_35_49.jpg

之後進 phpMyAdmin 新建資料庫,我是設置 img 。

_2020-01-12_10_06_46.jpg


二、Install chevereto 架設圖床

先至 chevereto 官網下載 php 檔案。
(其實官方有更簡易版本,但是比較適合市面上的host,所以我們這裡還是以原始方法進行。

_2020-01-13_10_13_29.jpg


將下載好的 installer.php 檔案丟至你要的NAS路徑上面,個人選擇丟在 web/img 。

-2020-01-13-8.14.57.png

之後登入自己的子網域,記得登入應在子網域後面加上 installer.php
如果直接登入子網域因為沒有index所以會導致404找不到網頁
ex: xxxx.com/installer.php
這樣便可以進行安裝引導~

-2020-01-12-10.01.35.png


這裡如果有購買付費功能的可以輸入金鑰,如果沒有擇選 SKIP

-2020-01-12-10.01.43.png

這一步如果使用的 host 有使用 cPanel 的可以直接使用,我這裡使用的是 MariaDB10 ,因此點 SKIP 進行手動設置。

-2020-01-12-10.01.54.png

這裡可以設置資料庫詳細設定,Port 部分由於 NAS 的 MariaDB10 預設 port 是開 3307 ,所以我這裡 port 改成 3307


-2020-01-13-8.13.19.png

-2020-01-12-10.13.15.png

之後可以進行設置 管理員帳密

_2020-01-12_10_14_494abab3094ec7c6ef.jpg

設定 Email 系統發件人 跟 收到通知 Email

_2020-01-12_10_15_08.jpg

這一步便可以開始準備安裝 chevereto 套件 ,

-2020-01-12-10.15.16.png

-2020-01-12-10.15.22.png

-2020-01-14-8.56.30.png

這樣就搞定收工!

後記:因為本身沒有加入HTTPS RULES 導致外部訪問會出現404情況,將以下代碼加入至.htaccess檔案。

# Disable server signature
ServerSignature Off

# Disable directory listing (-indexes), Multiviews (-MultiViews) and enable Follow system links (+FollowSymLinks)
Options -Indexes
Options -MultiViews

<IfModule mod_rewrite.c>

RewriteEngine On

# If you have problems with the rewrite rules remove the “#” from the following RewriteBase line
# You will also have to change the path to reflect the path to your Chevereto installation
# If you are using alias is most likely that you will need this.
#RewriteBase /

RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


# 404 images
# If you want to have your own fancy “image not found” image remove the “#” from RewriteCond and RewriteRule lines
# Make sure to apply the correct paths to reflect your current installation
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule images/.+\.(gif|jpe?g|png|bmp) – [NC,L,R=404]
#RewriteRule images/.+\.(gif|jpe?g|png|bmp) content/images/system/default/404.gif [NC,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !\.(css|js|html|htm|rtf|rtx|svg|svgz|txt|xsd|xsl|xml|asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|exe|gif|gz|gzip|ico|jpe?g|jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|swf|tar|tif|tiff|wav|wma|wri|xla|xls|xlsx|xlt|xlw|zip)$ [NC]
RewriteRule . index.php [L]

</IfModule>

Be First to Comment

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *