Building Jaxer

Prerequisites

We have built Jaxer on the following platforms

  • Windows (32bit)
  • Mac (Universal)
  • Linux: Ubuntu, CentOS, Fedora and Debian
  • Open Solaris

Linux Distro-Specific Setup Notes

Get Jaxer Source

You can get the source at http://aptana.com/jaxer/download

The source code version number is included in a top level folder inside the download, like 1.0.0.4284. In these instruction, this folder is referred to as the [JAXER_SRC_ROOT].

Build libevent (not needed on Windows)

$cd [JAXER_SRC_ROOT]/products/server/src/libevent/libevent-1.4.2-rc 
$./configure
$make

When building on Mac OS X, you need to set the CFLAGS environment to "-arch ppc -arch i386" before building. You do not need to install libevent. The build process will simply pick up the library. If you have libevent already installed and would prefer to use it, though, you'll need to modify some of the build scripts to make the build work.

Build Jaxer

First, change directories to [JAXER_SRC_ROOT]/products/server/src/mozilla; in this folder you'll see a few files called .mozconfig-*.

Second, copy the file appropriate for your OS to .mozconfig (use the .mozconfig-*_crs file instead in order to generate debug symbols):

  • $cp .mozconfig-linux .mozconfig
  • $cp .mozconfig-linux64 .mozconfig
  • $cp .mozconfig-win32 .mozconfig
  • $cp .mozconfig-mac-universal .mozconfig
  • $cp .mozconfig-solaris .mozconfig

Third, run MAKE (except on OpenSolaris, use gmake instead):

$make -f client.mk build

The most common reason for build failure is that you don't have all the required software installed/configured.

The built results are under ./ff-release/dist/bin. This is equivalent to the jaxer folder of the standard Jaxer install (with a few items not yet in place).

Build mod_jaxer

You need this for Apache (v2.2 and v2.0) to talk to Jaxer. In the standard install, mod_jaxer is in the jaxer/connectors folder.

On Windows

Switch to [JAXER_SRC_ROOT]/products/server/src/connectors/apache/apache-modules/mod_jaxer, where you'll find an sln file for Visual Studio 2005 for building mod_jaxer; pick release20 for apache 2.0, and release for apache 2.2.

The result is ./Release/mod_jaxer.so (for apache 2.2) or ./Release20/mod_jaxer20.so (for apache2.0).

Copy the compiled mod_jaxer to the connectors folder (create the folder if it isn't there already):

$cp -f ./Release/mod_jaxer.so [JAXER_SRC_ROOT]/products/server/src/mozilla/ff-release/dist/bin/connectors/mod_jaxer.so

Other Operating Systems

Switch to [JAXER_SRC_ROOT]/products/server/src/connectors/apache/apache-modules/mod_jaxer

Use the apxs supplied with your Apache installation. If the directory containing apxs is not on your PATH, use the absolute path to the executable.

Apache 2.2

$apxs -c -o mod_jaxer.so *.c

Apache 2.0

$apxs -D_APACHE20 -c -o mod_jaxer.so *.c

Mac universal executable for Apache 2.2

32 bit: $apxs -Wc,-arch -Wc,i386 -Wl,-arch -Wl,i386 -c -Wc,-arch -Wc, ppc -Wl,-arch -Wl,ppc -c -o mod_jaxer.so *.c
64 bit: $apxs -Wc,-arch -Wc,ppc64 -Wl,-arch -Wl,ppc64 -c -Wc,-arch -Wc,x86_64 -Wl,-arch -Wl,x86_64 -c -o mod_jaxer.so *.c

Mac universal executable for Apache 2.0

$apxs -D_APACHE20 -Wc,-arch -Wc,i386 -Wl,-arch -Wl,i386 -c -Wc, -arch -Wc,ppc -Wl,-arch -Wl,ppc -c -o mod_jaxer.so *.c

Copy compiled lib (all non-Windows OSes)

The built mod_jaxer.so is under .libs/.

If apxs complains about undefined functions, you may need to add -I <path to your apache header files> to the apxs command just after -c.

Copy the compiled mod_jaxer to the connectors folder (create the folder if not already present):

$mkdir [JAXER_SRC_ROOT]/products/server/src/mozilla/ff-release/dist/bin/connectors
$cp -f .libs/mod_jaxer.so [JAXER_SRC_ROOT]/products/server/src/mozilla/ff-release/dist/bin/connectors/mod_jaxer.so

Build Servlet Connector

The servlet lets Tomcat talk to Jaxer. In the standard alone install, the 2 war files are under the jaxer/connectors folder.

$cd [JAXER_SRC_ROOT]/products/server/src/connectors/servlet
$./build.sh

The generated war files are under ./products, so you should copy them to the connectors folder (create the folder if not already present):

$mkdir [JAXER_SRC_ROOT]/products/server/src/mozilla/ff-release/dist/bin/connectors
$cp -f ./products/*.war [JAXER_SRC_ROOT]/products/server/src/mozilla/ff-release/dist/bin/connectors/

Pull all the pieces together

You've now compiled all the Jaxer components. The only parts missing are some configuration, which depend on the final Jaxer installation location and how you want Jaxer setup. The simplest way to test your Jaxer build is to use the default installation location since this doesn't require changing the default configuration files (/opt/AptanaJaxer on Linux, /Applications/Aptana_Jaxer on Mac OS X, and <anywhere>\Aptana Jaxer on Windows). The rest of these instructions refer to this folder as [JAXER_INSTALL_ROOT].

You may need root permission to complete some of these instructions, depending on your OS and account privileges.

$mkdir [JAXER_INSTALL_ROOT]

### copy main jaxer stuff
$cp -rL [JAXER_SRC_ROOT]/products/server/src/mozilla/ff-release/dist/bin [JAXER_INSTALL_ROOT]/jaxer

### copy static contents
$cp -rLf [JAXER_SRC_ROOT]/products/server/distro/jam/* [JAXER_INSTALL_ROOT]/ 

### copy start/stop scripts
$cp -rLf [JAXER_SRC_ROOT]/products/server/src/scripts/ [JAXER_INSTALL_ROOT]/scripts

At this point, your [JAXER_INSTALL_ROOT] should be (almost) identical to the standalone Jaxer that can be downloaded from the Aptana website, without the [JAXER_INSTALL_ROOT]/Apache22 folder. You can download a standalone Jaxer and unzip it to a tmp location, and copy the Apache22 folder into [JAXER_INSTALL_ROOT]. The Apache22 folder is only needed for testing your Jaxer build without changing the existing Apache configuration. Once you're familiar with the configuration options, you can configure your Apache to talk to Jaxer instead.

Test Run

After adding the Apache22 from the Jaxer download into [JAXER_INSTALL_ROOT], you can use the scripts in the [JAXER_INSTALL_ROOT]/scripts folder to start and stop Jaxer/apache.

$cd [JAXER_INSTALL_ROOT]/scripts
### Start Apache and Jaxer
$./start.sh

### Stop both
$./stop.sh

On Windows, the startup script is called [JAXER_INSTALL_ROOT]\StartServers.bat.

After Apache and Jaxer are started, you should be able to see the Jaxer start page by opening http://localhost:8081 in your browser.

Linux Distro-Specific Setup Notes

Suggestions

  • The lists that follow are all the packages we had to install for the particular Linux. For the Linux distro you use, the actual packages you need to install may be different.
  • Try to avoid building a package from source unless you don't have a choice since compiling a package may itself require additional packages.
  • You can use the OS's package manager (such as synaptic, yum, apt-get and RPM) to see if you have the necessary packages and versions already.
  • Certain package managers require you to very precisely specify package names but the Mozilla web page(s) don't always list them with the required precision. If so use the package manager's list available command to find/figure out the exact package name(s) to install.

If you don't have JDK 1.5 or later, download JDK 1.5 from http://java.sun.com/javase/downloads/index_jdk5.jsp (jdk-1_5_0_16-linux-amd64.bin). You should be able to use the latest JDK. After download, make the file executable and run it to install. Edit the PATH environment variable so shell can find the correct java and javac (eg export PATH=<JDK-install-dir>/bin:$PATH). After the PATH is set properly, $which java should give <JDK-install-dir>/bin/java.

Centos 5.2/Fedora 9

Install the following packages (yum install <PackageName>):

  • gcc
  • gcc-c++
  • cvs
  • libXt-devel
  • curl-devel (32-bit only)
  • gtk2-devel (32-bit)/gtk2-devel.x86_64 (64-bit)
  • libIDL-devel (32-bit)/libIDL-devel.x86_64 (64-bit)
  • libXcomposite (required to run Jaxer)
  • unixODBC-dev

32-bit: Create this symlink: $ln -s /lib/libexpat.so.0.5 /usr/lib/libexpat.so.1

64-bit: Make libexpat.so.1 available: $ln -s /lib64/libexpat.so.0.5 /usr/lib/libexpat.so.1; $export LD_LIBRARY_PATH=/lib64

Ubuntu 8.10

Packages:

  • build dependencies for Firefox (apt-get build-dep firefox)
  • install libcurl4-openssl-dev
  • unixODBC-dev

Debian Etch/Lenny

Etch: Because of package version requirements we recommend upgrading to Lenny; we haven't been able to get Jaxer compiled on Etch.

Install the following packages:

  • build dependencies for iceweasel (apt-get build-dep iceweasel)
  • libidl-deb
  • libxt-dev
  • libcurl4-openssl-dev (only necessary for 32-bit installs)
  • unixODBC-dev