httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Igor Cicimov <icici...@gmail.com>
Subject Re: [users@httpd] Re: Apache 2.4: Mod Cache: authorization required
Date Thu, 21 Feb 2013 07:37:24 GMT
On 18/02/2013 10:55 PM, "Nicolas Daniels" <nicolas.daniels@swing.be> wrote:
>
> Hello,
>
> Ok I figured out how to allow caching for authenticated urls: adding
"Cache-Control" header with public option do the trick.
>
Isnt it what CacheStorePrivate is for?

> Now I still have the problem that the cache key is built upon the url
BEFORE the rewrite occurs.
>
> Is it possible to change this behavior ?
>
> I tried with
>
> AddOutputFilterByType  REWRITE;CACHE  text/html
>
> But rewrite is not a filter (or I don't have the appropriate name).
>
> Thanks,
>
> Nicolas
>
>
>
> On 14/02/2013 16:41, Nicolas Daniels wrote:
>>
>> Hi all,
>>
>> I'm trying hard to configure mod_cache with mod_cache_disk and apache
2.4, without real success.
>>
>> I'm able to enable cache for public files (no authentication), but not
for private ones. From my understanding, setting |CacheQuickHandler to off
|should have done the trick, but it keeps complaining in the logs:
>>
>> [Thu Feb 14 15:20:18.997941 2013] [cache:debug] [pid 18018:tid
140317277726464] mod_cache.c(1073): [client xxxxxxxx] AH00768: cache:
/file/files/test.txt not cached. Reason: Authorization required
>>
>> Looking around for a solution to this problem, I found also another one:
cache key is computed before rewrite rule applies, which will lead to
issues as I'm rewriting the logged use in the url.
>>
>> My config (part of):
>>
>> <DirectoryMatch "^/vsite/file/.*$">
>> AuthType Digest
>> AuthName "bla"
>> # To cache credentials, put socache ahead of dbd here
>> AuthDigestProvider socache dbd
>> # Also required for caching: tell the cache to cache dbd lookups!
>> AuthnCacheProvideFor dbd
>> AuthnCacheContext blabla
>>
>> Require valid-user
>> AuthDBDUserRealmQuery "SELECT digestpwd FROM user WHERE name= %s"
>> </DirectoryMatch>
>>
>> RewriteCond %{REQUEST_METHOD} GET
>> RewriteCond %{LA-U:REMOTE_USER} ([0-9]+)
>> RewriteRule ^/file/(.*) /data/%1/$1 [L]
>>
>> <IfModule mod_cache.c>
>> <IfModule mod_cache_disk.c>
>> LogLevel cache:trace8
>> CacheQuickHandler off
>> CacheRoot /tmp/apachecache
>> CacheEnable disk /
>> CacheDefaultExpire 120
>> CacheIgnoreURLSessionIdentifiers jsessionid JSESSIONID
>> </IfModule>
>> </IfModule>
>>
>> Any way to get around those problems ?
>>
>> Thanks a lot for your help !
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>

Mime
View raw message