最近重啟 Apache 時發現 apache2 有錯誤訊息 Syntax error on line 80 of /etc/apache2/apache2.conf: DefaultRuntimeDir must be a valid directory, absolute or relative to ServerRoot,雖然對網站執行沒有什麼問題,有錯誤就就是不舒服;就上網爬爬文找解法如下。
顯示apache來源資訊
指令:apache2 -S
顯示結果
[Tue Jun 29 11:17:55.681925 2021] [core:warn] [pid 13720] AH00111: Config variable ${APACHE_RUN_DIR} is not defined
apache2: Syntax error on line 80 of /etc/apache2/apache2.conf: DefaultRuntimeDir must be a valid directory, absolute or relative to ServerRoot
修正環境變數
指令:source /etc/apache2/envvars
顯示apache來源資訊
指令:apache2 -S
顯示結果
VirtualHost configuration:
*:443 webteach.tw (/etc/apache2/sites-enabled/webteach.tw-ssl.conf:2)
*:80 is a NameVirtualHost
default server ip-172-31-27-1.ap-northeast-1.compute.internal (/etc/apache2/sites-enabled/000-default.conf:1)
port 80 namevhost ip-172-31-27-1.ap-northeast-1.compute.internal (/etc/apache2/sites-enabled/000-default.conf:1)
port 80 namevhost webteach.tw (/etc/apache2/sites-enabled/cdn.webteach.tw.conf:1)
alias cdn.webteach.tw
port 80 namevhost webteach.tw (/etc/apache2/sites-enabled/webteach.tw.conf:1)
alias www.webteach.tw
port 80 namevhost wpdemo.webteach.tw (/etc/apache2/sites-enabled/wpdemo.webteach.tw.conf:1)
alias wpdemo.webteach.tw
ServerRoot: “/etc/apache2”
Main DocumentRoot: “/var/www/html”
Main ErrorLog: “/var/log/apache2/error.log”
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
Mutex ssl-stapling-refresh: using_defaults
Mutex ssl-stapling: using_defaults
Mutex proxy: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir=”/var/run/apache2/” mechanism=default
PidFile: “/var/run/apache2/apache2.pid”
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name=”www-data” id=33 not_used
Group: name=”www-data” id=33 not_used
味丹 隨緣 鮮蔬百匯/素肉骨茶/素魷魚羹麵/韓式泡菜/麻辣燙湯麵 (5包/袋) 素食 全素 泡麵
香積麵 藥膳 風味 84gx5包 素泡麵 純素 素食 蔬食 慈濟 靜思
垃圾桶 家用 客廳 臥室 辦公室 衛生間 大容量 高顏值 創意 收納 垃圾
現貨超低價 小新玩偶 蠟筆小新 動感新生活係列 潮玩 小新公仔