Mon Oct 25 05:53:31 2004
David Nolan, vitroth@cmu.edu
Benjamin Boksa wrote a nice page on how to install AxKit on RedHat 9.
However I think those instructions make you do too much. In particular,
RedHat's perl installation works just fine, if you do everything right.
The following document is the procedure I used to install AxKit 1.6.2 on
a freshly installed RedHat 9 machine.
First, install RedHat 9 on your machine. I won't give you full instructions
for this, instead I'll just list the primary things to pay attention to.
Don't install RedHat's apache. RedHat ships Apache 2, and AxKit does not yet
work with Apache 2.
Be sure to install the libghttp-devel package, otherwise you won't be able to
build the HTTP::GHTTP perl module. And while that modules isn't strictly
required by AxKit, it does improve performance.
After installation is complete, you'll need to change the default language of the system.
For inexplicable reasons, RedHat 9 ships with the default language set to a UTF-8
based language, which causes perl all sort of problems.
Edit /etc/sysconfig/i18n and change the language to en_US or something equivalent not using UTF-8.
The resulting file should look something like this:
LANG=en
LANGUAGE=en
LINGUAS=en_US:en
LC_ALL=en_US
SUPPORTED="en_US:en"
SYSFONT="latarcyrheb-sun16"
After having changed the system language reboot the machine to make sure the new value for LANG is propagated.
The XML libraries which ship with RedHat 9 have some known issues when used with AxKit.
Download the latest versions of all these RPMS from ftp://xmlsoft.org
.
libxml2
libxml2-devel
libxml2-python
libxslt
libxslt-devel
libxslt-python
The versions I downloaded and installed on my machine were:
libxml2-2.5.11-1.i386.rpm
libxml2-devel-2.5.11-1.i386.rpm
libxml2-python-2.5.11-1.i386.rpm
libxslt-1.0.33-1.i386.rpm
libxslt-devel-1.0.33-1.i386.rpm
libxslt-python-1.0.33-1.i386.rpm
Install those rpms, via something like rpm -Uhv libxml2*.rpm libxslt*.rpm
Download and install the latest Apache, mod_perl, and any other Apache modules you need.
There are too many configuration choices with Apache to go into all of them, but for a simple AxKit machine all you need is Apache and mod_perl. So here are the simple instructions for just those two packages.
Untar both in the same directory, cd into the mod_perl directory and
$ perl Makefile.PL EVERYTHING=1 USE_APACI=1 DYNAMIC=1 DO_HTTPD=1 APACI_ARGS="--enable-module=so
--enable-shared=info --enable-shared=proxy --enable-shared=rewrite --enable-shared=log_agent"
$ make
$ make install
You'll also need to run make install in the apache directory, as mod_perl doesn't do that for you.
Make sure that the apache bin directory is in your path before moving on to the next step.
I always install these individually before installing AxKit, as letting CPAN handle the dependencies
never seems to work right (for me).
We'll do everything from the CPAN shell, so start that up.
Run perl -MCPAN -e shell. If this is your first time in the CPAN shell,
you'll have to configure CPAN.
When the CPAN shell is configured run each of these commands in the shell.
install XML::NamespaceSupport
install XML::SAX
install XML::LibXML::Common
install XML::LibXML
install XML::LibXSLT
install XML::XPath
install Compress::Zlib
install Error
force install Apache::Test
force install Apache::Request
install HTTP::GHTTP
install Perl::Tidy
The force options for Apache::Test and Apache::Request can be dropped if you go
through the extra effort to figure out how to make Apache::Test work right. I never bother.
Finally, in the same CPAN shell, you can install AxKit
force install AxKit
Choose no when prompted about Sablotron. Again, the force option is because of Apache::Test.
Modify your httpd.conf to enable AxKit. I add:
PerlModule AxKit
AddHandler axkit .xml .xsp .dkb
AxAddStyleMap application/x-xpathscript Apache::AxKit::Language::XPathScript
AxAddStyleMap text/xsl Apache::AxKit::Language::LibXSLT
Start apache via apachectl start
Somewhere in your web server documents tree, create test.xml containing:
<?xml version="1.0"?>
<?xml-stylesheet href="test.xsl" type="text/xsl"?>
<dromedaries>
<species name="Camel">
<humps>1 or 2</humps>
<disposition>Cranky</disposition>
</species>
<species name="Llama">
<humps>1 (sort of)</humps>
<disposition>Aloof</disposition>
</species>
<species name="Alpaca">
<humps>(see Llama)</humps>
<disposition>Friendly</disposition>
</species>
</dromedaries>
In the same directory, create test.xsl containing:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="/">
<html>
<head><title>Know Your Dromedaries</title></head>
<body>
<table bgcolor="eeeeee" border="1">
<tr>
<th>Species</th>
<th>No of Humps</th>
<th>Disposition</th>
</tr>
<xsl:for-each select="dromedaries">
<xsl:apply-templates select="./species" />
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="species">
<tr>
<td><xsl:value-of select="@name" /></td>
<td><xsl:value-of select="./humps" /></td>
<td><xsl:value-of select="./disposition" /></td>
</tr>
</xsl:template>
</xsl:stylesheet>
Then, start apache if you haven't already, and point your browser at
http://your-server.com/path/to/test.xml
But wait! Even if the page looks right, don't celebrate just yet.
View the source of the document, and verify it is the expected HTML output,
and not just the XML document. Some browsers will parse the xml-stylesheet
operation themselves, and create the same result as if AxKit had done the
work.
If everything worked, NOW you can celebrate.
[http://www.hp-ibm.com 小型机]
[http://www.1so.com.cn/sony/index.htm sony投影机]
[http://www.welltrend.com.cn:81/yiminnet/index.htm 移民]
[http://www.antu.com.cn/fme_jjie.htm GIS]
[http://www.online-ccc.com CCC CERTIFICATION]
[http://www.cmmdc.com.cn/yiyao.htm 医药电子商务]
Edit This Page
/
Show Page History
/