You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Fernando Martins <fe...@cmartins.demon.nl> on 2005/11/10 08:20:52 UTC

[users@httpd] combining mod_rewrite with mod_ntlm and fastcgi

Hi,

I have a working apache 1.3 httpd.conf file which uses:

1) mod_rewrite to spot some requests which should be handled by a localhost
zope server and prefix them with zope or zope/CKT/, say http://ckt/file.htm
is rewritten as http://ckt/zope/CKT/file.htm (see the real rules below);

2) mod_ntlm to authenticate http://ckt/zope/CKT/ requests

3) fastCGI to send all http://ckt/zope/ requests to the zope server

I have ntlm configuration in conf.d/mod_ntlm.conf and the remaining in
sysconfig.d/httpd.conf.local, in a virtual host directive.

When I ask for http://ckt/ I get back http://ckt/zope and the page urls have
also prefixed zope. In 1.3, the prefix zope would never come back to the
user but it does with 2.0.

Why is this not working in 2.0? Am I using correctly the web of .conf files?

TIA,
Fernando

This is in 1.3 httpd.conf:

FastCgiExternalServer /srv/www/htdocs/zope -host 127.0.0.1:8081 -pass-header
Authorization

< VirtualHost * >
ServerName ckt.internal.myorg.org
ServerAlias ckt

RewriteEngine on
RewriteLog "/var/log/httpd/rewrite.log"
RewriteLogLevel 9

# don't change the URL if it starts already with /zope/ and stop rewriting
RewriteRule ^/zope/(.*) - [PT,L]

# except for /local which go to Apache (not zope)
RewriteRule ^/local/(.*) - [L]

# make URLs start with /zope to be sent through FastCGI
RewriteRule ^(.*) http://ckt/zope$1
# make URLs access the CKT folder on zope, with exceptions
RewriteRule ^/manage - [PT,L]
RewriteRule ^/Control_Panel/.* - [PT,L]

RewriteRule ^/zope/(.*) http://ckt/zope/CKT/VirtualHostRoot/$1 [PT]

ProxyVia on

< Location /zope>
SetHandler fastcgi-script
< /Location>

# NTLM - single log-on
< Location /zope/CKT>
AuthType NTLM
NTLMAuth on
NTLMAuthoritative on
NTLMDomain INTERNAL
NTLMServer SERVER
Require valid-user
< /Location>

< /VirtualHost>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] combining mod_rewrite with mod_ntlm and fastcgi

Posted by Joshua Slive <js...@gmail.com>.
On 11/10/05, Fernando Martins <fe...@cmartins.demon.nl> wrote:
>
> When I ask for http://ckt/ I get back http://ckt/zope and the page urls have
> also prefixed zope. In 1.3, the prefix zope would never come back to the
> user but it does with 2.0.


> RewriteRule ^(.*) http://ckt/zope$1

I'm not positive I understand your question, but if the problem is
that you get an external redirect rather than an internal
redirect/alias/subrequest, then you may be able to fix it by removing
the http://ckt from the front of your target URLs.  That can cause an
implicit external redirect in mod_rewrite unless the server name lines
up exactly with the URL.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org