如何將Cyberpanel中的Mariadb由10.1升級至10.4 (Ubuntu)

Submitted by tim on 周日, 08/30/2020 - 16:17

由於要安裝drupal, 使用了Cyberpanel建立了一個website之後, 安裝時的環境檢測時, 原本的CyberPanel中的Mariadb只有10.1版本, 但是Drupal需要更新的Mariadb版本, 於是來進行升級CypberPanel中的Mariadb.

參考了這篇:

https://forums.cyberpanel.net/discussion/comment/11013

不過其中指令:

sudo apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc'

會發生以下錯誤:

'Invalid Argument'

只好用先下載再匯入的方式進行:

wget https://mariadb.org/mariadb_release_signing_key.asc
sudo apt-key add mariadb_release_signing_key.asc

如何啟用 drupal 網站的 https 加密

Submitted by tim on 週五, 08/28/2020 - 16:59

可以參考官網這篇技術文章:

https://www.drupal.org/https-information

不過實務上, 只需要在 apache / nginx / litespeed 等 web server 上下達 http 重導 https 即可, drupal 本身是不需要額外設定的.

以 apache 為例, 可以使用以下 rewrite rule:

RewriteEngine On
RewriteCond %{HTTPS}  !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

就可以將所有的 http 訪問重導到 https.

標籤 (Tags)

如何在 drupal 中啟用 Trusted Host Settings 設定

Submitted by tim on 週五, 08/28/2020 - 16:38

新建立好了的 drupal 系統, 後端出現了一個錯誤訊息, 經檢查後, 有個 Trusted Host Settings  未啟用, 內容如下:

The trusted_host_patterns setting is not configured in settings.php. This can lead to security vulnerabilities. It is highly recommended that you configure this. See Protecting against HTTP HOST Header attacks for more information.

而對應說明的連結為:

https://www.drupal.org/docs/installing-drupal/trusted-host-settings

可以看得到, 需要調整 settings.php 的內容, 檔案位置會在

標籤 (Tags)