LoginSignup
8
7

More than 5 years have passed since last update.

mod_proxy_ajp + mod_proxy_balancer + mod_rewrite 併用時に Tomcat が処理するリソースにApache側で認証をかける

Last updated at Posted at 2013-04-08

静的コンテンツをApache、動的コンテンツをTomcatに役割分担していると、動的コンテンツ側で認証がかからなかったので、対応のメモ。

<Direcoty>の中で ajp にrewriteしてやるのがポイント。

Alias / /var/tomcat/web/1/webapps/
<Directory "/var/tomcat/web/1/webapps">
    Allow from all
    AllowOverride AuthConfig
    RewriteRule ^(.+)\.jsp(.+)? balancer://ajp-balancer2/$1.jsp$2 [P,L]
    RewriteRule ^(.+)\.json(.+)? balancer://ajp-balancer2/$1.json$2 [P,L]
</Directory>
8
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
7