I’m a huge fan of Resin, the superb Java servlet container from Caucho. But getting it to run as an Apache module under Gentoo Linux required a bit of sleuthing.



Part of the beauty of Gentoo is its package management system called Portage. Portage manages the building of packages from source, using a sophisticated dependency scheme and flexible scripts for retrieving and installing apps and components. Getting apache 1 or 2 is easy, as is Resin:

emerge resin

But when I wanted to add Resin’s mod_caucho connector for Apache, I ran into the problem of not having an ebuild script available for it. So here are the steps that worked for me:

  1. Download sources from the Caucho site (I put mine in /usr/local/src).
  2. Add a symlink so the configure script will work and run it:
        # cd /usr/sbin
        # ln -s apache httpd
        # cd /usr/local/src/resin-2.1.11      [or wherever you put it]
        # ./configure --with-apxs
        # make
        # make install
    
  3. Edit /etc/apache/conf/apache.conf to make sure the CauchoConfigFile directive points to the correct resin.conf (I wanted it to point to the /opt/resin/conf one set up by the original ebuild, not the one resulting from my src build)
  4. Start up apache and resin:
        # /etc/init.d/resin start
        # /etc/init.d/apache start
    
  5. Hit the caucho-status page at http://127.0.0.1/caucho-status to make sure the connector’s working.

For the record, I used Apache 1.3.28 and Resin 2.1.9 ebuilds, but I had to use the Resin 2.1.11 src from Caucho to build the mod_caucho.so file.

With these steps, the process was pretty smooth and appears to work well. Hopefully someone will create an ebuild for the connector soon.

Related posts:

  1. Installing PHP4 under Apache for Windows