最近重啟 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
3M 日本原裝進口 速效型 防水噴霧 170ml 衣物 鞋子 皮革 透氣 防水 團購
Xilla 露營 戶外 大力夾雲台手機支架 拓展支架 球型雲台夾 手機架
香積麵 藥膳 風味 84gx5包 素泡麵 純素 素食 蔬食 慈濟 靜思
平衡豬 獨輪車小豬 平衡玩具 不倒翁平衡豬