Note: You are viewing a non-styled version of this website. Click here to skip to the content.

Vermonster - Open Standards through Open Source

Vermonster Logo

Interchange Installation on Redhat

Posted on November 30th, 2004 under Code, Perl.

Details for the installation process for Interchange on Redhat with MySQL, includes a process for using threadless-Perl.

Update: The method has been used successfully on Redhat Fedora/EL3.

Preparing the Environment

There are a few required tasks to get Interchange up and running on a standard Redhat distribution. The first deviation is changing a key build option of Perl. But before we do this, we first want to make sure we have an important library installed.

gdbm and gdbm-devel

Both gdbm and gdbm-devel RPMs ought to be installed. gdbm is a GNU implementation of the standard Unix dbm library. More information “can be found on the GNU project website”:http://www.gnu.org/software/gdbm/gdbm.html.

One way to see if you have the packages installed is to run an RPM query and grep for the packages by name.

$ rpm -qa | grep gdbm
gdbm-1.8.0-18
gdbm-devel-1.8.0-18

This shows that both packages are installed.

If you attempt to install Interchange without gdbm, you will run into the following error when attempting to go to the checkout or access the administrative panel (this example uses the *foundation* sample store catalog).

foundation /cgi-bin/foundation/admin/index.html Runtime error:  ichelp import failed: sdbm
store returned -1, errno 22, key  "kaccess.main" at interchange/lib/Vend/Table/Common.pm
line 485, in line 3.

Perl - No threads please!

Interchange *cannot run* with multi-threaded Perl. Multi-threaded Perl is not quite mature/stable enough for production. There are very few modules out there that require it. But for whatever reason, the Redhat distribution includes multi-threaded Perl by default; this is why we need to re-install Perl.

There are two methods we recommend: 1) use the CPAN module or 2) download and install Perl from source code.

Following method 1, simply issue the following command:

$ perl -MCPAN -e 'shell'

cpan shell -- CPAN exploration and modules installation (v1.7601) ReadLine support enabled

cpan> install N/NW/NWCLARK/perl-5.8.5.tar.gz

Following method 2, “download Perl”:http://www.cpan.org/src/README.html from “CPAN”:http://www.cpan.org, unpack and configure with the following commands:

$  gzip -dc perl-5.8.5.tar.gz | tar xvf -
$ cd perl-5.8.5
$ ./Configure

Either way, the Perl setup script will launch. We answered most of the questions with the defaults, here are some of the highlights and deviations:

1. When asked to build with threads, make sure to type @n@:

Perl can be built to take advantage of threads on some systems. To do so, Configure can be run
with -Dusethreads.

Note that Perl built with threading support runs slightly slower and uses more memory than plain
Perl. The current implementation is believed to be stable, but it is fairly new, and so should be
treated with caution.

If this doesn't make any sense to you, just accept the default 'n'. Build a threading Perl?

2. The second point to check is the finding of the gdbm libraries:

Checking for optional libraries...
No -lsfio.
No -lsocket.
No -lbind.
No -linet.
Found -lnsl (shared).
No -lnm.
No -lndbm.
Found -lgdbm (shared).
No -ldbm.
No -ldb.
No -lmalloc.
Found -ldl (shared).
No -ldld.
No -lld.
No -lsun.
Found -lm (shared).
Found -lcrypt (shared).
No -lsec.
Found -lutil (shared).
Found -lc (shared).
No -lcposix.
No -lposix.
No -lucb.
No -lBSD.

*(ex) Notice the @Found -lgdbm (shared)@ above.

3. We recommend installing Perl similar to the standard Redhat layout. This will keep the Perl core code and libraries under the same directory tree. We do not recommend uninstalling the Perl RPM because of the multiple dependencies.

Running multiple versions of Perl on the same system is not uncommon, so we will mimic Redhat and install in @/usr@ and not the default @/usr/local@. This will install the libraries in @/usr/lib/perl5/5.8.5@, next to (on Redhat 8 anyway) @/usr/lib/perl5/5.8.0@.

Installation prefix to use? (~name ok) [/usr/local] /usr

4. Likewise, the binaries ought to reside in @/usr/bin@ and not @/usr/local/bin@.

Pathname where the public executables will reside? [/usr/bin]

If you’ve installed from source, you will have to run the @make@ command, followed by @make test@ and then @make install@. To see we have the correct version installed (i.e. not multi-threaded) we can type:

$ perl -v

This is perl, v5.8.5 built for i686-linux

Copyright 1987-2004, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the GNU General
Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on this system using
`man perl' or `perldoc perl'.  If you have access to the Internet, point your browser at
http://www.perl.com/, the Perl Home Page.

Threaded Perl would have said something like:

This is perl, v5.8.0 built for i386-linux-thread-multi

After Perl is installed, we can start installing the modules necessary for Interchange. That will be the topic of the second part of this series.

Leave a Reply