4

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.

AndrewR
  • 432
  • 2
  • 10

4 Answers4

2

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.

Mark
  • 2,846
  • 19
  • 13
1

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 put mod_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).

AndrewR
  • 432
  • 2
  • 10
0

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.

AndrewR
  • 432
  • 2
  • 10
-1

Simply use Web Stack, Sun's integrated compilation of these products (you can selectively install what you need):

The Web Stack software includes the following software:

  1. Server Software - Apache Web Server, Apache Tomcat, Squid Proxy Server, lighttpd.
  2. DB Software - MySQL Server.
  3. Programming Environment - PHP, Perl, Ruby, and Python.
  4. Caching Software - memcached.

Complete howto here: http://wikis.sun.com/display/WebStack/Web+Stack+Getting+Started+Guide

weeheavy
  • 4,039
  • 1
  • 27
  • 41
  • I can find no evidence in the docs that these packages include subversion modules. Are you sure? Remember that this is Solaris, not OpenSolaris. – AndrewR Jul 09 '10 at 23:29
  • Unfortunately there's no subversion module in Web Stack. (BTW the howto is for Solaris 10, OpenSolaris and RHEL.) – weeheavy Jul 12 '10 at 12:15