HOME
User Manual |  Mailing Lists | 
  -
»About mod-xslt
»About this site
»Credits
  -
»Join mailing list
»Mailing list archive
  -
»Releases (github)
»Old Versions
»Testing Suite
»Documentation
  -
»Browse GIT (github)
»Report Bugs (github)
  -
»User Manual
»Frequently Asked Questions
»Standards
»Wiki (github)

Users and Administrators Manual

Author:  Carlo Contavalli 
Date: 2013/04/25 23:57:16

mod-xslt2 is a web server module able to transform xml documents in any format using xslt stylesheets. It implements server side transformation of xslt stylesheet.

    | First || Previous || Next || Last |

    To install this module, you must:

    • Make sure ``libxml2'' and ``libxslt'' and their headers (libxml2-dev and libxslt-dev) are correctly installed on your system, and that the commands ``xslt-config'' and ``xml2-config'' can be found in your path.

    • Make sure you have a version of ``libxslt'' above 1.0.30.

    • Make sure ``libpcre'' (at least version 4.5) and its headers (libpcre-dev) are correctly installed on your system and that the command ``pcre-config'' can be found in your path.

    • Make sure to have a version of Make from the GNU project, often known as ``gmake'' on many systems. If your system does provide a ``gmake'' command, use that instead of ``make'' in all the provided examples.

    You may also consider recompiling libxml2 or libxslt after applying some of the patches provided in the ``patches/'' directory in mod-xslt2 sources. For further information about the available patches, please read the file ``README.Patches''.

    To install mod-xslt2 on an apache 2.1.x or 2.2.x server, you need to have:

    • the apache headers file installed (apache2-dev)

    • the command ``apxs'' or ``apxs2'' available somewhere on your system (you can find it by running ``locate apxs'', ``whereis apxs'' or ``find / -name apxs'')

    • ``libapr'' and its headers installed somewhere on your system (libapr0, libapr0-dev) and the command ``apr-config'' (the presence of this command usually implies the availability of the library)

    • libaprutil and its headers installed somewhere on your system (libaprutil, libaprutil-dev) and the command ``apu-config'' (the presence of this command usually implies the availability of the library)

    From your shell, run as a normal user:
      $ gzip -cd mod-xslt2*|tar x
      $ cd mod-xslt2*
      $ mkdir build
      $ cd build
      $ ../configure --with-sapi=apache2
    
    ``apache2'', the ``sapi'', or Server API, is the name of the web server you want mod-xslt2 to be compiled for. If you specify ``none'' you will get the library and the utilities that constitute most of mod-xslt2 compiled and installed.

    If you do not specify anything ``--with-sapi'' configure will try to detect the web server by itself.

    Configure will also try to autodetect most of the needed parameters and will warn you about incompatibilities it will find. Sometimes it will also suggest you to apply a particular patch to your libxml2 or libxslt. Read ``README.Patches'' to have more information about those patches.

    After successful configure completion, you should run:
      $ make
      $ su root
      # make install
    
    If you ever want to remove mod-xslt2, you could also run:
      # make uninstall
    

    Read ``./configure --help'' for an authoritative list of parameters. In these sections we will cover only the most important ones.

    • --bindir=BINDIR BINDIR is the directory where mod-xslt binaries (modxslt-parse, modxslt-perror, modxslt-config) should be copied after compiling them, generally /usr/bin.

    • --libdir=LIBDIR LIBDIR is the directory where mod-xslt library (libmodxslt0) should be installed, generally /usr/lib.

    • --includedir=INCLUDEDIR INCLUDEDIR is the directory where libmodxslt headers should be installed, generally /usr/include.

    • --mandir=MANDIR MANDIR is the directory where manual pages should be installed, generally /usr/man.

    The installation directory for the web server module itself is normally detected automatically. Following options are generally handy:
    • --prefix=PREFIX, if no ``--mandir'' is specified, MANDIR defaults ``PREFIX/man'', while if no ``--includedir'' is specified, INCLUDEDIR defaults to ``PREFIX/include''.

    • --exec-prefix=EPREFIX, if no ``--bindir'' is specified, BINDIR defaults to ``EPREFIX/bindir'', while if no ``--libdir'' is specified, LIBDIR defaults to ``PREFIX/libdir''.

    Packagers for mod-xslt should consider using the DESTDIR environment variable to have all of mod-xslt files installed under a specific directory.

    The following parameters can be used to enable/disable mod-xslt2 features or to choose compilation parameters:

    • --enable-debug starting from version 1.3.9, this option just indicates that mod-xslt should be compiled with the options -ggdb and -O0, which means: with support for running mod-xslt under gdb, and without optimizations. Before version 1.3.9 this parameter used to be useful to flood your web server error.log with information regarding mod-xslt operations and inner working (it was useful for spotting out problems). This compile time option has been superseeded by a more flexible mechanism which allows users to choose at run time which output they want in their own error.log.

    • --enable-memory available from version 1.3.9, this option enables strict checking of memory allocations and frees. It is used when running regression tests, and should not be used otherwise.

    • --enable-xslt-debug enables libxslt debugging functions. This is useful to verify correct behavior of libxslt. Take a look to libxslt documentation for more details.

    • --disable-thread due to lack or bad multithreading/multimodules support in some of the libraries used by mod-xslt2, some global variables allocated in TSD have been used (do not complain to me). This parameter disables libmodxslt multithreading support (the usage of a TSD to keep global variables).

    • --disable-extensions mod-xslt2 makes available some xslt extensions, useful for web programmers. Compiling mod-xslt2 with this parameter disables those extensions.

    • --enable-libxslt-hack libmodxslt sometimes calls error handlers with the wrong descriptors. Enabling this option, will provide one more layer of protection against this kind of error in libxslt (that, at time of writing, has not been corrected by the authors). Another solution is to patch the library to avoid the problem. Please read ``README.Patches''.

    • --enable-fallback-wraparound once you get the errors working correctly, if you use the ``fallback'' tag, you may see strange messages flooding your logs. This option tells mod-xslt2 to remove fallback nodes at least when used inside mod-xslt2 extension elements, to reduce the number of those messages. Another solution is to patch the library to avoid the problem. Please read ``README.Patches''.

    • --disable-exslt (available starting with mod-xslt 1.3.9) disable exslt extensions for libxslt. Default is enabled.

    • --disable-xinclude disable modxslt usage of xinclude. Default is enabled. If you want to disable xinclude or maintain backward compatibility, you are free to disable xinclude.

    • --with-sapi=apache1|apache2|none allows you to specify for which web server (sapi) to compile mod-xslt2. Currently, you can specify ``apache1'' for apache version 1.3.x, ``apache2'' for apache version > 2.x.y, ``apache'' to enable apache version autodetection or ``none'' to compile only mod-xslt2 utilities and libraries. More sapi modules are currently being developed.

    • --with-xml2-config=path allows you to specify where the libxml2 ``xml2-config'' script is located. If not specifyed, the first one found in the search path will be used. As an example, you could specify something like: ``--with-xml2-config=/usr/local/libxml2-2.5.57/bin/xml2-config''

      If you don't have xml2-config on your system, you probably haven't installed libxml2 correctly or you haven't installed the ``-dev'' version of the packages (rpm & deb). If you don't know where it is, you can run ``locate xml2-config'' or ``find / -name xml2-config'' to locate it.

    • --with-xslt-config=path allows you to specify where the ``xslt-config'' script is located. If not specifyed, the first one found in the search path will be used.

    • --with-pcre-config=path allows you to specify where the ``pcre-config'' script is located. If not specifyed, the first one found in the search path will be used. If not found, support for ``Perl Compatible Regular Expressions'' will be disabled.

    2.3.3.1  Apache 1

    • --with-apxs allows you to specify the ``apxs'' that should be used. By default, the first ``apxs'' found in the ``PATH'' or in ``/usr/bin'', ``/usr/local/bin'', ``/usr/local/apache/bin'' is used. If you have no apxs on your system, you probably don't have apache headers (or the package apache-dev) installed correctly.

    Note that running ``make install'' will install mod-xslt2 in the path returned by the ``apxs'' found (``apxs -q LIBEXECDIR''), eventually prefixed by the DESTDIR environment variabe as usual.

    2.3.3.2  Apache 2.x.x

    • --with-apxs allows you to specify the ``apxs'' that should be used. By default, the first ``apxs'' found in the ``PATH'' or in ``/usr/bin'', ``/usr/local/bin'', ``/usr/local/apache/bin'' is used. If you have no apxs on your system, you probably don't have apache headers (or the package apache-dev) installed correctly.

    • --with-apr-config allows you to specify the ``apr-config'' script that should be used. By default, the first ``apr-config'' found is used.

    • --with-apu-config allows you to specify the ``apu-config'' script that should be used. By default, the first ``apu-config'' found is used.

    Note that running ``make install'' will install mod-xslt2 in the path returned by the ``apxs'' found (``apxs -q LIBEXECDIR''), eventually prefixed by the prefix specified with ``--prefix'' to configure.

    | First || Previous || Next || Last |
      -
    »Debian GNU
    »Apache Project
    »Gnome libxml2
    »Gnome libxslt
    »Gnome Project
    Introduction
    Installation
    mod-xslt2 Setup and Usage
    Writing XML for mod-xslt2
    Security considerations
    Reporting BUGS / Helping out the project
    License, copyright and...