logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Building & Member Downloads View previous topic :: View next topic
Reply to topic   Topic: Subversion 1.4 modules for Apache 2.2.4
Author
tdonovan
Moderator


Joined: 17 Dec 2005
Posts: 611
Location: Milford, MA, USA

PostPosted: Wed 14 Feb '07 21:02    Post subject: Subversion 1.4 modules for Apache 2.2.4 Reply with quote

Building the Subversion version 1.4.3 Apache modules to work with Apache 2.2.4 was harder than I expected due to four problems.

I finally have it working reasonably well on Win2000 & WinXP, but with so many changes it warrants some extra testing.

28 March 2008: final binaries are at http://www.apachelounge.com/download/

These are for Apache 2.2.4 built with VC2005sp1 (i.e. the Apache 2.2.4 download here at Apache Lounge) and Subversion version 1.4.3.

For anyone interested in the details, the four problems were:

    1. Berkeley database repositories (--fs-type bdb) are usually created with svnadmin.exe which is built with VC6. VC6 uses a 32-bit binary representation of time, while VC2005 uses a 64-bit representation (time_t).

    Usually this is no problem when binary times are in memory, but bdb stores structures with binary time directly into the database. This causes a libdb44.dll built with VC2005 to be unable to access a database created with a VC6 version.

    I built libdb44.dll version 4.4.20 with the _USE_32BIT_TIME_T preprocessor definition in every project (via a property sheet) to make it compatible with the VC6 time_t definition.

    I edited the header files (db.h and db_cxx.h) which were used by the Subversion build and changed every 'time_t' to '__time32_t' so Subversion would created correctly-sized structures, even though Subversion was otherwise built with the default 64-bit time_t definition.

    2. When you install Subversion, it creates a system environment variable APR_ICONV_PATH which points to the Subversion binary directory.
    This will make mod_dav_svn use the APR libraries in the subversion directory ( APR 0.9.12 ) instead of the Apache APR libraries ( APR 1.2.8 ).

    I changed mod_dav_svn.c to remove the APR_ICONV_PATH variable from the process's environment if it is defined, and APR_ICONV1_PATH has not been defined to override it.
    Code:
    #ifdef WIN32
        errno_t iconv_var_result;
        size_t iconv_var_size = 0;
        char iconv_buff[2];
        iconv_var_result = getenv_s( &iconv_var_size, iconv_buff, sizeof(iconv_buff), "APR_ICONV1_PATH");
        if (iconv_var_size == 0)    // if there is not an APR_ICONV1_PATH variable to point to the right iconv
        {
            _putenv_s("APR_ICONV_PATH","");     // make sure the APR_ICONV_PATH env variable doesn't point us to the wrong iconv
        }
    #endif


    3. APR version 1.2.7 does not return file protections from apr_stat correctly unless file ownership is also requested.
    This bug is fixed in Apache 2.2.4/APR 1.2.8 - but I included the workaround in case someone needs to run this with Apache 2.2.3.
    See an earlier note about the "merge" problem in this forum.

    4. libsvn_fs_base\bdb\env.c registers an Apache memory-pool-cleanup to run when the pool is destroyed.
    The pool is a global pool, which is destroyed when Apache shuts down *after* mod_dav_svn is unloaded - so the code in mod_dav_svn is not available causing an access violation.
    This cleanup is not needed in a threaded single-process server (like Apache on Windows), so I commented out the code to register this cleanup from env.c.
    Code:
    /*      apr_pool_cleanup_register(bdb_cache_pool, NULL, clear_cache,
                                  apr_pool_cleanup_null);
    */



Hope this is helpful.

-tom-
Back to top
defeated



Joined: 25 Feb 2007
Posts: 2

PostPosted: Sun 25 Feb '07 22:51    Post subject: Error, Apache won't start Reply with quote

Hi,

I downloaded & extracted the zip file and added the 2 LoadModule calls to my Apache httpd.conf file, but now Apache won't start.

I'm running Windows XP x64, Subversion 1.4.3 and Apache 2.2.4

Any ideas?

Thanks,
Ed C.
Back to top
defeated



Joined: 25 Feb 2007
Posts: 2

PostPosted: Sun 25 Feb '07 23:18    Post subject: Reply with quote

I was running the "stock" binary from Apache.org -- after uninstalling, and downliading & installing the ApacheLounge.com VS2k5-compiled version, this seems to be working now!

Thanks for your efforts,
Sincerely,
Ed C.
Back to top
tdonovan
Moderator


Joined: 17 Dec 2005
Posts: 611
Location: Milford, MA, USA

PostPosted: Mon 26 Feb '07 2:21    Post subject: Reply with quote

Hi Ed,

I'm glad it's working for you now. I've used it extensively since I posted the note and haven't found or heard about any further problems.
Just curious - do you use any "--fs-type bdb" repositories? These required the most effort to get working correctly.

I should have made it clearer that the binaries are only for Apache 2.2.x built with Visual Studio C++ 2005 SP1.
The "stock" Apache binaries from apache.org are built with Visual C++ 6.0.

I think the four fixes in this note and in the earlier note about the "merge" problem are enough to let someone build binaries for a different configuration if they are inclined to.

Problem/fix #1 does not apply when building with Visual C++ 6.0.
Problem/fix #3 is not necessary for Apache 2.2.4 - only Apache 2.2.3 requires it.

-tom-
Back to top
SCTC



Joined: 27 Apr 2007
Posts: 1
Location: Washington State, USA

PostPosted: Fri 27 Apr '07 1:39    Post subject: Reply with quote

My thanks to you, Tom, and the rest of the crew responsible for this site. Your rebuild of Apache & SVN modules saved me hours of setup and debug of a development environment, and allowed me to get web-accessible SVN up and running in under a day. Now I'm off to get the authorization bits in place.
Back to top


Reply to topic   Topic: Subversion 1.4 modules for Apache 2.2.4 View previous topic :: View next topic
Post new topic   Forum Index -> Building & Member Downloads