Building apache 2.2.25 for OS X 10.6, how to compile apr_stat$INODE64?

In order to maintain PCI compliance, I've been trying to upgrade the version of Apache on my 10.6 Xserve from 2.2.22 to 2.2.25. So far, nothing that I've tried has worked. I've gone down an number of blind alleys, but after numerious ./configure changes, countless builds, experiments, and time spent with otool and nm, I think I've figured out what the basic problem is.


Apache 2.2.25 requires an updated version of the APR and APR-UTIL libraries. APR includes a function named apr_stat (the APR equivelent of stat). Here's the problem: In 10.6, the versions of libapr included in 10.6 define two functions: apr_stat and apr_stat$INODE64. This is consistent with Apple's stat and stat$INODE64 functions, that allow 32-bit processes to call the 64-bit stat function and vice versa.


My problem is that when I rebuild the APR and APR-UTIL libraries from apache's source, they only compile apr_stat. There's no apr_stat$INODE64, and any mod_*.so module that uses apr_stat$INODE64 fail to load. Which, by the way, seems to be most of them.


I only see two solutions, but don't know how to proceed with either one.


(a) Is there someway to get Apache's apr-1.4.8 and apr-util-1.5.2 to compile in such a way so it produces both apr_stat and the apr_stat$INODE64 functions? I've grepped the apr source to death and I can't find any compiler switch or configure flag that looks like like what I'm looking for.


(b) I suppose I could also recompile all of the mod_*.so modules, but I'm not sure where to start with that, or even if it's practical.


Any advice or help would be very much appreciated.

Posted on Aug 18, 2013 1:38 PM

Reply
3 replies

Aug 25, 2013 3:38 PM in response to James Bucanek

I was finally able to get Apache 2.2.25 to build and install, but the situation isn't ideal.


Ultimately, I downloaded the version of the apr and apr-util libraries for OS X 10.8.4 <http://opensource.apple.com/release/mac-os-x-1084/>. I copied the source into the http-2.2.25/srclib directory and used the --with-included-apr and --with-included-apr-util ./configure switches. This compiled httpd 2.2.25 against the Apple-patched versions of apr 1.4.5 and apr-util 1.3.12:


cd /Users/redqueen/Documents/Software/httpd-2.2.25

./configure --enable-layout=Darwin --sysconfdir=/private/etc/apache2 --localstatedir=/private/var --with-included-apr --with-included-apr-util --with-suexec-bin=/usr/bin/suexec --disable-authn-file --disable-authn-dbm --disable-authn-anon --disable-authn-dbd --disable-authn-default --disable-authz-host --disable-authz-groupfile --disable-authz-user --disable-authz-dbm --disable-authz-owner --disable-authz-default --disable-auth-basic --disable-include --disable-filter --disable-log-config --disable-env --disable-setenvif --disable-mime --disable-status --disable-autoindex --disable-asis --disable-cgi --disable-negotiation --disable-dir --disable-actions --disable-alias && make clean && make && sudo make install


This isn't ideal, because Apache 2.2.25 should be using apr 1.4.8 and apr-util 1.5.2. When Mavericks is finally released, I'll check to see if they've updated apr and apr-util.

Oct 17, 2013 4:07 PM in response to James Bucanek

I've been having the same problem. I got Apache 2.2.25 to build and install using your fix, but when I try to start it I get the following error:


httpd: Syntax error on line 63 of /private/etc/apache2/httpd.conf: Cannot load /usr/libexec/apache2/mod_authz_owner.so into server: dlopen(/usr/libexec/apache2/mod_authz_owner.so, 10): Symbol not found: _apr_stat$INODE64\n Referenced from: /usr/libexec/apache2/mod_authz_owner.so\n Expected in: flat namespace\n in /usr/libexec/apache2/mod_authz_owner.so


If I comment it out in the httpd.conf file it merely gives me another module that won't load and keeps leading me deeper and deeper into the config files. I believe that the config, make and install compiled erroneously and now the version is corrupted. Any suggestions?


P.S. I'm using Mac OSX 10.8.4


Message was edited by: PECraig

Oct 24, 2013 4:12 PM in response to PECraig

PECraig,


My guess is that you're still missing some pieces, or the pieces are in the wrong place. The "Symbol not found" error is because the Apple version of your (.so) modules are all linked to Apple's special version of apr/apr-util. When Apple compiles their Apache libraries, it includes two versions of the apr_stat function (equivalent to BSD stat()), named apr_stat() and apr_stat$INODE64(), the later being the 64-bit version of the function. This scheme makes it possible to access and correctly use the 64-bit version of the stat() function, which is the only way to get extended 64-bit inode information about a file or filesystem, from a 32-bit program. Conversely, 64-bit programs can still use the legacy 32-bit apr_stat() function, without having to be modified.


If you recompiled the libraries then they should have both the apr_stat and apr_stat$INODE64 symbols in them. You can verify this using the nm command (i.e. nm -arch all /path/to/libapr.dylib | grep apr_stat). If they're both there, the next step would be to make sure you put them in the correct locations and Apache isn't still loading the old libraries.


Also note that I compiled my versions of apr and apr-util directly into the apache binary (using --with-included-apr --with-included-apr-util), so my .so modules will link the copy of apr_stat that's part of the httpd binary image. This might not be necessary, but it seemed to help me.


On the other hand, you might just wait. OS X 10.7 might get updated to a later version of Apache, if it hasn't been already, so Apple might solve your problem for you.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Building apache 2.2.25 for OS X 10.6, how to compile apr_stat$INODE64?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.