Compiling svn + httpd for windows python 2.x
From: Cooke, Mark <mark.cooke_at_siemens.com>
Date: Wed, 22 Jun 2016 10:46:21 +0000
Folks,
We use subversion with Trac behind httpd on Windows Server. As Trac is written in "old" Python (2.x), I have had to resort to building everything from source. This is not simple and so I thought I would publish my notes here in case it helps anyone else and in the hope that if I have made any mistakes, someone will be kind enough to point them out to me!
~ Mark C
These are my notes for building Apache httpd and subversion for use with Trac [1]. All of the components need to be built using the same compiler to avoid run-time issues and, since Trac currently relies on Python 2.x, that means Visual Studio 2008.
Pre-requisites
[2] https://www.python.org/downloads/
Folders
===============================================================================
1) Apache httpd
Download the latest httpd source tarball: https://httpd.apache.org/download.cgi
-------------------------------------------------------------------------------
Download from: https://apr.apache.org/download.cgi
Unpack the archives to the * httpd\srclib * folder:
Remember to remove the version numbers from the folder names!
Note: last I tried, apr 1.5.2 causes a number of build errors:
-------------------------------------------------------------------------------
Download the latest OpenSSL source: http://www.openssl.org/source/
Unpack the source to the srclib folder:
See also: http://wiki.openssl.org/index.php/Compilation_and_Installation
-------------------------------------------------------------------------------
Unpack the PCRE (Perl Compatible Regular Expressions) to the srclib folder:
-------------------------------------------------------------------------------
Run `lineends.pl` from the root folder to convert line endings from *nix to
{{{
-------------------------------------------------------------------------------
Run the following in a * Visual Studio * command prompt window...
-------------------------------------------------------------------------------
[from http://wiki.greenstone.org/doku.php?id=en:developer:compiling_apache]
- Read `srclib/pcre/NON-AUTOTOOLS-BUILD`
- From the output folder (e.g. srclib\pcre):
-------------------------------------------------------------------------------
** First ** convert the project files (this avoids lots of RC errors about
** Second ** clear out (rename?) any old \apache24 folder...
The command-line build did not work, so open the `apache.dsw` file:
*******
Copy and edit the "autoindex" project file:
- Edit the vcxproj file:
(Re)Start Visual Studio ("start apache.sln")...
-------------------------------------------------------------------------------
The InstallBin target should create an Apache24 folder in the root, containing
Copy the mod_wsgi module to the output folder:
===============================================================================
Primary resources:
Blogs:-
Download the latest sources:
D:\svn\serf
- serf: http://serf.apache.org/download
-------------------------------------------------------------------------------
Extract zlib source to \svn\zlib
Note 1: last I looked there were bugs with the MS ASM build => not using asm.
edit D:\svn\zlib\contrib\vstudio\vc9\zlibstat.vcproj:
(see: D:\svn\zlib\contrib\vstudio\readme.txt)
-------------------------------------------------------------------------------
Extract serf source to \svn\serf
Build from VS cmd window (requires SCons to be installed):
-------------------------------------------------------------------------------
Extract the sqlite "amalgamation" source to \svn\sqlite
-------------------------------------------------------------------------------
Unpack the ZIP archive into D:\svn\src
Configure:
Open the subversion_vcnet solution file ("start subversion_vcnet.sln"):
This resulted in instances of [3] errors:-
...and all come from bindings I do not need (and am not configured to build).
--- Run the tests (copy most of the following to e.g. "run-tests.bat")... {{{ cd \svn\src setlocal set path=%path%;d:\Apache24\bin set path=%path%;d:\svn\httpd\srclib\apr\Release set path=%path%;d:\svn\httpd\srclib\apr-util\Release set path=%path%;d:\svn\httpd\srclib\apr-iconv\Release win-tests.py --release --cleanup --parallel win-tests.py -r -c --httpd-dir=d:\Apache24 --httpd-daemon }}} ------------------------------------------------------------------------------- 14) Python bindings... http://www.lejordet.com/2009/03/compiling-subversion-python-bindings-on-windows/ ...or: D:\svn\src\subversion\bindings\swig\INSTALL These should have built Ok but need to be collected together for installation. A) Create a <py-bind>\svn folder somewhere and copy: - svn\src\subversion\bindings\swig\python\svn\*.py B) Create a <py-bind>\libsvn folder and copy: - svn\src\subversion\bindings\swig\python\*.py - svn\src\Release\subversion\bindings\swig\python\*.pyd - svn\src\Release\subversion\bindings\swig\python\libsvn_swig_py\*.dll These files should be installed to the server:- - C:\Python27\Lib\site-packages\(lib)svn {{{ cd \svn\src mkdir \Apache24\python\svn copy subversion\bindings\swig\python\svn\*.py \Apache24\svn\svn mkdir \Apache24\python\libsvn copy subversion\bindings\swig\python\*.py \Apache24\svn\libsvn copy Release\subversion\bindings\swig\python\*.pyd \Apache24\svn\libsvn copy Release\subversion\bindings\swig\python\libsvn_swig_py\*.dll \Apache24\svn\libsvn }}} =============================================================================== Installation ...is mainly left for the user to match their local systems. Copy the required files: - Apache httpd - remember to exclude the *.pdb files (if not required) - should already include mod_wsgi - Subversion (main) - D:\svn\src\Release\*.dll - D:\svn\src\Release\subversion\*\svn*.exe (except `svndiff-test.exe`) - D:\svn\src\Release\tools\*\svnauthz*.exe (from server-side) - Subversion (Python bindings) - \Apache24\python (see 13 above) copied to server's python Lib\site-packages folder - Subversion (httpd modules) - D:\svn\src\Release\*.so (to apache \modules folder) Now you "just" need to install the httpd service and fix the httpd "conf" files as well as set appropriate folder permissions etc. as required by local policy. (end)Received on 2016-06-22 12:46:46 CEST |
This is an archived mail posted to the Subversion Users mailing list.
This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.