You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Petr Hracek <ph...@gmail.com> on 2010/04/26 10:36:40 UTC
[users@httpd] My own module, authorization and Proxy
Hello *,
In my Apache2 (2.2.3) configuration file I have:
<VirtualHost _default_:443>
SSLEngine on
SSLProxyEngine on
DocumentRoot "/opt/apache/htdocs/ssldocs"
ProxyPass /PAC/ http://192.168.187.101:8080/PACCBAdmin
ProxyPassReverse /PAC/ http://192.168.187.150:8080/PACCBAdmin/
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]
RewriteMap unity txt:/opt/apache/conf/unity.map
RewriteRule ^/([^/]+)$ ${unity:$1|/$1} [L]
RewriteRule ^/([^/]+)/(.*) ${unity:$1|/opt/apache/htdocs/ssldocs/$1}/$2 [L]
RewriteRule ^/PAC$ http://192.168.187.150:8080/PACCBAdmin [P]
RewriteRule ^/PAC/(.*) http://192.168.187.150:8080/PACCBAdmin/$1 [P]
RewriteLog "/var/log/apache2/rewrite_log"
RewriteLogLevel 3
<IfModule mod_authz_host.c>
<Directory />
Options +Indexes +Multiviews
AuthType MSEC
require valid-user
satisfy Any
</Directory>
</IfModule>
<Location "/PAC/">
ProxyPassReverseCookiePath /PACCBAdmin /PAC
AuthType MSEC
require valid-user
</Location>
</VirtualHost>
In the my modules which takes care about AAA, Security issues, etc.
I would like to do something like:
when user add to the URL following https://<ip_address>/PAC/
then first of all they should enter username/password authorization and
afterwards proxy page is opened. Authorization is done over AuthType MSEC in
my own module
When the RewriteRules are done as above then URL https://<ip_address>/PAC/
is authorized by my module
but page which is shown in browser is HTTP 404.
When the RewriteRule:
RewriteRule ^/PAC$ http://192.168.187.150:8080/PACCBAdmin [P]
RewriteRule ^/PAC/(.*) http://192.168.187.150:8080/PACCBAdmin/$1 [P]
is moved before
RewriteRule ^/([^/]+)/(.*) ${unity:$1|/opt/apache/htdocs/ssldocs/$1}/$2 [L]
then username/password page is not shown but /PAC/ URL is working (but
without authoziation.
As I found in the RewriteRule instead of row
RewriteRule ^/([^/]+)/(.*) ${unity:$1|/opt/apache/htdocs/ssldocs/$1}/$2 [L]
which means that this RewriteRule is last should be something else.
Could you please help me with that issue
Thank you in advance
--
Best Regards / S pozdravem
Petr Hracek