Re: Cannot compile mod_disk_cache.c (rev. 821993)
On Thu, Oct 8, 2009 at 1:44 PM, Alexander Alfimov wrote: > Hi! > > I'm trying to compile mod_cache which was checked out from > http://svn.apache.org/repos/asf/httpd/httpd/trunk/modules/cache about > an hour ago: > [r...@dev38 mod_cache]# svn info > Path: . > URL: http://svn.apache.org/repos/asf/httpd/httpd/trunk/modules/cache > Repository Root: http://svn.apache.org/repos/asf > Repository UUID: 13f79535-47bb-0310-9956-ffa450edef68 > Revision: 823208 > Node Kind: directory > Schedule: normal > Last Changed Author: minfrin > Last Changed Rev: 821993 > Last Changed Date: 2009-10-05 16:27:19 -0400 (Mon, 05 Oct 2009) > > I was able to compile mod_cache.c, but got stuck with > mod_disk_cache (mod_cache doesn't seem to be working with the old > mod_disk_cache I had). > > Command I've used: > [r...@dev38 mod_cache]#/usr/sbin/apxs -c mod_disk_cache.c > /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -prefer-pic > -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack- > protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DLINUX=2 - > D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/include/httpd -I/usr/ > include/apr-1 -I/usr/include/apr-1 -c -o mod_disk_cache.lo > mod_disk_cache.c && touch mod_disk_cache.slo > mod_disk_cache.c: In function 'open_entity': > mod_disk_cache.c:380: error: 'core_dir_config' undeclared (first use > in this function) Try adding "#define CORE_PRIVATE" inside mod_disk_cache.c prior to the inclusion of header files. What you've encountered is an API difference between httpd 2.2 and 2.3-dev. There may be others that show up at compile, link, or run-time. (Maybe somebody here has actually used recent mod*cache from trunk with 2.2 and can comment.) I guess you're anxious to try a fix that is in svn trunk but not in the 2.2.x branch? I wonder if backporting the individual fix is less troublesome...
Re: Cannot compile mod_disk_cache.c (rev. 821993)
Jeff Trawick писал(а) в своём письме Thu, 08 Oct 2009 21:15:51 +0300: Try adding "#define CORE_PRIVATE" inside mod_disk_cache.c prior to the inclusion of header files. What you've encountered is an API difference between httpd 2.2 and 2.3-dev. There may be others that show up at compile, link, or run-time. (Maybe somebody here has actually used recent mod*cache from trunk with 2.2 and can comment.) I guess you're anxious to try a fix that is in svn trunk but not in the 2.2.x branch? I wonder if backporting the individual fix is less troublesome... Jeff, Thank you very much for the quick response. Adding a CORE_PRIVATE did a trick -- I was able to compile mod_disk_cache.c Unfortunately, this didn't help to solve the root problem. I want to try the "CacheQuickHandler Off" directive which became available in Apache 2.3 Here is my mod_cache configuration: CacheDefaultExpire 120 CacheMaxExpire 120 CacheIgnoreNoLastMod On CacheIgnoreHeaders On CacheIgnoreCacheControl On CacheStoreNoStore On CacheStorePrivate On CacheQuickHandler Off CacheRoot /tmp/apache-cache-l2 CacheEnable disk / CacheDirLevels 8 CacheDirLength 2 As soon as I disable the CacheQuickHandler, caching stops working (no new directories appear in the cache directory). Thank you. -- Best Regards, Alexander Alfimov
Re: Cannot compile mod_disk_cache.c (rev. 821993)
Graham Leggett писал(а) в своём письме Fri, 09 Oct 2009 01:30:30 +0300: Alexander Alfimov wrote: I want to try the "CacheQuickHandler Off" directive which became available in Apache 2.3 Use the patches attached, these are what we use against v2.2, and what I plan to ultimately propose for backport to v2.2 once it sees more testing. Apply them in this order: # thundering herd lock Patch4: http://people.apache.org/~minfrin/httpd-cache-thundering.patch # cache quick handler patch Patch5: httpd-cache-quick-821552.patch Patch6: httpd-cache-quick-821202.patch Patch7: httpd-cache-quick-821301.patch The second set of patches won't apply cleanly unless you apply the thundering herd lock patch, which is why I have included it here. Please feed back any issues you find, I will definitely take a look. Regards, Graham -- Graham, I assume I can apply patches to this code: http://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x/modules/cache/ Please advise if this is incorrect. Thank you. -- Best Regards, Alexander Alfimov
Re: Cannot compile mod_disk_cache.c (rev. 821993)
Alexander Alfimov wrote: > I assume I can apply patches to this code: > http://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x/modules/cache/ Apply the patches to the base of httpd v2.2.14, like this: cd httpd-2.2.14 cat .patch | patch -p0 Regards, Graham -- smime.p7s Description: S/MIME Cryptographic Signature
Re: Cannot compile mod_disk_cache.c (rev. 821993)
Hi! I have applied patches to the 2.2.14 sources. I've copied mod_cache.so and mod_disk_cache.so to the apache modules directory. The problem is NOT solved. As soon as I add CacheQuickHandler Off to the cache configuration, the servers stops caching (new directories aren't appearing in cache folder). Please advise. Thank you. Graham Leggett писал(а) в своём письме Fri, 09 Oct 2009 15:36:56 +0300: Alexander Alfimov wrote: I assume I can apply patches to this code: http://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x/modules/cache/ Apply the patches to the base of httpd v2.2.14, like this: cd httpd-2.2.14 cat .patch | patch -p0 Regards, Graham -- -- Best Regards, Alexander Alfimov
Re: Cannot compile mod_disk_cache.c (rev. 821993)
I forgot to add that I have a ProxyPass directive in the same config. I.e. I'm trying to build caching proxy with mod_rewrite on the "front". It looks like mod_proxy is run before the mod_cache. Please advise. Thank you. Alexander Alfimov писал(а) в своём письме Thu, 15 Oct 2009 01:47:30 +0300: Hi! I have applied patches to the 2.2.14 sources. I've copied mod_cache.so and mod_disk_cache.so to the apache modules directory. The problem is NOT solved. As soon as I add CacheQuickHandler Off to the cache configuration, the servers stops caching (new directories aren't appearing in cache folder). Please advise. Thank you. Graham Leggett писал(а) в своём письме Fri, 09 Oct 2009 15:36:56 +0300: Alexander Alfimov wrote: I assume I can apply patches to this code: http://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x/modules/cache/ Apply the patches to the base of httpd v2.2.14, like this: cd httpd-2.2.14 cat .patch | patch -p0 Regards, Graham -- -- Best Regards, Alexander Alfimov