<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title> Practical PostgreSQL</title> <meta name="keywords" content="postgresql, support, recovery, design, software, hosting, expterise, programming, postgres, pgsql, replication, mysql, firebird, database, sql, free, open source, software" /> <meta name="description" content="Command Prompt, Inc. is the largest and oldest US based commercial PostgreSQL support provider. We provide the only commercially viable integrated PostgreSQL replication solution, but also custom programming, and support. We authored the book Practical PostgreSQL, the procedural language plPHP, and adding trigger capability to plPerl. " /> <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" /> <link rel="stylesheet" type="text/css" href="../css/layout.css" /> <link rel="stylesheet" type="text/css" href="../css/cmd4.css" /> <script language="javascript" type="text/javascript"><!-- greymenuhomewideLit = new Image(); greymenuhomewideLit.src = "/images/greymenu_homewide_lit.gif"; greymenuaboutLit = new Image(); greymenuaboutLit.src = "/images/greymenu_about_lit.gif"; greymenuproductsLit = new Image(); greymenuproductsLit.src = "/images/greymenu_products_lit.gif"; greymenuservicesLit = new Image(); greymenuservicesLit.src = "/images/greymenu_services_lit.gif"; greymenusupportLit = new Image(); greymenusupportLit.src = "/images/greymenu_support_lit.gif"; greymenucommunityLit = new Image(); greymenucommunityLit.src = "/images/greymenu_community_lit.gif"; //--></script> </head> <body> <div align="center"> <div id="widecontainer"> <div id="widetop"> <div class="throwleft" style="width: 300px; text-align: left;"><a href="http://www.commandprompt.com/"><img src="../images/cmd4logo_wide.gif" border="0" alt="Command Prompt, Inc." /></a></div> <div class="throwright" style="width: 400px; text-align: right;"> <div id="topright"> <form action="index.html" name="cmdform" method="post"> <ul> <li><input type="text" name="search" value="" /></li> <li><input type="submit" name="action" value="Search Book" /></li> </ul> </form> </div> </div> </div> <ul id="greymenu_wide"> <li><a href="http://www.commandprompt.com/home/"><img onmouseover="this.src = greymenuhomewideLit.src;" onmouseout="this.src = '/images/greymenu_homewide.gif';" src="../images/greymenu_homewide.gif" border="0" height="22" title="" alt="" /></a></li><li><img src="../images/greymenu_divider.gif" border="0" width="2" height="22" alt="|" /></li><li><a href="http://www.commandprompt.com/about/"><img onmouseover="this.src = greymenuaboutLit.src;" onmouseout="this.src = '/images/greymenu_about.gif';" src="../images/greymenu_about.gif" border="0" height="22" title="" alt="" /></a></li><li><img src="../images/greymenu_divider.gif" border="0" width="2" height="22" alt="|" /></li><li><a href="http://www.commandprompt.com/products/"><img onmouseover="this.src = greymenuproductsLit.src;" onmouseout="this.src = '/images/greymenu_products.gif';" src="../images/greymenu_products.gif" border="0" height="22" title="" alt="" /></a></li><li><img src="../images/greymenu_divider.gif" border="0" width="2" height="22" alt="|" /></li><li><a href="http://www.commandprompt.com/services/"><img onmouseover="this.src = greymenuservicesLit.src;" onmouseout="this.src = '/images/greymenu_services.gif';" src="../images/greymenu_services.gif" border="0" height="22" title="" alt="" /></a></li><li><img src="../images/greymenu_divider.gif" border="0" width="2" height="22" alt="|" /></li><li><a href="http://www.commandprompt.com/support/"><img onmouseover="this.src = greymenusupportLit.src;" onmouseout="this.src = '/images/greymenu_support.gif';" src="../images/greymenu_support.gif" border="0" height="22" title="" alt="" /></a></li><li><img src="../images/greymenu_divider.gif" border="0" width="2" height="22" alt="|" /></li><li><a href="http://www.commandprompt.com/community/"><img onmouseover="this.src = greymenucommunityLit.src;" onmouseout="this.src = '/images/greymenu_community.gif';" src="../images/greymenu_community.gif" border="0" height="22" title="" alt="" /></a></li> </ul> <div style="padding-left: 16px; width: 96%;"> <HTML ><HEAD ><TITLE >Installing and Configuring LXP</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.72 "><LINK REL="HOME" TITLE="Practical PostgreSQL" href="book1"><LINK REL="UP" TITLE="LXP" href="lxp"><LINK REL="PREVIOUS" TITLE="Core Features" href="x21164"><LINK REL="NEXT" TITLE="Understanding LXP Mark-Up" href="x21430"></HEAD ><BODY CLASS="SECT1" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >Practical PostgreSQL</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A href="x21164" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" >Chapter 13. LXP</TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A href="x21430" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="SECT1" ><H1 CLASS="SECT1" ><A NAME="AEN21206" >Installing and Configuring LXP</A ></H1 ><P >To install LXP, you must have the Apache web server installed and configured to support <SPAN ><I CLASS="EMPHASIS" >mod_so</I ></SPAN >. This is the Apache Shared Object module. If you have not built Apache with this module, you will need to reconfigure it, making sure to include the <SPAN ><I CLASS="EMPHASIS" >- -enable-module=so</I ></SPAN > configuration option before compiling.</P ><DIV CLASS="WARNING" ><P ></P ><TABLE CLASS="WARNING" BORDER="1" WIDTH="100%" ><TR ><TD ALIGN="CENTER" ><B >Warning</B ></TD ></TR ><TR ><TD ALIGN="LEFT" ><P >If you choose to manually compile Apache, be sure that you remove any existing Apache RPMs first. You can usually identify these with the <SPAN ><I CLASS="EMPHASIS" >rpm -qa |grep apache</I ></SPAN > command.</P ></TD ></TR ></TABLE ></DIV ><P >If Apache is installed, and the Shared Object module is enabled, you may insert the CD included with this book, mount it, and proceed with the installation. You will need to be logged in as <SPAN ><I CLASS="EMPHASIS" >root</I ></SPAN > in order to successfully install LXP, since it requires access to system-level files and directories.</P ><DIV CLASS="SECT2" ><H2 CLASS="SECT2" ><A NAME="INSTALLINGLXP" >Installing LXP</A ></H2 ><P >There are two ways to install LXP as of Version 0.8; you may use the <SPAN ><I CLASS="EMPHASIS" >lxpinstall.sh</I ></SPAN > script, found in the <SPAN ><I CLASS="EMPHASIS" >lxp</I ></SPAN > directory on the CD, or you may install it manually. The <SPAN ><I CLASS="EMPHASIS" >lxpinstall.sh</I ></SPAN > script is intended to both install the required LXP files and to configure your <SPAN ><I CLASS="EMPHASIS" >httpd.conf</I ></SPAN > file to load and enable the LXP module.</P ><P >If you encounter any errors during the installation from <SPAN ><I CLASS="EMPHASIS" >lxpinstall.sh</I ></SPAN >, see the following section about manual configuration.</P ><DIV CLASS="SECT3" ><H3 CLASS="SECT3" ><A NAME="AEN21228" >Using lxpinstall.sh</A ></H3 ><P >The <SPAN ><I CLASS="EMPHASIS" >lxpinstall.sh</I ></SPAN > script is extremely straightforward. On a fresh system, the only option you should be prompted to respond to is at the end of the script, when it asks you whether or not to automatically restart Apache (as must be done, to enable LXP). You may run it again afterward in case something goes wrong, though it will prompt you whether or not certain files should be overwritten.</P ><P ><A href="x21206#INSTALLINGLXPWITHLXPINSTALLSH" >Example 13-1</A > changes to the <SPAN ><I CLASS="EMPHASIS" >lxp</I ></SPAN > directory on the CD (mounted in <SPAN ><I CLASS="EMPHASIS" >/mnt/cdrom</I ></SPAN >, in this case), and runs the <SPAN ><I CLASS="EMPHASIS" >lxpinstall.sh</I ></SPAN > file.</P ><DIV CLASS="EXAMPLE" ><A NAME="INSTALLINGLXPWITHLXPINSTALLSH" ></A ><P ><B >Example 13-1. Installing LXP with lxpinstall.sh</B ></P ><PRE CLASS="SCREEN" >[root@host root]# <TT CLASS="USERINPUT" ><B >cd /mnt/cdrom/lxp</B ></TT > [root@host lxp]# <TT CLASS="USERINPUT" ><B >./lxpinstall.sh</B ></TT > =================================================================== Thank you for installing Command Prompt LXP, 0.8.0. Copyright (c) 1999-2001, Command Prompt, Inc. See the LICENSE file for licensing restrictions. ================================================================== [cmd] Checking for PostgreSQL libs (this may take a moment) ... [cmd] Found PostgreSQL libpq library. [cmd] Using apxs: '/usr/local/apache/bin/apxs' [cmd] Using '/usr/local/apache/libexec/' for shared object file ================================================================== [cmd] Installing 'liblxp.so' [activating module `lxp' in /usr/local/apache/conf/httpd.conf] cp lib/liblxp.so /usr/local/apache/libexec/liblxp.so chmod 755 /usr/local/apache/libexec/liblxp.so cp /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf.bak cp /usr/local/apache/conf/httpd.conf.new /usr/local/apache/conf/httpd.conf rm /usr/local/apache/conf/httpd.conf.new ================================================================== [cmd] Using '/usr/local/apache/conf/httpd.conf' for configuration [cmd] Backing up original configuration file... /usr/local/apache/conf/httpd.conf -> /usr/local/apache/conf/httpd.conf.lxp_backup [cmd] Backing up original configuration file... /usr/local/apache/conf/srm.conf -> /usr/local/apache/conf/srm.conf.lxp_backup [cmd] Adding LXP directives to httpd.conf... ================================================================== [cmd] Installing 'lxp.conf' into /usr/local/cmd/etc ... conf/lxp.conf-dist -> /usr/local/cmd/etc/lxp.conf ================================================================== [cmd] Re-start Apache with '/usr/local/apache/bin/apachectl'? (y/n) <TT CLASS="USERINPUT" ><B >y</B ></TT > /usr/local/apache/bin/apachectl stop: httpd stopped /usr/local/apache/bin/apachectl start: httpd started [cmd] Command Prompt LXP 0.8.0 successfully installed.</PRE ></DIV ><DIV CLASS="NOTE" ><BLOCKQUOTE CLASS="NOTE" ><P ><B >Note: </B >In case there is a problem with your <SPAN ><I CLASS="EMPHASIS" >httpd.conf</I ></SPAN > reconfiguration, remember that LXP creates a backup of your original configuration called <SPAN ><I CLASS="EMPHASIS" >httpd.conf.lxp_backup</I ></SPAN > in the same directory as your <SPAN ><I CLASS="EMPHASIS" >httpd.conf</I ></SPAN > before making any modifications.</P ></BLOCKQUOTE ></DIV ><P >You may receive the following error when running the <SPAN ><I CLASS="EMPHASIS" >lxpinstall.sh</I ></SPAN > script:</P ><PRE CLASS="SCREEN" >[cmd] ERROR: LXP requires Apache be configured with Shared Object support, [cmd] but we couldn't find Apache's apxs script. [cmd] Please make sure it is in your path, if you know mod_so is enabled. [cmd] exit error 1</PRE ><P >This error indicates that <SPAN ><I CLASS="EMPHASIS" >apxs</I ></SPAN >, the Apache Extension tool, could not be found on your system. It is typically found in <SPAN ><I CLASS="EMPHASIS" >/usr/local/apache/bin</I ></SPAN >, though it may be missing if your Apache web server was not built with <SPAN ><I CLASS="EMPHASIS" >mod_so</I ></SPAN > support enabled, or if you have not installed the <SPAN ><I CLASS="EMPHASIS" >apache-devel</I ></SPAN > RPM for your system. If you know it is installed, be sure that the directory it resides within is in your <TT CLASS="LITERAL" >PATH</TT > environment variable.</P ><P >Alternatively, you may get an error message similar to the following:</P ><PRE CLASS="SCREEN" >[cmd] ERROR: apxs couldn't find your configuration file [cmd] (Tried /usr/local/apache/conf/httpd.conf) [cmd] exit error 3</PRE ><P >If you are not using a configuration file with a standard name (i.e., <SPAN ><I CLASS="EMPHASIS" >httpd.conf</I ></SPAN > ), you will need to manually configure it. See the next section instructions.</P ></DIV ><DIV CLASS="SECT3" ><H3 CLASS="SECT3" ><A NAME="AEN21265" >Manual installation</A ></H3 ><P >This section describes how to manually install LXP if the <SPAN ><I CLASS="EMPHASIS" >lxpinstall.sh</I ></SPAN > script does not work for you. If you've already installed LXP successfully through this script, you may skip this section.</P ><P >There are three steps to manually installing LXP:</P ><P > <P ></P ><UL ><LI ><P >Installing the LXP shared-object file</P ></LI ><LI ><P >Installing the LXP configuration file</P ></LI ><LI ><P >Configuring Apache's <SPAN ><I CLASS="EMPHASIS" >httpd.conf</I ></SPAN > file</P ></LI ></UL > </P ><P >The <SPAN ><I CLASS="EMPHASIS" >liblxp.so</I ></SPAN > file (located in the <SPAN ><I CLASS="EMPHASIS" >/lxp/lib</I ></SPAN > directory on the CD) must be copied to the directory that your Apache web server is configured to load external modules from. This is typically <SPAN ><I CLASS="EMPHASIS" >/usr/local/apache/libexec</I ></SPAN > for manual installations of Apache, and <SPAN ><I CLASS="EMPHASIS" >/etc/httpd/modules</I ></SPAN > for RPM installations. Note that this directory varies wildly, and may be different in your distribution. You should be able to install into this directory through the use of <SPAN ><I CLASS="EMPHASIS" >apxs</I ></SPAN >, however, with the following syntax:</P ><PRE CLASS="SCREEN" >apxs -i -n <TT CLASS="REPLACEABLE" ><I >module</I ></TT > -a <TT CLASS="REPLACEABLE" ><I >shared_object</I ></TT ></PRE ><P ><A href="x21206#MANUALLYINSTALLINGLIBLXPSO" >Example 13-2</A > demonstrates using the <SPAN ><I CLASS="EMPHASIS" >apxs</I ></SPAN > script to install and configure the <SPAN ><I CLASS="EMPHASIS" >liblxp.so</I ></SPAN > file directly into Apache's module directory.</P ><DIV CLASS="EXAMPLE" ><A NAME="MANUALLYINSTALLINGLIBLXPSO" ></A ><P ><B >Example 13-2. Manually installing liblxp.so</B ></P ><PRE CLASS="SCREEN" >[root@host lib]# <TT CLASS="USERINPUT" ><B >apxs -i -n "lxp" -a lib/liblxp.so</B ></TT > cp lib/liblxp.so /usr/local/apache/libexec/liblxp.so chmod 755 /usr/local/apache/libexec/liblxp.so [activating module `lxp' in /usr/local/apache/conf/httpd.conf]</PRE ></DIV ><P >If you do not have PostgreSQL installed, the <SPAN ><I CLASS="EMPHASIS" >libpq.so.2.2</I ></SPAN > file (also located in the <SPAN ><I CLASS="EMPHASIS" >/lxp/lib</I ></SPAN > directory on the CD) should be copied to the <SPAN ><I CLASS="EMPHASIS" >/usr/local/cmd/lib</I ></SPAN > directory. A symbolic link named <SPAN ><I CLASS="EMPHASIS" >libpq.so.2</I ></SPAN > should also be created to point to this file. If you have not run <SPAN ><I CLASS="EMPHASIS" >lxpinstall.sh</I ></SPAN >, you may need to create this directory. <A href="x21206#MANUALLYINSTALLINGLIBPQSO" >Example 13-3</A > demonstrates this process.</P ><DIV CLASS="EXAMPLE" ><A NAME="MANUALLYINSTALLINGLIBPQSO" ></A ><P ><B >Example 13-3. Manually installing libpq.so.2.2</B ></P ><PRE CLASS="SCREEN" >[root@host lib]# <TT CLASS="USERINPUT" ><B >mkdir -p /usr/local/cmd/lib</B ></TT > [root@host lib]# <TT CLASS="USERINPUT" ><B >cp -iv libpq.so.2.2 /usr/local/cmd/lib/</B ></TT > libpq.so.2.2 -> /usr/local/cmd/lib/libpq.so.2.2 [root@host lib]# <TT CLASS="USERINPUT" ><B >ln -s /usr/local/cmd/lib/libpq.so.2.2 /usr/local/cmd/lib/libpq.so.2</B ></TT ></PRE ></DIV ><P >Next, the <SPAN ><I CLASS="EMPHASIS" >lxp.conf</I ></SPAN > file must be installed in the <SPAN ><I CLASS="EMPHASIS" >/usr/local/cmd/etc</I ></SPAN > directory. This is the configuration file for LXP 0.8, discussed in detail in the next section. The distributed configuration file is found in the <SPAN ><I CLASS="EMPHASIS" >lxp/conf</I ></SPAN > directory on the CD, and is named <SPAN ><I CLASS="EMPHASIS" >lxp.conf-dist</I ></SPAN >. Copy this file to <SPAN ><I CLASS="EMPHASIS" >/usr/local/cmd/etc</I ></SPAN > from the <SPAN ><I CLASS="EMPHASIS" >lxp/conf</I ></SPAN > directory on the CD, as shown in <A href="x21206#MANUALLYINSTALLINGLXPCONF" >Example 13-4</A >. If you have not run <SPAN ><I CLASS="EMPHASIS" >lxpinstall.sh</I ></SPAN > at all, you may need to create this directory. Be sure to rename it from <SPAN ><I CLASS="EMPHASIS" >lxp.conf-dist</I ></SPAN > to <SPAN ><I CLASS="EMPHASIS" >lxp.conf</I ></SPAN >  !</P ><DIV CLASS="EXAMPLE" ><A NAME="MANUALLYINSTALLINGLXPCONF" ></A ><P ><B >Example 13-4. Manually installing lxp.conf</B ></P ><PRE CLASS="SCREEN" >[root@host lxp]# <TT CLASS="USERINPUT" ><B >mkdir -p /usr/local/cmd/etc</B ></TT > [root@host lxp]# <TT CLASS="USERINPUT" ><B >cp -v conf/lxp.conf-dist /usr/local/cmd/etc/lxp.conf</B ></TT > conf/lxp.conf-dist -> /usr/local/cmd/etc/lxp.conf [root@host lxp]#</PRE ></DIV ><P >Finally, Apache's <SPAN ><I CLASS="EMPHASIS" >httpd.conf</I ></SPAN > file must be configured for the LXP content type.</P ><DIV CLASS="WARNING" ><P ></P ><TABLE CLASS="WARNING" BORDER="1" WIDTH="100%" ><TR ><TD ALIGN="CENTER" ><B >Warning</B ></TD ></TR ><TR ><TD ALIGN="LEFT" ><P >In some circumstances, <SPAN ><I CLASS="EMPHASIS" >httpd.conf</I ></SPAN > may have been renamed to something else (such as <SPAN ><I CLASS="EMPHASIS" >httpsd.conf</I ></SPAN >, in the case of ApacheSSL).</P ></TD ></TR ></TABLE ></DIV ><P >There are two lines that must be added to this file for LXP to be configured. These are shown in <A href="x21206#CONFIGURINGHTTPDCONFFORLXP" >Example 13-5</A >.</P ><DIV CLASS="EXAMPLE" ><A NAME="CONFIGURINGHTTPDCONFFORLXP" ></A ><P ><B >Example 13-5. Configuring httpd.conf for LXP</B ></P ><PRE CLASS="SCREEN" >DirectoryIndex index.html index.lxp AddType application/x-httpd-lxp .lxp</PRE ></DIV ><P >A line similar to the first line in <A href="x21206#CONFIGURINGHTTPDCONFFORLXP" >Example 13-5</A > should already exist in your <SPAN ><I CLASS="EMPHASIS" >httpd.conf</I ></SPAN > file. You must add <TT CLASS="LITERAL" >index.lxp</TT > as a value to this directive if you wish for Apache to automatically look for an LXP index in a directory request.</P ><P >The second line must be added from scratch. This <TT CLASS="LITERAL" >AddType</TT > directive should be entered exactly as it is shown in <A href="x21206#CONFIGURINGHTTPDCONFFORLXP" >Example 13-5</A >. This line enables the LXP module to process files ending in <SPAN ><I CLASS="EMPHASIS" >.lxp</I ></SPAN >.</P ><P >It is generally not important where you put these last two directives within the <SPAN ><I CLASS="EMPHASIS" >httpd.conf</I ></SPAN > file, though you may wish to place them with similarly named directives that already exist, to keep the configuration file organized.</P ><P >Once you have finished, you must restart Apache for the changes to take effect. This is typically done with either the <SPAN ><I CLASS="EMPHASIS" >apachectl</I ></SPAN > command, or the <SPAN ><I CLASS="EMPHASIS" >httpd</I ></SPAN > service script.</P ></DIV ></DIV ><DIV CLASS="SECT2" ><H2 CLASS="SECT2" ><A NAME="LXPCONF" >Nuts and Bolts: Configuring lxp.conf</A ></H2 ><P >After installing LXP, you will find the <SPAN ><I CLASS="EMPHASIS" >lxp.conf</I ></SPAN > file in the <SPAN ><I CLASS="EMPHASIS" >/usr/local/cmd/etc</I ></SPAN > directory. This file defines the database settings with which LXP connects to the PostgreSQL database for persistent connections. The file also contains a pair of debugging options.</P ><P >The <SPAN ><I CLASS="EMPHASIS" >lxp.conf</I ></SPAN > file is a simple configuration file using common conventions. The format of this file can consist of <SPAN ><I CLASS="EMPHASIS" >comments</I ></SPAN >, <SPAN ><I CLASS="EMPHASIS" >directives</I ></SPAN >, and associated <SPAN ><I CLASS="EMPHASIS" >values</I ></SPAN > for each directive.</P ><P >Comments are always prefixed with a hash mark (<TT CLASS="LITERAL" >#</TT >). They can be at the beginning of a line, or follow a directive and value. They are totally ignored by LXP when the configuration is loaded, and are only useful for remembering notes on why directives are set and what possible options there may be. You can add your own comments without harming the functionality of LXP as long as you remember to precede the comment with a hash mark (<TT CLASS="LITERAL" >#</TT >).</P ><P >Directives have a very basic affect upon the functionality of LXP. They typically start at the beginning of a line, have a name (without spaces), and are followed by their associated value. The directive name defines a behavior to affect, while the value sets how to affect that behavior. Some directives accept multiple values, which are separated by either tabs or spaces. Here is example syntax:</P ><PRE CLASS="SCREEN" ># Here's an example directive. MyDirective SomeValue # MyDirective defines some arbitrary value.</PRE ><P >You may never need to make serious alterations in your <SPAN ><I CLASS="EMPHASIS" >lxp.conf</I ></SPAN > file, but it's a good idea to know what it is, and what it does, in case you ever need to change one of these basic behaviors. As of LXP 0.8, the <SPAN ><I CLASS="EMPHASIS" >lxp.conf</I ></SPAN > file is broken up into two sections; general settings and database settings.</P ><DIV CLASS="SECT3" ><H3 CLASS="SECT3" ><A NAME="LXPCONFGENERALSETTINGS" >General settings</A ></H3 ><P >The first two directives under the General settings section are <TT CLASS="LITERAL" >Debug</TT > and <TT CLASS="LITERAL" >MaxIncludeDepth</TT >:</P ><PRE CLASS="SCREEN" >####################### # General LXP settings. ####################### Debug No # (Yes|No) MaxIncludeDepth 15 # (Number)</PRE ><P >Setting the <TT CLASS="LITERAL" >Debug</TT > directive to <TT CLASS="LITERAL" >Yes</TT > adds a debugging-header to the top of all LXP documents. This can be useful for tracking down unexplained behavior of LXP files and included scripts. The debug header includes the name of the LXP document requested, any cookies found for the given domain, any GET/POST variables that are passed, and <SPAN ><I CLASS="EMPHASIS" >maximum depth inclusion</I ></SPAN >.</P ><P >The maximum depth inclusion is the highest number of includes LXP will traverse down before stopping and displaying an error. This is used to prevent accidental infinite includes (e.g., <SPAN ><I CLASS="EMPHASIS" >a.lxp</I ></SPAN > includes <SPAN ><I CLASS="EMPHASIS" >b.lxp</I ></SPAN >, which includes <SPAN ><I CLASS="EMPHASIS" >a.lxp</I ></SPAN >). Set this value with the <TT CLASS="LITERAL" >MaxIncludeDepth</TT > directive. The default value is 15.</P ><DIV CLASS="NOTE" ><BLOCKQUOTE CLASS="NOTE" ><P ><B >Note: </B >The value assigned to <TT CLASS="LITERAL" >MaxIncludeDepth</TT > does not limit the total number of files that can be included within a document. It describes only the <SPAN ><I CLASS="EMPHASIS" >deepest</I ></SPAN > level LXP can go in <SPAN ><I CLASS="EMPHASIS" >sub-inclusions</I ></SPAN > (e.g., <SPAN ><I CLASS="EMPHASIS" >a.lxp</I ></SPAN > includes <SPAN ><I CLASS="EMPHASIS" >b.lxp</I ></SPAN >, which includes <SPAN ><I CLASS="EMPHASIS" >c.lxp</I ></SPAN >, which includes <SPAN ><I CLASS="EMPHASIS" >d.lxp</I ></SPAN >, etc).</P ></BLOCKQUOTE ></DIV ></DIV ><DIV CLASS="SECT3" ><H3 CLASS="SECT3" ><A NAME="DATABASESETTINGS" >Database settings</A ></H3 ><P >The next six directives pertain to database connectivity with PostgreSQL. Most of the default options are usable on most systems, but you may wish to modify these if you have special needs for your PostgreSQL installation:</P ><PRE CLASS="SCREEN" >############################################# # PostgreSQL persistent connectivity options. ############################################# UseDb No # (Yes|No) Set to Yes if you wish to connect to the database. DbName template1 # The database to use. By default, "template1". DbHost localhost # The database host to use. By default, "localhost". DbPort 5432 # The port to connect to PostgreSQL on. DbUser postgres # The username to connect with. By default, "postgres". DbPass # The password to connect with. By default, empty</PRE ><P >If you wish to enable LXP's persistent connections to a database, set <TT CLASS="LITERAL" >UseDb</TT > to <TT CLASS="LITERAL" >Yes</TT >. If set to <TT CLASS="LITERAL" >No</TT >, you will still be able to use the Direct SQL Interface to dynamically open up connections (see <A href="x22143#DIRECTSQL" >the Section called <I >Including SQL Content</I ></A >"), but you will incur the cost of a new PostgreSQL backend connection for <SPAN ><I CLASS="EMPHASIS" >each</I ></SPAN > connection request.</P ><P >The remaining options—<TT CLASS="LITERAL" >DbName</TT >, <TT CLASS="LITERAL" >DbHost</TT >, <TT CLASS="LITERAL" >DbPort</TT >, <TT CLASS="LITERAL" >DbUser</TT >, and <TT CLASS="LITERAL" >DbPass</TT >—should be familiar to anyone with experience connecting to PostgreSQL. The defaults will usually work fine, but you might wish to change them if you have special needs (for example, if you wish to store your data on a separate database server, you would change <TT CLASS="LITERAL" >DbHost</TT > to point to the appropriate machine).</P ><DIV CLASS="WARNING" ><P ></P ><TABLE CLASS="WARNING" BORDER="1" WIDTH="100%" ><TR ><TD ALIGN="CENTER" ><B >Warning</B ></TD ></TR ><TR ><TD ALIGN="LEFT" ><P >When utilizing the persistent connections between Apache and LXP's PostgreSQL database, it is important to recognize that there will be a separate <SPAN ><I CLASS="EMPHASIS" >postmaster</I ></SPAN > binary running for each <SPAN ><I CLASS="EMPHASIS" >httpd</I ></SPAN > process. Be sure that your system is configured to be capable of loading as many PostgreSQL <SPAN ><I CLASS="EMPHASIS" >postmaster</I ></SPAN > backends as Apache requires (i.e., the number defined by the <TT CLASS="LITERAL" >MaxClients</TT > directive in Apache's <SPAN ><I CLASS="EMPHASIS" >httpd.conf</I ></SPAN > ) file.</P ></TD ></TR ></TABLE ></DIV ></DIV ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A href="x21164" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A href="book1" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A href="x21430" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >Core Features</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A href="lxp" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >Understanding LXP Mark-Up</TD ></TR ></TABLE ></DIV ></BODY ></HTML > </div> <br /> <div id="thefineprint"> <a href="http://www.commandprompt.com/products/mammothpostgresql/"><img src="../images/powered_by_mammoth.gif" alt="Powered by Mammoth PostgreSQL" title="Powered by Mammoth PostgreSQL" border="0" /></a> <br /> Copyright © 2000-2007 Command Prompt, Inc. All Rights Reserved. All trademarks property of their respective owners. </div> </div> </div> </body> </html>