This post summarizes a real troubleshooting session; all company/domain details are anonymized.Example domains use demodomain.com, e.g., wmsadmin.demodomain.com. Architecture Overview Typical vhost (simplified): Symptom Troubleshooting Flow (quick checklist) Raise timeouts only on long-running paths Avoid setting a huge global timeout that can tie up workers. Relax timeouts per URI: If mod_reqtimeout is enabled, prevent slow uploads…
Category: Apache
About Apache
在 AWS 上用 Apache 2.4 做反向代理:502 問題排查與實戰調校(含 vhost 分檔與 rotatelogs)
本文整理自一段真實排查經驗,所有公司與網域資訊已去識別化。範例網域以 demodomain.com 表示,例如 wmsadmin.demodomain.com。 架構概述 典型 vhost(簡化示意): 問題現象 排查思路(速查) 針對長耗時路徑「差異化」放寬 timeout 不要全站一刀切放到很長,避免把 worker 綁死;只對特定 URI 提高 timeout: 若有啟用 mod_reqtimeout,避免慢速上傳被切斷: 如何判讀「滿版的 trace 訊息」? 看到像這樣的行: 代表只是 偵錯等級很高時,Apache 把上游回應 header 與傳輸流程寫進 error log。不是錯誤。要看真正異常,請降回 LogLevel warn,或在 access log 先找 502 再對照 error log 該時段的 warn/error 級別訊息。 vhost 各自分檔記錄(擺脫 other_vhosts_access.log) 在每個 vhost 內指定 ErrorLog/CustomLog,最簡單: 如不想再用全域 other_vhosts_access.log,可停用: (注意:停用後,沒自訂 CustomLog 的 vhost…