Sat Oct 16 21:55:43 2004

AxKit Configuration Example:

Here is a small excerpt from httpd.conf which will give you a nice base for playing with AxKit.

Note: This example is for AxKit 1.6. With previous versions, you will have to tell Apache that .xml/.xsp/.dkb/... files are XML via the AddType directive.

The only line that must be in httpd.conf is "PerlModule AxKit". The rest may appear in .htaccess files if your web server is configured to read them.

# enable AxKit processing
PerlModule AxKit
AddHandler axkit .xml .xsp .dkb .ax

# enable various transform modules - this assumes you use libxslt, not sablotron
AxAddStyleMap text/xsl Apache::AxKit::Language::LibXSLT
AxAddStyleMap application/x-xsp Apache::AxKit::Language::XSP
AxAddStyleMap application/x-xpathscript Apache::AxKit::Language::XPathScript

# uncomment this to gzip all output - faster transfer
# AxGzipOutput On
# if you are playing with your config files a lot, use this:
# AxNoCache On

# add some nice taglibs - leave out if you don't have them installed
AxAddXSPTaglib AxKit::XSP::Util
AxAddXSPTaglib AxKit::XSP::PerForm
AxAddXSPTaglib AxKit::XSP::Exception

That's it. Modify the list of taglibs as you like, and be sure to look at "perldoc AxKit" (available online), there are lots of other config directives.

Especially consider using the various AxAdd*Processor directives, since it will make your life a lot easier than specifying them with processing instructions.

Full-Featured example

If you use AxKit a lot (like me :-) and want all your virtual hosts to have all features of AxKit usable, you can try this configuration. Put it into httpd.conf at the top level (outside of any <VirtualHost> or <Directory>/<Location>/... section), then all your vhosts start out decently preconfigured.

# Of course ;-)
PerlModule AxKit

# backwards compatibility with legacy charsets. ISO-8859-15 is for west europeans
AxExternalEncoding ISO-8859-15

# always handle these extensions
AddHandler AxKit .xsp .xml .dkb .xhtml
# recommended style mapping
AxAddStyleMap text/xsl Apache::AxKit::Language::LibXSLT
AxAddStyleMap application/x-xsp Apache::AxKit::Language::XSP
AxAddStyleMap application/x-xpathscript Apache::AxKit::Language::XPathScript

# useful misc. settings
AxGzipOutput On
AxCacheDir /usr/local/apache/cache
# debugging aid - leave out on production systems
AxDebugLevel 1
AxTraceintermediate /tmp/trace
AxErrorStylesheet text/xsl file:///etc/apache/error.xsl
AxStackTrace On

# all the common taglibs - you need to install them separately
AxAddXSPTaglib AxKit::XSP::WebUtils
AxAddXSPTaglib AxKit::XSP::Util
AxAddXSPTaglib AxKit::XSP::Sendmail
AxAddXSPTaglib AxKit::XSP::Exception
AxAddXSPTaglib AxKit::XSP::AttrParam
AxAddXSPTaglib AxKit::XSP::Param
AxAddXSPTaglib AxKit::XSP::PerForm
AxAddXSPTaglib AxKit::XSP::ESQL

# I recommend to add a custom perl path for your self made taglibs and such
<Perl>
  use lib '/usr/local/apache/perl';
</Perl>

The error stylesheet mentioned (error.xsl) is part of the AxKit distribution.


Edit This Page / Show Page History /