Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Databases - Practical PostgreSQL
Previous Page Home Next Page

Nuts and Bolts: Configuring lxp.conf

After installing LXP, you will find the lxp.conf file in the /usr/local/cmd/etc 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.

The lxp.conf file is a simple configuration file using common conventions. The format of this file can consist of comments , directives , and associated values for each directive.

Comments are always prefixed with a hash mark (#). 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 (#).

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:

# Here's an example directive.

MyDirective	SomeValue	# MyDirective defines some arbitrary value.

You may never need to make serious alterations in your lxp.conf 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 lxp.conf file is broken up into two sections; general settings and database settings.

General settings

The first two directives under the General settings section are Debug and MaxIncludeDepth:

#######################
# General LXP settings.
#######################

Debug            No  # (Yes|No)
MaxIncludeDepth  15  # (Number)

Setting the Debug directive to Yes 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 maximum depth inclusion .

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., a.lxp includes b.lxp , which includes a.lxp ). Set this value with the MaxIncludeDepth directive. The default value is 15.

Note: The value assigned to MaxIncludeDepth does not limit the total number of files that can be included within a document. It describes only the deepest level LXP can go in sub-inclusions (e.g., a.lxp includes b.lxp , which includes c.lxp , which includes d.lxp , etc).

Database settings

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:

#############################################
# 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

If you wish to enable LXP's persistent connections to a database, set UseDb to Yes. If set to No, you will still be able to use the Direct SQL Interface to dynamically open up connections (see the Section called Including SQL Content "), but you will incur the cost of a new PostgreSQL backend connection for each connection request.

The remaining options—DbName, DbHost, DbPort, DbUser, and DbPass—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 DbHost to point to the appropriate machine).

Warning

When utilizing the persistent connections between Apache and LXP's PostgreSQL database, it is important to recognize that there will be a separate postmaster binary running for each httpd process. Be sure that your system is configured to be capable of loading as many PostgreSQL postmaster backends as Apache requires (i.e., the number defined by the MaxClients directive in Apache's httpd.conf  ) file.

Databases - Practical PostgreSQL
Previous Page Home Next Page

 
 
  Published under the terms of the Open Publication License Design by Interspire