There are many configuration options that allow you to customize your AxKit installation, but in this section we aim to get you started as quickly and simply as possible. This appendix assumes you already have mod_perl and Apache installed and working. See Chapter 3 if this is not the case. This section does not cover installing AxKit on Win32 systems, for which there is an ActiveState package at

First download the latest version of AxKit, which you can get either from your local CPAN archive or from the AxKit download directory at Then type the following:

panic% gunzip -c AxKit-x.xx.tar.gz | tar xvf -
panic% cd AxKit-x.xx.tar.gz
panic% perl Makefile.PL
panic% make
panic% make test
panic% su
panic# make install

If Perl's Makefile.PL warns you about missing modules, notably XML::XPath, make a note of the missing modules and install them from CPAN. AxKit will run without the missing modules, but without XML::XPath it will be impossible to run the examples in this appendix.[64]

[64]AxKit is very flexible in how it lets you transform the XML on the server, and there are many modules you can plug in to AxKit to allow you to do these transformations. For this reason, the AxKit installation does not mandate any particular modules to use. Instead, it will simply suggest modules that might help when you install AxKit.

Now we need to add some simple options to the very end of our httpd.conf file:

PerlModule AxKit
SetHandler perl-script
PerlHandler AxKit
AxDebugLevel 10
PerlSetVar AxXPSInterpolate 1

This configuration makes it look as though AxKit will deliver all of your files, but don't worry: if it doesn't detect XML at the URL you supply, it will let httpd deliver the content. If you're still concerned, put all but the first configuration directive in a <Location> section. Note that the first line, PerlModule AxKit, must appear in httpd.conf outside of any runtime configuration blocks. Otherwise, Apache cannot see the AxKit configuration directives and you will get errors when you try to start httpd.

Now, assuming you have XML::XPath installed (try perl -MXML::XPath -e0 on the command line to check), restart Apache. You are now ready to begin publishing transformed XML with AxKit!