Installing Apache HTTP Server dependencies

Installing Apache HTTP Server dependencies involves the following steps.
1) Installing distcache
2) Installing GDBM Development package
3) Installing Lua Development package

 

1) Installing distcache
WARNING: distcache has not been updated since 19 October 2004.
Apache HTTP Server provides the Shared Object Cache feature, which allows us to share simple data across all a server’s workers, regardless of thread and process models. It is used where the advantages of sharing data across processes outweigh the performance overhead of inter-process communication.
There are four Shared Object Cache providers. mod_socache_dc.so is one such module that makes use of distcache‘s distributed session caching libraries. When the configure script is told to enable mod_socache_dc.so module, it looks for the distcache libraries. CentOS does not have an official package for distcache. So we must compile and install distcache from source.
NOTE: Installation is performed based on the rules iRULE6 and iRULE1.

The source code of distcache is available from it’s official website.
Let us go to http://distcache.sourceforge.net. In the main page, on right, click on Downloads. This will take us to the distcache‘s Sourceforge download page. I have downloaded distcache-1.5.1.tar.gz which is 742.1 KB in size.

Unpacking
Installing

Unpacking
Make sure you have copied the downloaded file distcache-1.5.1.tar.gz to directory /usr/src/. In the terminal, change to /usr/src/ directory.

# cd /usr/src


Extract the gzipped tarball.

# tar -zxvf distcache-1.5.1.tar.gz
OPTIONS EXPLAINED

-x
extract files from an archive

-v
verbosely list files processed

-z
filter the archive through gzip

-f
use archive file or device ARCHIVE


Installing
Now we will have directory distcache-1.5.1 with the extracted files. Switch to the directory in terminal.

# cd distcache-1.5.1


Now, There is a bug in distcache which causes the following error when compiling from the source.

proto_fd.c: In function 'addr_parse':
proto_fd.c:177: error: 'LONG_MIN' undeclared (first use in this function)
proto_fd.c:177: error: (Each undeclared identifier is reported only once
proto_fd.c:177: error: for each function it appears in.)
proto_fd.c:177: error: 'LONG_MAX' undeclared (first use in this function)

Functions LONG_MAX and LONG_MIN in C language are defined in limits.h header file. For more information about limits.h, see the following links.
• TutorialsPoint - http://tutorialspoint.com/c_standard_library/limits_h.htm
• The Open Group Specification - http://pubs.opengroup.org/onlinepubs/009695399/basedefs/limits.h.html

The error is coming from file proto_fd.c. So we have to make some changes. Open the file libnal/proto_fd.c. Below the line #include <libsys/post.h>, add the following content.

#include <limits.h>


Execute the configure script.
NOTE: Complete configure options for distcache.

# ./configure

This will check our system for required dependencies, assigns values for system-dependent variables and use these values to generate the Makefile.


Execute make.

# make

make will look at our Makefile, compile our program code and create the executables in the sequence described.


Execute the make install.

# make install
OPTIONS EXPLAINED

install
install will look for the target install in Makefile.PL, and install DBD::mysql to the specified location.


Finally, run ldconfig.
NOTE: Before running this command, make sure you have added the directory /usr/local/ to the System library path as instructed here.

# ldconfig

ldconfig updates the links and cache to the most recently shared libraries.; so that dynamic-linker can find them during runtime.

 

 

2) GDBM Development package
GDBM is a GNU database indexing library, including routines which use extensible hashing. It works in a similar way to standard UNIX dbm routines. It is useful for developers who write C applications and need access to a simple and efficient database or who are building C applications which will use such a database.
NDBM or New Data Base Manager is a Berkeley produced version from 1986 of the AT&T DBM database. It is no longer developed. NDBM support is currently emulated by GDBM.
CentOS v6.3 DVD1 installation does not come with GDBM development package.
Perform the below steps for installation.
NOTE: Installation is performed based on the rule iRULE4.

If you have an internet connection
If you do not have an internet connection

If you have an internet connection
In the terminal, execute the following command.

# yum install gdbm-devel
OPTIONS EXPLAINED
install
Is used to install the latest version of a package or group of packages while ensuring that all dependencies are satisfied. (See Specifying package names for more information) If no package matches the given package name(s), they are assumed to be a shell glob and any matches are then installed. If the name starts with an @ character the rest of the name is used as though passed to the groupinstall command. If the name starts with a - character, then a search is done within the transaction and any matches are removed. If the name is a file, then install works like localinstall. If the name doesn’t match a package, then package "provides" are searched (Eg. "_sqlitecache.so()(64bit)") as are filelists (Eg. "/usr/bin/yum"). Also note that for filelists, wildcards will match multiple packages.

If you do not have an internet connection
Find a system that has an internet connection. Download the enchant-devel package for CentOS v6.3 from http://vault.centos.org/6.3/os/i386/Packages/gdbm-devel-1.8.0-36.el6.i686.rpm.
The size of downloaded RPM is 25.1 KB.
In the terminal, change to the directory holding the RPM file. Execute the following command.

# rpm -ivh gdbm-devel-1.8.0-36.el6.i686.rpm
OPTIONS EXPLAINED

-i
This installs a new package.

-v
Print verbose information - normally routine progress messages will be displayed.

-h
Print 50 hash marks as the package archive is unpacked.  Use with -v|--verbose for a nicer display.

 

 

3) Installing Lua development package
Apache HTTP Server provides module mod_lua.so. This module allows the server to be extended with scripts written in the Lua programming language. When the configure script is told to enable Lua module, it looks for the Lua development files.
CentOS v6.3 DVD1 installation doesn’t come with Lua development packages.
Perform the below steps for installation.
NOTE: Installation is performed based on the rule iRULE4.

If you have an internet connection
If you do not have an internet connection

If you have an internet connection
In the terminal, execute the following command.

# yum install lua-devel
OPTIONS EXPLAINED
install
Is used to install the latest version of a package or group of packages while ensuring that all dependencies are satisfied. (See Specifying package names for more information) If no package matches the given package name(s), they are assumed to be a shell glob and any matches are then installed. If the name starts with an @ character the rest of the name is used as though passed to the groupinstall command. If the name starts with a - character, then a search is done within the transaction and any matches are removed. If the name is a file, then install works like localinstall. If the name doesn’t match a package, then package "provides" are searched (Eg. "_sqlitecache.so()(64bit)") as are filelists (Eg. "/usr/bin/yum"). Also note that for filelists, wildcards will match multiple packages.

If you do not have an internet connection
Find a system that has an internet connection. Download the lua-devel package for CentOS v6.3. You can find it at http://vault.centos.org/6.3/os/i386/Packages/lua-devel-5.1.4-4.1.el6.i686.rpm.
The size of downloaded RPM is 20 KB in size.
In the terminal, change to the directory holding the RPM file. Execute the following command.

# rpm -ivh lua-devel-5.1.4-4.1.el6.i686.rpm
OPTIONS EXPLAINED

-i
This installs a new package.

-v
Print verbose information - normally routine progress messages will be displayed.

-h
Print 50 hash marks as the package archive is unpacked.  Use with -v|--verbose for a nicer display.

 

 

 

You may go back to the following section.
Installing Apache HTTP Server