Mailing List Archive

Fwd: Cannot compile mod_disk_cache.c (rev. 821993)
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:

[root@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:
[root@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)
mod_disk_cache.c:380: error: (Each undeclared identifier is reported
only once
mod_disk_cache.c:380: error: for each function it appears in.)
mod_disk_cache.c:380: error: 'coreconf' undeclared (first use in this
function)
mod_disk_cache.c:380: error: 'core_module' undeclared (first use in
this function)
mod_disk_cache.c:482: error: 'ENABLE_SENDFILE_OFF' undeclared (first
use in this function)
apxs:Error: Command failed with rc=65536

[root@dev38 mod_cache]# /usr/sbin/apachectl -v
Server version: Apache/2.2.3
Server built: Aug 6 2007 07:22:24
[root@dev38 mod_cache]# /usr/sbin/apachectl -V
Server version: Apache/2.2.3
Server built: Aug 6 2007 07:22:24
Server's Module Magic Number: 20051115:3
Server loaded: APR 1.2.7, APR-Util 1.2.7
Compiled using: APR 1.2.7, APR-Util 1.2.7
Architecture: 64-bit
Server MPM: Prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=128
-D HTTPD_ROOT="/etc/httpd"
-D SUEXEC_BIN="/usr/sbin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="logs/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"

Would be grateful for any help or advise.

Thank you.

--
Best Regards,
Alexander Alfimov
Re: Cannot compile mod_disk_cache.c (rev. 821993) [ In reply to ]
On Thu, Oct 8, 2009 at 1:44 PM, Alexander Alfimov <a.alfimov@gmail.com> 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:
> [root@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:
> [root@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) [ In reply to ]
Jeff Trawick <trawick@gmail.com> писал(а) в своём письме 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

<IfModule mod_disk_cache.c>
CacheRoot /tmp/apache-cache-l2
CacheEnable disk /
CacheDirLevels 8
CacheDirLength 2
</IfModule>

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) [ In reply to ]
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
--
Re: Cannot compile mod_disk_cache.c (rev. 821993) [ In reply to ]
Graham Leggett <minfrin@sharp.fm> писал(а) в своём письме 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) [ In reply to ]
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 | patch -p0

Regards,
Graham
--
Re: Cannot compile mod_disk_cache.c (rev. 821993) [ In reply to ]
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 <minfrin@sharp.fm> писал(а) в своём письме 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 | patch -p0
>
> Regards,
> Graham
> --


--
Best Regards,
Alexander Alfimov
Re: Cannot compile mod_disk_cache.c (rev. 821993) [ In reply to ]
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 <a.alfimov@gmail.com> писал(а) в своём письме 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 <minfrin@sharp.fm> писал(а) в своём письме 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 | patch -p0
>>
>> Regards,
>> Graham
>> --
>
>


--
Best Regards,
Alexander Alfimov