I've written some software that uses Perl code running inside Apache (using mod_perl) to work with (amongst other things) subversion (using the mod_dav_svn module).
I'm currently writing some how-to docs on how to get this set up and running on various OSs and I've run into problems on Solaris.
- The Apache2 server that ships with Solaris10 has mod_perl but not mod_dav_svn - I can't find a binary svn package built against this apache.
- Sunfreeware has subversion and apache 2.2 packages that work together but not mod_perl.
- Various binary subversion packages (eg Collabnet) include apache but not mod_perl.
It seems that my option is to build either mod_perl or subversion from source, which is something I was really hoping to avoid as I'm trying to make the install instructions as non-technical as possible.
So, is there a binary package available that lets me get mod_perl and mod_dav_svn running in the same Apache on Solaris 10 that I've missed?
Failing that, if there's anyone who has had to do this before, would they like to comment on which of building svn or building mod_perl is going to be the smallest headache.
Building packages from source in general is a pain, but once it's done, you can use it to make a package and provide binaries yourself and save others the trouble of doing so for your project.
I've only done subversion myself rather than mod_perl, but I've taken a look at the build script we use for mod_perl (sadly it's very specific to our environment and wouldn't be of much use to you) and it looks like mod_perl will be the easiest option, as it has fewer dependencies (just perl and apache).
Building mod_perl looks to be as simple as
perl Makefile.PL MP_APXS=/path/to/your/apache/bin/apxs; make; make install
.Subversion, on the other hand requires at least apr and apru, and depending on your requirements, other dependencies (e.g. we build with python bindings for trac). If you decide to compile subversion, you probably want to disable as many of the dependencies as possible (e.g. if you don't need berkely db support, pass
--without-berkley-db
to configure). If configure complains about a missing dependency, decide if you need it, and just add--without-featurex
if you don't need it.You'll need to have apr and apru built first (or binary packages installed), and pass the
--with-apr=/some/path
and--with-apr-util=/some/path
options (both are paths to the apr/apu-1-config file, located in the bin directory).Getting SSL support working might take some work also, as the solaris ssl libraries are in a location that isn't normally detected. Make sure you have
-I/usr/sfw/include
in your CFLAGS environment variable and-L/usr/sfw/lib -R/usr/sfw/lib
(or /usr/sfw/lib/amd64 or sparcv9 if you want 64 bit) in your LDFLAGS environment variable. Both variables need to be set before running configure. If you're building 32-bit, you might be able to get away with just doing--with-ssl=/usr/sfw
, but it's not likely that subversion will find the 64 bit libraries correctly if you require a 64 bit version without you setting the CFLAGS/LDFLAGS correctly.As with building mod_perl, you'll need to let subversion know where apxs is, just pass
--with-apxs=/path/to/apache/bin/apxs
to configure.This last tip is probably obvious, but just in case: make the build instructions into a script (or Makefile) so you can easily repeat them on new machines or with slightly different configure options.
Just answering here to record what worked for me, following on from Mark's very helpful answer.
Since compiling mod_perl looked like less of a hassle than compiling Subversion I installed Subversion 1.6 and its dependencies (which include Apache 2.2.15) from sunfreeware.com.
Then I downloaded and built mod_perl as per the instructions.
I did have to edit
/usr/local/apache2/bin/apxs
because it assumed perl was in/usr/local/bin
instead of/usr/bin
but after that it compiled everything and putmod_perl.so
in the right place.The other small gotcha with installing Perl modules against the standard Perl 5.8 included with Solaris is that it was compiled using the Sun compiler, not gcc and you run into less troubles if you download and use that instead (make sure it's bin directory is before gcc on your path).
I've just become aware that the OpenCSW packages might be another solution. They appear to have binary apache, mod_perl and subversion packages. I haven't tried them yet, though.
Simply use Web Stack, Sun's integrated compilation of these products (you can selectively install what you need):
Complete howto here: http://wikis.sun.com/display/WebStack/Web+Stack+Getting+Started+Guide