Apache HTTP Server 設定札記

From JiaYun
Jump to: navigation, search

Contents

共通

簡易 Reverse Proxy 設定

  • 啟用相關 module
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so
  • 設定 foo 目錄轉到 www.example.com 的 foo
<IfModule proxy_module>
ProxyPass  /foo/  http://www.example.com/foo/
ProxyPassReverse /foo/ http://www.example.com/foo/
</IfModule>
  • 加上驗證
<IfModule proxy_module>
ProxyPass  /foo/  http://www.example.com/foo/
ProxyPassReverse /foo/ http://www.example.com/foo/
<Proxy http://www.example.com/foo/>
  AuthType Digest
  AuthName "XXX"
  AuthDigestDomain /foo/
 
  AuthDigestProvider file
  AuthUserFile "C:\...\XXX.digest_pw"
  Require valid-user
 
  # 避免驗證資訊被轉到 www.example.com
  RequestHeader unset Authorization
</Proxy>
</IfModule>

Windows

Log Rotate

CustomLog "|bin/rotatelogs.exe logs/access.log 86400" common


Personal tools