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

Installing LXP

There are two ways to install LXP as of Version 0.8; you may use the lxpinstall.sh script, found in the lxp directory on the CD, or you may install it manually. The lxpinstall.sh script is intended to both install the required LXP files and to configure your httpd.conf file to load and enable the LXP module.

If you encounter any errors during the installation from lxpinstall.sh , see the following section about manual configuration.

Using lxpinstall.sh

The lxpinstall.sh 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.

Example 13-1 changes to the lxp directory on the CD (mounted in /mnt/cdrom , in this case), and runs the lxpinstall.sh file.

Example 13-1. Installing LXP with lxpinstall.sh

[root@host root]# 
cd /mnt/cdrom/lxp

[root@host lxp]# 
./lxpinstall.sh

===================================================================
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) 
y

/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.

Note: In case there is a problem with your httpd.conf reconfiguration, remember that LXP creates a backup of your original configuration called httpd.conf.lxp_backup in the same directory as your httpd.conf before making any modifications.

You may receive the following error when running the lxpinstall.sh script:

[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

This error indicates that apxs , the Apache Extension tool, could not be found on your system. It is typically found in /usr/local/apache/bin , though it may be missing if your Apache web server was not built with mod_so support enabled, or if you have not installed the apache-devel RPM for your system. If you know it is installed, be sure that the directory it resides within is in your PATH environment variable.

Alternatively, you may get an error message similar to the following:

[cmd] ERROR: apxs couldn't find your configuration file
[cmd] (Tried /usr/local/apache/conf/httpd.conf)
[cmd] exit error 3

If you are not using a configuration file with a standard name (i.e., httpd.conf  ), you will need to manually configure it. See the next section instructions.

Manual installation

This section describes how to manually install LXP if the lxpinstall.sh script does not work for you. If you've already installed LXP successfully through this script, you may skip this section.

There are three steps to manually installing LXP:

  • Installing the LXP shared-object file

  • Installing the LXP configuration file

  • Configuring Apache's httpd.conf file

The liblxp.so file (located in the /lxp/lib 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 /usr/local/apache/libexec for manual installations of Apache, and /etc/httpd/modules 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 apxs , however, with the following syntax:

apxs -i -n 
module
 -a 
shared_object

Example 13-2 demonstrates using the apxs script to install and configure the liblxp.so file directly into Apache's module directory.

Example 13-2. Manually installing liblxp.so

[root@host lib]# 
apxs -i -n "lxp" -a lib/liblxp.so

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]

If you do not have PostgreSQL installed, the libpq.so.2.2 file (also located in the /lxp/lib directory on the CD) should be copied to the /usr/local/cmd/lib directory. A symbolic link named libpq.so.2 should also be created to point to this file. If you have not run lxpinstall.sh , you may need to create this directory. Example 13-3 demonstrates this process.

Example 13-3. Manually installing libpq.so.2.2

[root@host lib]# 
mkdir -p /usr/local/cmd/lib

[root@host lib]# 
cp -iv libpq.so.2.2 /usr/local/cmd/lib/

libpq.so.2.2 -> /usr/local/cmd/lib/libpq.so.2.2
[root@host lib]# 
ln -s /usr/local/cmd/lib/libpq.so.2.2 /usr/local/cmd/lib/libpq.so.2

Next, the lxp.conf file must be installed in the /usr/local/cmd/etc 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 lxp/conf directory on the CD, and is named lxp.conf-dist . Copy this file to /usr/local/cmd/etc from the lxp/conf directory on the CD, as shown in Example 13-4. If you have not run lxpinstall.sh at all, you may need to create this directory. Be sure to rename it from lxp.conf-dist to lxp.conf   !

Example 13-4. Manually installing lxp.conf

[root@host lxp]# 
mkdir -p /usr/local/cmd/etc

[root@host lxp]# 
cp -v conf/lxp.conf-dist /usr/local/cmd/etc/lxp.conf

conf/lxp.conf-dist -> /usr/local/cmd/etc/lxp.conf
[root@host lxp]#

Finally, Apache's httpd.conf file must be configured for the LXP content type.

Warning

In some circumstances, httpd.conf may have been renamed to something else (such as httpsd.conf , in the case of ApacheSSL).

There are two lines that must be added to this file for LXP to be configured. These are shown in Example 13-5.

Example 13-5. Configuring httpd.conf for LXP

DirectoryIndex index.html index.lxp
AddType application/x-httpd-lxp .lxp

A line similar to the first line in Example 13-5 should already exist in your httpd.conf file. You must add index.lxp as a value to this directive if you wish for Apache to automatically look for an LXP index in a directory request.

The second line must be added from scratch. This AddType directive should be entered exactly as it is shown in Example 13-5. This line enables the LXP module to process files ending in .lxp .

It is generally not important where you put these last two directives within the httpd.conf file, though you may wish to place them with similarly named directives that already exist, to keep the configuration file organized.

Once you have finished, you must restart Apache for the changes to take effect. This is typically done with either the apachectl command, or the httpd service script.

Databases - Practical PostgreSQL
Previous Page Home Next Page

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