rich@rich-vb-u24:~/pure-php-app$ docker logs pure-pmaAH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.6. Set the 'ServerName' directive globally to suppress this messageAH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.6. Set the 'ServerName' directive globally to suppress this message[Thu Aug 06 21:35:22.865289 2026] [mpm_prefork:notice] [pid 1:tid 1] AH00163: Apache/2.4.68 (Debian) PHP/8.3.32 configured -- resuming normal operations[Thu Aug 06 21:35:22.865323 2026] [core:notice] [pid 1:tid 1] AH00094: Command line: 'apache2 -D FOREGROUND'rich@rich-vb-u24:~/pure-php-app$

這段日誌顯示您的 pure-pma(phpMyAdmin)已經完全正常啟動,且時間戳記 21:35:22 也與宿主機的台灣時間完美對齊!

至於日誌前兩行的 AH00558: apache2: Could not reliably determine... 只是 Apache 網頁伺服器的提示(Notice),意思是它在容器內找不到標準的網域網址,所以先拿內部的虛擬 IP(172.18.0.6)當預設值。這完全不影響 phpMyAdmin 的功能,您可以直接忽略它。

此時,我們需要注意一個 Apache 在 Docker 鏡像中的特殊設定,這與您稍後設定 Fail2ban 息息相關:

🚨 注意:Apache 的 Log 轉向機制

和 Nginx 類似,官方的 phpmyadmin 鏡像為了讓您能直接用 docker logs 看到內容,在容器內部也把 Apache 的 access.log 和 error.log 做成了軟連結(Symlink)。

因為您剛剛在 docker-compose.yml 中加入了這行:

- ./pma-logs:/var/log/apache2

這會導致容器內的軟連結被宿主機的實體資料夾「覆蓋」。此時可能會發生兩種狀況:

  1. 狀況 A:docker logs 從此變成空白(因為日誌全部改寫進實體檔案了)。
  2. 狀況 B:實體資料夾 pma-logs/ 內看不到檔案(因為 Apache 依然在往標準輸出送資料)。

🔍 馬上檢查您的 pma-logs 資料夾

請在宿主機執行以下指令,看看資料夾內有沒有成功產生檔案:

ls -l /home/rich/pure-php-app/pma-logs/

請問您在 pma-logs/ 資料夾內有看到產生的 access.log 檔案嗎?還是資料夾目前是空的呢?