WestHost Tips

Introduction

The following steps take you through various software installations — all information learned the hard way. This page is my attempt to help you avoid all that trouble. If you find any problems, .

Contents

Install Predefined Software
Create Directories
Install Berkeley DB
Install OpenLDAP
Run OpenLDAP
Install mod_auth_mysql
Run mod_auth_mysql
Install Aspell
Install Libtool
Install Autoconf
Install M4
Install SWIG
Install Highlight
Install ViewVC
Install Subversion
Run Subversion
Install CURL
Install milter-greylist
Run milter-greylist
Configure milter-greylist
Install cpio
Install rpm2cpio
Unpack .rpm Files
Install groff
Install man, apropos, & whatis
Configure man, apropos & whatis
Install man-pages

Install Predefined Software

Within WestHost Site manager

Create Directories

When the software described below is installed, it needs a place to store its include, library, executable, and documentation files — hence we need directories to which we have write access. The usual directories for this purpose are off limits to us, so we create our own.

Note that while we do have write access to create new files in /usr/local/bin, we do not have overwrite access to the original contents of that directory. In particular, we cannot overwrite the ldap* files (ldapadd, ldapcompare, etc.), so we need a separate directory for the versions of those executable files created when we install OpenLDAP.

The following steps overcome this problem by mimicking parts of the /usr/local structure within a directory under your control. This technique1 also applies to other directories to which you don't have write access, or for which you wish to isolate your changes from the original files.

Install Berkeley DB

Berkeley DB is a database program used by OpenLDAP — you might also need it in other contexts.

  1. Check for the latest version of Berkeley DB software (5.3.21 as of this writing).

  2. Download the file into your favorite directory (e.g. /root/usr/local) and unpack it:

    wget http://download.oracle.com/otn/berkeley-db/db-5.3.21.tar.gz
    tar zxvf db-5.3.21.tar.gz

  3. [optional] Define a symbolic link to the directory created by tar so you don't have to type the cryptic name all the time — I'll use this symbolic link in the discussion below:

    ln -s  db-5.3.21  bdb

    which means define a symbolic link (ln -s) to db-5.3.21 (or whichever version you're installing) and call the link bdb (or whatever name you like to use — substitute your choice for bdb below).

  4. Change to the bdb/build_unix directory:

    cd bdb/build_unix

  5. In this directory, create a file (e.g. config) with the following content:

    #! /bin/sh
    
    CPPFLAGS='-I/root/usr/local/include -I/usr/local/include' \
    LDFLAGS='-L/root/usr/local/lib -L/usr/local/lib -L/usr/lib' \
    '../dist/configure' \
    '--prefix=/root/usr/local' \
    "$@"
    
    # Run the following commands:
    #   ./config
    #   make
    #   make install
    #
    # If ./config runs cleanly and subsequently you change the
    # options to the configure script, first run the command
    #   make realclean
    # to start afresh.

    Insert other configuration options as necessary — run

    ./configure --help

    to see all configuration options.

  6. Make the above file executable:

    chmod 0755 config

  7. From the bdb/build_unix directory, run the commands mentioned at the end of the config file:

    ./config
    make
    make install

    If these commands run cleanly, you have successfully installed Berkeley DB.

  8. To conserve space, you may wish to remove the bdb directory and db-5.3.21.tar.gz file.

Install OpenLDAP

OpenLDAP (Lightweight Directory Access Protocol) is a server which I use for my Mozilla Thunderbird address book.

  1. Install Berkeley DB.

  2. Install groff.

  3. Check for the latest version of OpenLDAP software (2.4.16 as of this writing).

  4. Download the file into your favorite directory (e.g. /root/usr/local) and unpack it:

    wget ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/openldap-2.4.16.tgz
    tar zxvf openldap-2.4.16.tgz

  5. [optional] Define a symbolic link to the directory created by tar so you don't have to type the cryptic name all the time — I'll use this symbolic link in the discussion below:

    ln -s  openldap-2.4.16  openldap

    which means define a symbolic link (ln -s) to openldap-2.4.16 (or whichever version you're installing) and call the link openldap (or whatever name you like to use — substitute your choice for openldap below).

  6. Change to the openldap directory:

    cd openldap

  7. In this directory, create a file (e.g. config) with the following content:

    #! /bin/sh
    
    CPPFLAGS='-I/root/usr/local/include -I/usr/local/include' \
    LDFLAGS='-L/root/usr/local/lib -L/usr/local/lib -L/usr/lib' \
    './configure' \
    '--prefix=/root/usr/local' \
    "$@"
    
    # Run the following commands:
    #   ./config
    #   make depend
    #   make
    #   make test
    #   make install
    #
    # If ./config runs cleanly and subsequently you change the
    # options to the configure script, first run the command
    #   make veryclean
    # to start afresh.

    Insert other configuration options as necessary — run

    ./configure --help

    to see all configuration options.

  8. Make the above file executable:

    chmod 0755 config

  9. From the openldap directory, run the commands mentioned at the end of the config file:

    ./config
    make depend
    make
    make test
    (this one takes quite a while — go do something else and come back later)
    make install

    If these commands run cleanly, you have successfully installed OpenLDAP.

  10. To conserve space, you may wish to remove the openldap directory and openldap-2.4.16.tgz file.

  11. Setup OpenLDAP to run.

Run OpenLDAP

  1. Edit the file /usr/local/etc/openldap/slapd.conf to define appropriate schema and other attributes (see Share an Address Book for a whole discussion on this and other related topics).

    Remember that you are now running under the /root hierarchy. In particular,

  2. In the directory /root/usr/local/bin, create a file (I call it slart as a contraction of slapd start) with the following contents:

    #! /bin/sh
    #
    # Start slapd with fixed and optional arguments
    
    echo "Starting slapd..."
    /root/usr/local/libexec/slapd -f /root/usr/local/etc/openldap/slapd.conf -h ldap://example.com $@

    Replace example.com with your domain name.

  3. Make the above file executable:

    chmod 0755 slart

  4. In the directory /root/usr/local/bin, create a file (I call it slop as a contraction of slapd stop) with the following contents:

    #! /bin/sh
    #
    # Stop slapd
    
    echo "Stopping slapd..."
    kill `cat /root/usr/local/var/run/slapd.pid`
  5. Make the above file executable:

    chmod 0755 slop

  6. Run the shell script slart to start your LDAP server, and run the shell script slop to stop it.

  7. To tell the system how to start and stop your LDAP server (say, via the restart command), define two symbolic links in the directory /etc/rc.d/rc2.d/ as follows:

    ln -s /root/usr/local/bin/slart S00slart
    ln -s /root/usr/local/bin/slop  K00slop

    The structure of the /etc/rc.d/ directory is such that the script rc is run with an argument of start to start services, and with an argument of stop to stop services. The script then runs each of the scripts in /etc/rc.d/rc2.d/ beginning with the letter S to start services and /etc/rc.d/rc0.d/ beginning with the letter K to stop services (as it turns out /etc/rc.d/rc0.d/ points to /etc/rc/rc2.d/, so we're talking about the same directory).

  8. To view your LDAP server's contents, there are various free programs available — one I particularly like is Softerra's LDAP Browser.

Install mod_auth_mysql

I like to use mod_auth_mysql for authentication of directory access because it allows me to use a two-line <Directory ...> ... </Directory> entry for all my directories and then manage user access through PHP My Admin. Here's how you can do the same:

  1. Define MySQL tables to contain the authentication data which controls access to web pages (and can be extended for additional authentication).

    1. Download this file with the database and table structure to a new directory (say, mysql).

      mkdir -p /root/usr/local/mysql
      cd /root/usr/local/mysql
      wget ftp://qualitas.biz/http_auth-struc.sql

    2. Run these commands to create the MySQL database:

      mysql -u username -p password < http_auth-struc.sql

      Substitute the username and password you setup in MySQL for username and password.

      This creates the table structure needed for the database http_auth. In particular it defines table and field names which we'll need to reference below. If you choose to change the names be sure to reflect your changes below.

    3. Using PHP My Admin, enter user names and their associated passwords in the UserPasswd table, and user names and their associated groups in the UserGroup table.

      These types of entries through PHP My Admin are all you'll need to maintain access to your directories.

      When specifying the password entry to MySQL for each username, whatever encryption method you choose (PASSWORD, MD5, SHA1, ENCRYPT, <blank>) should be reflected in the -DENCRYPTION=defaultencryption line (SCRAMBLED, MD5, SHA1, CRYPT, NONE) in the script below, e.g. -DENCRYPTION=MD5 .

      Note that the encryption method you choose is used between mod_auth_mysql and the MySQL database only, NOT between the browser client and the web server. The username and password in the latter communication channel are transmitted essentially in the clear (i.e. base-64 encoded) when using AuthType Basic, so the encryption protects the password as saved in the MySQL database only. If you have information in a directory you need to protect, use SSL (i.e., https://).

    4. The database, table and field names should be reflected in the -D... entries in the config script below.

      For example,

      -DDB=databasename    -DDB=http_auth
      -DPWTABLE=userpasswdtablename    -DPWTABLE=UserPasswd
      -DNAMEFIELD=userfieldname    -DNAMEFIELD=UserName
      -DPASSWORDFIELD=passwdfieldname    -DPASSWORDFIELD=Passwd
  2. Check for the latest version of mod_auth_mysql software (3.0.0 as of this writing).

  3. Download the file into your favorite directory (e.g. /root/usr/local) and unpack it:

    wget http://downloads.sourceforge.net/modauthmysql/mod_auth_mysql-3.0.0.tar.gz
    tar zxvf mod_auth_mysql-3.0.0.tar.gz

  4. [optional] Define a symbolic link to the directory created by tar so you don't have to type the cryptic name all the time — I'll use this symbolic link in the discussion below:

    ln -s  mod_auth_mysql-3.0.0  mam

    which means define a symbolic link (ln -s) to mod_auth_mysql-3.0.0 (or whichever version you're installing) and call the link mam (or whatever name you like to use — substitute your choice for mam below).

  5. Change to the mam directory.

    cd mam

  6. In this directory, create a file (e.g. config) with the following content:

    #! /bin/sh
    
    'apxs' \
    '-c' \
    '-DHOST=localhost' \
    '-DSOCKET=/var/lib/mysql/mysql.sock' \
    '-DUSER=username' \
    '-DPASSWORD=password' \
    '-DDB=databasename' \
    '-DPWTABLE=userpasswdtablename' \
    '-DNAMEFIELD=userfieldname' \
    '-DPASSWORDFIELD=passwdfieldname' \
    '-DENABLE=1' \
    '-DENCRYPTION=defaultencryption' \
    '-I/usr/local/mysql/include' \
    '-L/usr/local/mysql/lib' \
    '-lmysqlclient' \
    '-lm' \
    '-lz' \
    'mod_auth_mysql.c' \
    "$@"
    
    # Substitute your username for username (same as in config.inc.php, controluser field),
    # ... password for password (same as in config.inc.php, controlpass field),
    # ... database name for databasename (e.g. http_auth),
    # ... username/password table name for userpasswdtablename (e.g. UserPasswd),
    # ... username field name for userfieldname (e.g. UserName),
    # ... password field name for passwdfieldname (e.g. Passwd),
    # ... default encryption method for defaultencryption (e.g. MD5).
    
    # Run the following commands:
    # ./config
    # apxs -i mod_auth_mysql.so

    Insert other configuration options as necessary — run

    ./configure --help

    to see all configuration options.

  7. Make the above file executable:

    chmod 0755 config

  8. From the mam directory, run the commands mentioned at the end of the config file:

    ./config
    apxs -i mod_auth_mysql.so

  9. In your httpd.conf file, uncomment the following lines:

    LoadModule  mysql_auth_module  modules/mod_auth_mysql.so
    AddModule   mod_auth_mysql.c

  10. Type restart at the command line.

    If the above commands run cleanly and Apache restarts cleanly, you have successfully installed mod_auth_mysql.

  11. To conserve space, you may wish to remove the mam directory and mod_auth_mysql-3.0.0.tar.gz file.

  12. Setup mod_auth_mysql to run.

Run mod_auth_mysql

Now you are ready to protect your directories. While some prefer using .htaccess files, I prefer to place all such directives in my httpd.conf file as that provides better performance — the web server doesn't have to reload the .htaccess file on every page access. Actually, I prefer to place these directives in a separate file which is then included in my httpd.conf file.

  1. Define a new file /etc/httpd/conf/authmysql.conf with the following contents:

    #### Global Settings to Manage Directory Protection via mod_auth_mysql ####
    
    <Directory />
    # These directives are common to all directories protected by mod_auth_mysql.
    
    # Use this as the name of the table with the group information when authenticating by groups
      AuthMySQLGroupTable   UserGroup
    
    # Use this as the name of the column containing the group information
      AuthMySQLGroupField   Groups
    
    # Specify the authentication type
      AuthType              Basic
    </Directory>
    
    #### Per-directory settings ####
    
    # **WARNING**
    # Within the <require> directive, the entity-names
    #   <user>, <group>, and <valid-user> are case sensitive.
    # If you uppercase even one letter in one of those names,
    #   the <require> directive is ignored without warning,
    #   and your directory will be unprotected, open to all.
    
    # Duplicate the following four lines as needed to protect other directories
    
    <Directory      directory>
      AuthName      "IdentifyingText"
      Require       group groupname
    </Directory>

    In the above lines

    • Replace directory with the actual directory (presumably under /var/www/html or whatever DocumentRoot is, although that's not necessary)

    • Replace IdentifyingText with whatever text you want to appear in the authentication dialog

    • Replace groupname with the name of the group for which membership in that group allows access to this directory.

  2. Place the following line in your httpd.conf file:

    Include /etc/httpd/conf/authmysql.conf

    perhaps in Section 2 along with the other <Directory> entries.

  3. From here on, place a <Directory> entry in this file for each directory you want to protect. Then fire up PHP My Admin to select which users are in the groupname you chose.

  4. Don't forget to restart after each time you change a .conf file.

Install Aspell

From the GNU Aspell main page

"GNU Aspell is a spell checker designed to eventually replace Ispell. It can either be used as a library or as an independent spell checker. Its main feature is that it does a superior job of suggesting possible replacements for a misspelled word than just about any other spell checker out there for the English language. Unlike Ispell, Aspell can also easily check documents in UTF-8 without having to use a special dictionary. Aspell will also do its best to respect the current locale setting. Other advantages over Ispell include support for using multiple dictionaries at once and intelligently handling personal dictionaries when more than one Aspell process is open at once."

  1. Check for the latest version of Aspell software (0.60.6 as of this writing).

  2. Download the file into your favorite directory (e.g. /root/usr/local) and unpack it:

    wget ftp://ftp.gnu.org/gnu/aspell/aspell-0.60.6.tar.gz
    tar zxvf aspell-0.60.6.tar.gz

  3. [optional] Define a symbolic link to the directory created by tar so you don't have to type the cryptic name all the time — I'll use this symbolic link in the discussion below:

    ln -s  aspell-0.60.6  aspell

    which means define a symbolic link (ln -s) to aspell-0.60.6 (or whichever version you're installing) and call the link aspell (or whatever name you like to use — substitute your choice for aspell below).

  4. Change to the aspell directory:

    cd aspell

  5. In this directory, create a file (e.g. config) with the following content:

    #! /bin/sh
    
    CPPFLAGS='-I/root/usr/local/include -I/usr/local/include' \
    LDFLAGS='-L/root/usr/local/lib -L/usr/local/lib -L/usr/lib' \
    './configure' \
    '--prefix=/root/usr/local' \
    "$@"
    
    # Run the following commands:
    #   ./config
    #   make
    #   make install
    #
    # If ./config runs cleanly and subsequently you change the
    # options to the configure script, first run the command
    #   make clean
    # to start afresh.

    Insert other configuration options as necessary — run

    ./configure --help

    to see all configuration options.

  6. Make the above file executable:

    chmod 0755 config

  7. From the aspell directory, run the commands mentioned at the end of the config file:

    ./config
    make
    make install

    If these commands run cleanly, you have successfully installed Aspell.

  8. Lastly, you must install a dictionary, so download one (say the English dictionary).

  9. Download the file into your favorite directory (e.g. /root/usr/local/aspell/dictionaries/en) and unpack it:

    mkdir -p /root/usr/local/aspell/dictionaries/en
    cd /root/usr/local/aspell/dictionaries/en
    wget ftp://ftp.gnu.org/gnu/aspell/dict/en/aspell6-en-6.0-0.tar.bz2
    bunzip2 aspell6-en-6.0-0.tar.bz2
    tar xvf aspell6-en-6.0-0.tar

  10. [optional] Define a symbolic link to the directory created by tar so you don't have to type the cryptic name all the time — I'll use this symbolic link in the discussion below:

    ln -s  aspell6-en-6.0-0  aspell-en

    which means define a symbolic link (ln -s) to aspell6-en-6.0-0 (or whichever version you're installing) and call the link aspell-en (or whatever name you like to use — substitute your choice for aspell-en below).

  11. Change to the aspell-en directory:

    cd aspell-en

  12. In this directory, create a file (e.g. config) with the following content:

    #! /bin/sh
    
    './configure' \
    "$@"
    
    # Run the following commands:
    #   ./config
    #   make
    #   make install
    #
    # If ./config runs cleanly and subsequently you change the
    # options to the configure script, first run the command
    #   make clean
    # to start afresh.

    Insert other configuration options as necessary — run

    ./configure --help

    to see all configuration options.

  13. Make the above file executable:

    chmod 0755 config

  14. From the aspell-en directory, run the commands mentioned at the end of the config file:

    ./config
    make
    make install

    If these commands run cleanly, you have successfully installed Aspell-en.

  15. To conserve space, you may wish to remove the aspell directory and aspell-0.60.6.tar.gz file.

Install Libtool

GNU libtool is a generic library support script. Libtool hides the complexity of using shared libraries behind a consistent, portable interface. This package is already installed and available on your system, but the Subversion package needs a more recent version (1.5 or later, whereas at one time version 1.4 was initially installed).

First, check to see if the installed version is acceptable by entering the following line:

libtool --version

If the version is 1.5 or later, there's no need to install a newer version and you can skip the following steps:

  1. Check for the latest version of Libtool software (2.4.2 as of this writing).

  2. Download the file into your favorite directory (e.g. /root/usr/local) and unpack it:

    wget ftp://ftp.gnu.org/gnu/libtool/libtool-2.4.2.tar.gz
    tar zxvf libtool-2.4.2.tar.gz

  3. [optional] Define a symbolic link to the directory created by tar so you don't have to type the cryptic name all the time — I'll use this symbolic link in the discussion below:

    ln -s  libtool-2.4.2  libtool

    which means define a symbolic link (ln -s) to libtool-2.4.2 (or whichever version you're installing) and call the link libtool (or whatever name you like to use — substitute your choice for libtool below).

  4. Change to the libtool directory:

    cd libtool

  5. In this directory, create a file (e.g. config) with the following content:

    #! /bin/sh
    
    CPPFLAGS='-I/root/usr/local/include -I/usr/local/include' \
    LDFLAGS='-L/root/usr/local/lib -L/usr/local/lib -L/usr/lib' \
    './configure' \
    '--prefix=/root/usr/local' \
    "$@"
    
    # Run the following commands:
    #   ./config
    #   make
    #   make install
    #
    # If ./config runs cleanly and subsequently you change the
    # options to the configure script, first run the command
    #   make clean
    # to start afresh.

    Insert other configuration options as necessary — run

    ./configure --help

    to see all configuration options.

  6. Make the above file executable:

    chmod 0755 config

  7. From the libtool directory, run the commands mentioned at the end of the config file:

    ./config
    make
    make install

    If these commands run cleanly, you have successfully installed Libtool.

  8. To conserve space, you may wish to remove the libtool directory and libtool-2.4.2.tar.gz file.

Install M4

M4 is an implementation of the traditional UNIX macro processor.

This package is already installed and available on your system, but the Autoconf package needs a more recent version (1.4.6 or later, whereas at one time version 1.4.1 was initially installed).

First, check to see if the installed version is acceptable by entering the following line:

m4 -version

If the version is 1.4.6 or later, there's no need to install a newer version and you can skip the following steps:

  1. Check for the latest version of M4 software (1.4.16 as of this writing).

  2. Download the file into your favorite directory (e.g. /root/usr/local) and unpack it:

    wget ftp://ftp.gnu.org/gnu/m4/m4-1.4.16.tar.gz
    tar zxvf m4-1.4.16.tar.gz

  3. [optional] Define a symbolic link to the directory created by tar so you don't have to type the cryptic name all the time — I'll use this symbolic link in the discussion below:

    ln -s  m4-1.4.16  m4

    which means define a symbolic link (ln -s) to m4-1.4.16 (or whichever version you're installing) and call the link m4 (or whatever name you like to use — substitute your choice for m4 below).

  4. Change to the m4 directory:

    cd m4

  5. In this directory, create a file (e.g. config) with the following content:

    #! /bin/sh
    
    CPPFLAGS='-I/root/usr/local/include -I/usr/local/include' \
    LDFLAGS='-L/root/usr/local/lib -L/usr/local/lib -L/usr/lib' \
    './configure' \
    '--prefix=/root/usr/local' \
    "$@"
    
    # Run the following commands:
    #   ./config
    #   make
    #   make install
    #
    # If ./config runs cleanly and subsequently you change the
    # options to the configure script, first run the command
    #   make clean
    # to start afresh.

    Insert other configuration options as necessary — run

    ./configure --help

    to see all configuration options.

  6. Make the above file executable:

    chmod 0755 config

  7. From the m4 directory, run the commands mentioned at the end of the config file:

    ./config
    make
    make install

    If these commands run cleanly, you have successfully installed M4.

  8. To conserve space, you may wish to remove the m4 directory and m4-1.4.16.tar.gz file.

Install Autoconf

Autoconf is a tool that produces shell scripts so as to configure software source code packages automatically. This package is already installed and available on your system, but the Subversion package needs a more recent version (2.50 or later, whereas at one time version 2.13 was initially installed).

First, check to see if the installed version is acceptable by entering the following line:

autoconf -V

If the version is 2.50 or later, there's no need to install a newer version and you can skip the following steps:

  1. Install M4.

  2. Check for the latest version of Autoconf software (2.68 as of this writing).

  3. Download the file into your favorite directory (e.g. /root/usr/local) and unpack it:

    wget ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.68.tar.gz
    tar zxvf autoconf-2.68.tar.gz

  4. [optional] Define a symbolic link to the directory created by tar so you don't have to type the cryptic name all the time — I'll use this symbolic link in the discussion below:

    ln -s  autoconf-2.68  autoconf

    which means define a symbolic link (ln -s) to autoconf-2.68 (or whichever version you're installing) and call the link autoconf (or whatever name you like to use — substitute your choice for autoconf below).

  5. Change to the autoconf directory:

    cd autoconf

  6. In this directory, create a file (e.g. conf, but not config as there is already a directory of that name) with the following content:

    #! /bin/sh
    
    CPPFLAGS='-I/root/usr/local/include -I/usr/local/include' \
    LDFLAGS='-L/root/usr/local/lib -L/usr/local/lib -L/usr/lib' \
    './configure' \
    '--prefix=/root/usr/local' \
    "$@"
    
    # Run the following commands:
    #   ./conf
    #   make
    #   make install
    #
    # If ./conf runs cleanly and subsequently you change the
    # options to the configure script, first run the command
    #   make clean
    # to start afresh.

    Insert other configuration options as necessary — run

    ./configure --help

    to see all configuration options.

  7. Make the above file executable:

    chmod 0755 conf

  8. From the autoconf directory, run the commands mentioned at the end of the conf file:

    ./conf
    make
    make install

    If these commands run cleanly, you have successfully installed Autoconf.

  9. To conserve space, you may wish to remove the autoconf directory and autoconf-2.68.tar.gz file.

Install SWIG

SWIG (Simplifed Wrapper and Interface Generator) is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages.

  1. Install Python from the WestHost Site manager.

  2. Check for the latest version of SWIG software (2.0.8 as of this writing).

  3. Download the file into your favorite directory (e.g. /root/usr/local) and unpack it:

    wget http://downloads.sourceforge.net/swig/swig-2.0.8.tar.gz
    tar zxvf swig-2.0.8.tar.gz

  4. [optional] Define a symbolic link to the directory created by tar so you don't have to type the cryptic name all the time — I'll use this symbolic link in the discussion below:

    ln -s  swig-2.0.8  swig

    which means define a symbolic link (ln -s) to swig-2.0.8 (or whichever version you're installing) and call the link swig (or whatever name you like to use — substitute your choice for swig below).

  5. Change to the swig directory:

    cd swig

  6. In this directory, create a file (e.g. config) with the following content:

    #! /bin/sh
    
    CPPFLAGS='-I/root/usr/local/include -I/usr/local/include' \
    LDFLAGS='-L/root/usr/local/lib -L/usr/local/lib -L/usr/lib' \
    './configure' \
    '--prefix=/root/usr/local' \
    '--with-python=/usr/bin' \
    "$@"
    
    # Run the following commands:
    #   ./config
    #   make
    #   make install
    #
    # If ./config runs cleanly and subsequently you change the
    # options to the configure script, first run the command
    #   make clean
    # to start afresh.

    Insert other configuration options as necessary — run

    ./configure --help

    to see all configuration options.

  7. Make the above file executable:

    chmod 0755 config

  8. From the swig directory, run the commands mentioned at the end of the config file:

    ./config
    make
    make install

    If these commands run cleanly, you have successfully installed SWIG.

  9. To conserve space, you may wish to remove the swig directory and swig-2.0.8.tar.gz file.

Install Highlight

Highlight is a syntax coloring program (along with other features) to improve the display of many programming languages. It is used in ViewVC.

  1. Check for the latest version of Highlight software (3.12 as of this writing).

  2. Download the file into your favorite directory (e.g. /root/usr/local) and unpack it:

    wget http://www.andre-simon.de/zip/highlight-3.12.tar.gz
    tar zxvf highlight-3.12.tar.gz

  3. [optional] Define a symbolic link to the directory created by tar so you don't have to type the cryptic name all the time — I'll use this symbolic link in the discussion below:

    ln -s  highlight-3.12  highlight

    which means define a symbolic link (ln -s) to highlight-3.12 (or whichever version you're installing) and call the link highlight (or whatever name you like to use — substitute your choice for highlight below).

  4. Change to the highlight directory:

    cd highlight

  5. If you wish to reference a separate configuration file in which to place highlight-specific command line parameters, edit the file src/makefile as follows:

    Append to the line that starts with CFLAGS:= the text -DCONFIG_FILE_PATH=\"/root/usr/local/etc/highlight/.highlightrc\" .

  6. In this directory, create a file (e.g. mk) with the following content:

    #! /bin/sh
    
    make DESTDIR=/root/usr/local PREFIX=
    

    In this directory, create another file (e.g. mkinstall) with the following content:

    #! /bin/sh
    
    make install DESTDIR=/root/usr/local PREFIX=
    

    Insert other options as necessary — run

    make --help

    to see all options.

  7. Make the above two files executable:

    chmod 0755 mk
    chmod 0755 mkinstall

  8. Run the following commands:

    mk
    mkinstall

    If these commands run cleanly, you have successfully installed highlight.

  9. If you change any of the above options to mk, run make clean .

  10. Highlight places its configuration files in the directories /root/usr/local/etc/highlight/ and /root/usr/local/share/highlight/ the content of which you might need to change. For example, if you have files with extensions not known to highlight, edit the file /root/usr/local/etc/highlight/filetypes.conf. If you need to define a new language file, place it in /root/usr/local/share/highlight/langDefs/ and reference it in the filetypes.conf file, or if there are command line parameters you wish to pass to highlight, place them in /root/usr/local/etc/highlight/.highlightrc .

  11. To conserve space, you may wish to remove the highlight directory and highlight-3.12.tar.gz file.

Install ViewVC

ViewVC is a browser interface for CVS and Subversion version control repositories.

  1. Install SWIG.

  2. Install Highlight.

  3. Check for the latest version of ViewVC software (1.1.17 as of this writing).

  4. Download the file into your favorite directory (e.g. /root/usr/local) and unpack it:

    wget http://viewvc.tigris.org/files/documents/3330/49243/viewvc-1.1.17.tar.gz
    tar zxvf viewvc-1.1.17.tar.gz

  5. [optional] Define a symbolic link to the directory created by tar so you don't have to type the cryptic name all the time — I'll use this symbolic link in the discussion below:

    ln -s  viewvc-1.1.17  viewvc-tmp

    which means define a symbolic link (ln -s) to viewvc-1.1.17 (or whichever version you're installing) and call the link viewvc-tmp (or whatever name you like to use, but not viewvc as we'll be using that in a moment — substitute your choice for viewvc-tmp below).

  6. Change to the viewvc-tmp directory:

    cd viewvc-tmp

  7. Run the command:

    viewvc-install

    and respond to the prompts as follows:

    Installation path [/usr/local/viewvc-1.1.17]: /root/usr/local/viewvc
    DESTDIR path (generally only used by package maintainers) []:

  8. Edit the file /root/usr/local/viewvc/viewvc.conf to point to the Subversion repository (ies) as follows:

    [general]
    svn_roots = name: /path/to/repos
    root_parents = /path : name
    default_root = name
    svn_path = /path
    mime_types_file = /path/mime.types
    address = <a href="...">email@example.com</a>

    [options]
    allow_tar = 1
    use_highlight = 1

    For example, my file has the following entries:

    [general]
    svn_roots = nars2000: /root/usr/local/repos/nars2000
    root_parents = /root/usr/local/repos : svn
    default_root = nars2000
    svn_path = /root/usr/local/bin
    mime_types_file = /etc/mime.types
    address=<a href="mailto:svnmaster@nars2000.org">svnmaster@nars2000.org</a>

    [options]
    allow_tar = 1
    use_highlight = 1
    use_php = 1

  9. Edit the file /root/usr/local/viewvc/bin/cgi/viewvc.cgi to insert two lines below the line import os as follows:

    import os

    sys.path.insert(0, '/root/usr/local/lib')
    sys.path.insert(0, '/root/usr/local/lib/svn-python')

    Make the same changes to the file /root/usr/local/viewvc/bin/cgi/query.cgi .

  10. To change the colors displayed by ViewVC, edit the file /root/usr/local/viewvc/templates/docroot/styles.css .

  11. To conserve space, you may wish to remove the viewvc-tmp directory and viewvc-1.1.17.tar.gz file.

Install Subversion

Subversion is a version control system which allows you to maintain programmer's source code across multiple developers. For more details, see the Subversion home page.

My goal here is to run Subversion as a server in the same manner as Apache and MySQL are servers so it can serve the source code I'd like to make public. There are two ways this can be done: using Apache 2.0 or as a standalone server. This description shows how to install the latter server.

  1. Install Libtool.

  2. Install Autoconf.

  3. Install ViewVC.

  4. Install Berkeley DB.

  5. Check for the latest version of Subversion software (1.7.7 as of this writing).

  6. Download the file into your favorite directory (e.g. /root/usr/local) and unpack it:

    wget http://www.carfab.com/apachesoftware/subversion/subversion-1.7.7.tar.gz
    tar zxvf subversion-1.7.7.tar.gz

  7. [optional] Define a symbolic link to the directory created by tar so you don't have to type the cryptic name all the time — I'll use this symbolic link in the discussion below:

    ln -s  subversion-1.7.7  subversion

    which means define a symbolic link (ln -s) to subversion-1.7.7 (or whichever version you're installing) and call the link subversion (or whatever name you like to use — substitute your choice for subversion below).

  8. Change to the subversion directory:

    cd subversion

  9. In this directory, create a file (e.g. config) with the following content:

    #! /bin/sh
    
    CPPFLAGS='-I/root/usr/local/include -I/usr/local/include' \
    LDFLAGS='-L/root/usr/local/lib -L/usr/local/lib -L/usr/lib' \
    './configure' \
    '--prefix=/root/usr/local' \
    '--with-berkeley-db=/root/usr/local/bdb' \
    "$@"
    
    # Run the following commands:
    #   ./config
    #   make
    #   make install
    #
    # If ./config runs cleanly and subsequently you change the
    # options to the configure script, first run the command
    #   make clean
    # to start afresh.

    Insert other configuration options as necessary — run

    ./configure --help

    to see all configuration options.

  10. Make the above file executable:

    chmod 0755 config

  11. From the subversion directory, run the commands mentioned at the end of the config file:

    ./config
    make
    make install

    If these commands run cleanly, you have successfully installed Subversion.

  12. If you have already installed SWIG, then tell Subversion about it by running the following commands from subversion:

    make swig-py
    make install-swig-py

  13. To conserve space, you may wish to remove the subversion directory and subversion-1.7.7.tar.gz and subversion-deps-1.7.7.tar.gz files.

  14. Setup Subversion to run.

Run Subversion

  1. Create a directory into which all of your source will be stored. For example

    mkdir /root/usr/local/repos

    Use whatever subdirectory you like in place of repos.

  2. Create the master source repository, as in

    svnadmin create /root/usr/local/repos (there is no output from this command)

  3. Install subversion as a server as follows:

    In the directory /etc/rc.d/init.d, create a file named svnd

    #!/bin/bash
    
    # Start/stop script for Subversion server (svnserve)
    
    svnserve=/root/usr/local/bin/svnserve
    prog=svnserve
    pidfile=/var/run/svnserve.pid
    rootdir=/root/usr/local/repos
    
    # svnserve --help
    # usage: svnserve [options]
    #
    # Valid options:
    #  -d [--daemon]            : daemon mode
    #  --listen-port arg        : listen port (for daemon mode)
    #  --listen-host arg        : listen hostname or IP address (for daemon mode)
    #  --foreground             : run in foreground (useful for debugging)
    #  -h [--help]              : display this help
    #  --version                : show program version information
    #  -i [--inetd]             : inetd mode
    #  -r [--root] arg          : root of directory to serve
    #  -R [--read-only]         : force read only, overriding repository config file
    #  -t [--tunnel]            : tunnel mode
    #  --tunnel-user arg        : tunnel username (default is current uid's name)
    #  -T [--threads]           : use threads instead of fork
    #  -X [--listen-once]       : listen once (useful for debugging)
    #  --pid-file arg           : write server process ID to file arg
    
    OPTIONS="-d --listen-port 3690 -r $rootdir --pid-file $pidfile"
    
    
    start() {
            echo -n $"Starting $prog: "
            pid=`cat $pidfile 2>/dev/null`
            [ "$pid" ] \
         && [ "`find  /proc/${pid}/exe -printf '%l%U\n' 2>/dev/null \
            | awk -F'/' '{print $NF}'`" != "svnserve`id -u`" ] \
         && /bin/rm -f $pidfile
    
            $svnserve $OPTIONS
            RETVAL=$?
            if [ $RETVAL = 0 ] ; then
                    echo -n [OK]
            fi
            echo
            [ $RETVAL = 0 ] && touch /var/lock/subsys/svnserve
            return $RETVAL
    }
    stop() {
            echo -n $"Stopping $prog: "
            pid=`cat $pidfile 2>/dev/null`
            kill $pid
            RETVAL=$?
            if [ $RETVAL = 0 ] ; then
                    echo -n [OK]
            fi
            echo
            if [ $RETVAL = 0 ] ; then
                    rm -f /var/lock/subsys/svnserve $pidfile
                    pid=`pidof -o $$ -o $PPID -o %PPID -x ${svnserve} || pidof -o $$ -o $PPID -o %PPID -x ${prog}`
                    if [ "$pid" ] ; then
                            kill $pid
                            RETVAL=$?
                    fi
            fi
    }
    
    # Split cases based upon the first argument to this script
    case "$1" in
      start)
            start
            ;;
      stop)
            stop
            ;;
      restart)
            stop
            start
            ;;
    esac
    
    exit $RETVAL
  4. In directory /etc/rc.d/rc2.d, create two symbolic links as follows:

    ln -s ../init.d/svnd K02svnd
    ln -s ../init.d/svnd S02svnd

    Because of the above two links, subsequent restarts of the system will also start the Subversion server.

  5. Start the Subversion server with the command

    /etc/rc.d/init.d/svnd start

Install CURL

CURL is a free and easy-to-use client-side URL transfer tool. The associated library is needed for milter-greylist if you use the urlcheck keyword in greylist.conf.

  1. Check for the latest version of CURL software (7.18.0 as of this writing).

  2. Download the file into your favorite directory (e.g. /root/usr/local) and unpack it:

    wget http://curl.haxx.se/download/curl-7.18.0.tar.gz
    tar zxvf curl-7.18.0.tar.gz

  3. [optional] Define a symbolic link to the directory created by tar so you don't have to type the cryptic name all the time — I'll use this symbolic link in the discussion below:

    ln -s  curl-7.18.0  curl

    which means define a symbolic link (ln -s) to curl-7.18.0 (or whichever version you're installing) and call the link curl (or whatever name you like to use — substitute your choice for curl below).

  4. Change to the curl directory:

    cd curl

  5. In this directory, create a file (e.g. config) with the following content:

    #! /bin/sh
    
    CPPFLAGS='-I/root/usr/local/include -I/usr/local/include' \
    LDFLAGS='-L/root/usr/local/lib -L/usr/local/lib -L/usr/lib' \
    './configure' \
    '--prefix=/root/usr/local' \
    '--enable-thread' \
    "$@"
    
    # Run the following commands:
    #   ./config
    #   make
    #   make check
    #   make install
    #
    # If ./config runs cleanly and subsequently you change the
    # options to the configure script, first run the command
    #   make clean
    # to start afresh.

    Insert other configuration options as necessary — run

    ./configure --help

    to see all configuration options.

  6. Make the above file executable:

    chmod 0755 config

  7. From the curl directory, run the commands mentioned at the end of the config file:

    ./config
    make
    make check
    make install

    If these commands run cleanly, you have successfully installed CURL.

  8. To conserve space, you may wish to remove the curl directory and curl-7.18.0.tar.gz file.

Install milter-greylist

The mail filter milter-greylist for sendmail can drastically reduce the amount of spam you receive from zombies. Zombies are computers infected with a virus which allows them to be controlled by an external computer. Among other chores, zombies are used to distribute spam around the world. According to Commtouch, in 2007 zombies accounted for an average of 80% of the total spam on the Internet, peaking to 96% in early Q4. For more details on this mail filter, see the milter-greylist home page.

  1. Install CURL only if you use the urlcheck keyword in greylist.conf (probably not at first as it's a rather advanced option).

  2. Ask Westhost to install on your server the version of libmilter which matches the version of sendmail run by them. The library may be saved into the /usr/local/lib directory (file: libmilter.a), and the requisite header files into the (new) /usr/local/include/libmilter directory (files: mfapi.h and mfdef.h). Alternatively, you may download them from my site: libmilter.a, mfapi.h, and mfdef.h, although I can't guarantee these are the most up-to-date.

  3. Check for the latest version of milter-greylist software (4.1.1 as of this writing).

  4. Download the file into your favorite directory (e.g. /root/usr/local) and unpack it:

    wget ftp://ftp.espci.fr/pub/milter-greylist/milter-greylist-4.1.1.tgz
    tar zxvf milter-greylist-4.1.1.tgz

  5. [optional] Define a symbolic link to the directory created by tar so you don't have to type the cryptic name all the time — I'll use this symbolic link in the discussion below:

    ln -s  milter-greylist-4.1.1  milter-greylist

    which means define a symbolic link (ln -s) to milter-greylist-4.1.1 (or whichever version you're installing) and call the link milter-greylist (or whatever name you like to use — substitute your choice for milter-greylist below).

  6. Change to the milter-greylist directory:

    cd milter-greylist

  7. In this directory, create a file (e.g. config) with the following content (if you did not install CURL, omit the line '--with-libcurl=/root/usr/local/lib' \):

    #! /bin/sh
    
    CPPFLAGS='-I/root/usr/local/include -I/usr/local/include' \
    LDFLAGS='-L/root/usr/local/lib -L/usr/local/lib -L/usr/lib' \
    './configure' \
    '--prefix=/root/usr/local' \
    '--enable-dnsrbl' \
    '--with-libcurl=/root/usr/local/lib' \
    "$@"
    
    # Run the following commands:
    #   ./config
    #   make
    #   make install
    #
    # If ./config runs cleanly and subsequently you change the
    # options to the configure script, first run the command
    #   make clean
    # to start afresh.

    Insert other configuration options as necessary — run

    ./configure --help

    to see all configuration options.

  8. Make the above file executable:

    chmod 0755 config

  9. From the milter-greylist directory, edit the file Makefile.in to comment out the first line following the label install-conf:. That is, change

            {INSTALL} -d -m 755 ${DESTDIR}/etc/mail

    to

    ####### {INSTALL} -d -m 755 ${DESTDIR}/etc/mail

    This change is necessary as we (normal users) don't own that directory, and thus can't change its permissions.

  10. Run the commands mentioned at the end of the config file:

    ./config
    make
    make install

    If these commands run cleanly, you have successfully installed milter-greylist.

  11. Setup milter-greylist to run.

  12. To conserve space, you may wish to remove the milter-greylist directory and milter-greylist-4.1.1.tgz file.

  13. Setup milter-greylist configuration.

Run milter-greylist

  1. In the directory milter-greylist, copy the file rc-redhat.sh so we can edit it:

    cp rc-redhat.sh milter-greylist.sh

  2. Make the above file executable:

    chmod 0755 milter-greylist.sh

  3. Edit the file milter-greylist.sh to comment out references to $UID as this program runs as a normal user.

    That is, the lines starting with if [ $UID -ne 0 ]; then through the matching else should be commented out (precede with one or more pound signs) or deleted, along with the matching fi;. Leave the lines between the else and fi;. There is one occurrence in each of the start () and stop () sections.

    Also, edit the line which starts with daemon --user=$user to remove that leading text.

    For example, in the start () section, change

            if [ $UID -ne 0 ]; then
                    RETVAL=1
                    failure
            else
                    daemon --user=$user /root/usr/local/bin/milter-greylist $OPTIONS
                    RETVAL=$?
                    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/milter-greylist
                    [ $RETVAL -eq 0 ] && success || failure
            fi;

    to

    ####### if [ $UID -ne 0 ]; then
    #######         RETVAL=1
    #######         failure
    ####### else
    #######         daemon --user=$user /root/usr/local/bin/milter-greylist $OPTIONS
                                        /root/usr/local/bin/milter-greylist $OPTIONS
                    RETVAL=$?
                    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/milter-greylist
                    [ $RETVAL -eq 0 ] && success || failure
    ####### fi;

    and in the stop () section, change

            if [ $UID -ne 0 ]; then
                    RETVAL=1
                    failure
            else
                    killproc /root/usr/local/bin/milter-greylist
                    RETVAL=$?
                    [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/milter-greylist
                    [ $RETVAL -eq 0 ] && success || failure
            fi;

    to

    ####### if [ $UID -ne 0 ]; then
    #######         RETVAL=1
    #######         failure
    ####### else
                    killproc /root/usr/local/bin/milter-greylist
                    RETVAL=$?
                    [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/milter-greylist
    #######         [ $RETVAL -eq 0 ] && success || failure
    ####### fi;

    For more information on the command line options to milter-greylist, see this web page or run the command man milter-greylist (assuming you've installed man).

  4. Run the following commands:

    cp milter-greylist.sh /etc/init.d/.
    cd /etc/rc.d/rc2.d
    ln -s ../init.d/milter-greylist.sh S30milter-greylist
    ln -s ../init.d/milter-greylist.sh K30milter-greylist

  5. Backup /etc/mail/sendmail.mc by copying it to another named filed as in

    cp /etc/mail/sendmail.mc /etc/mail/sendmail.mc.before_greylisting

  6. Copy the file milter-greylist.m4 to a safe directory:

    cp /root/usr/local/milter-greylist/milter-greylist.m4 /root/usr/local/etc/.

  7. Edit /etc/mail/sendmail.mc by appending the following line to the bottom of the file:

    include(`/root/usr/local/etc/milter-greylist.m4')dnl
  8. Compile /etc/mail/sendmail.mc by entering the following line:

    m4 /etc/mail/sendmail.mc > /etc/sendmail.cf

  9. Start/restart milter-greylist and sendmail by entering the following line

    restart

Configure milter-greylist

  1. Configure milter-greylist by editing the configuration data file /etc/mail/greylist.conf. At first, start small by defining a few email addresses (one?) subject to greylisting. Do this by editing the lines which follow the line list "grey users" rcpt { \. The email addresses within the braces (and followed by a backslash) are the only ones subject to greylisting. Delete the sample email addresses.

    For example,

    list "grey users" rcpt {   \
        /.*@example\.com/      \
        someone@example.net    \
        postmaster@example.net \
        webmaster@example.net  \
    }

    Note that in the above example, all email addresses in the domain example.com are to be greylisted.

  2. If you wish to use the DNSRBL services, include the following lines in greylist.conf:

    dnsrbl "SBL" zen.spamhaus.org           127.0.0.2
    dnsrbl "XBL" zen.spamhaus.org           127.0.0.4/30
    dnsrbl "PBL" zen.spamhaus.org           127.0.0.10/31
    dnsrbl "TQM" dnsbl.tqmcube.com          127.0.0.2
    dnsrbl "MTAWL" list.dnswl.org           127.0.0.0/16

    and include the following lines:

    racl whitelist dnsrbl "MTAWL"
    racl blacklist dnsrbl "SBL" msg "Sender IP caught in SBL blacklist"
    racl blacklist dnsrbl "XBL" msg "Sender IP caught in XBL blacklist"
    racl blacklist dnsrbl "PBL" msg "Sender IP caught in PBL blacklist"
    racl blacklist dnsrbl "TQM" msg "Sender IP caught in TQM blacklist"
  3. The line which looks like

    racl greylist list "grey users" delay dd autowhite aa

    not only defines the list of users to be greylisted, but also defines two timer values. The first value dd indicates the delay introduced for each message the first time it is seen. The second value aa indicates the amount of time the IP address of a successfully greylisted message is whitelisted. That is, after a message timer has expired and the message is forwarded to the appropriate mailbox, the sender's IP address is automatically whitelisted for a given period of time. Thus, subsequent email from the same sender is not delayed during this period. After this period expires, the IP address is removed from the whitelist. Longer auto-whitelist periods use up more main memory as the database is kept in memory.

    For each time value, suffix the number with an s for seconds, m for minutes, h for hours, and d for days.

    FWIW, I use 10s (ten seconds) for the first value and 1d (one day) for the second value. Some people prefer a much longer value for the initial delay so as to allow one of the DNSRBL lists to catch a spammer who resends quickly.

  4. Review the comments in the greylist.conf file as well as the README file for more information on the keywords used in the configuration file, see this web page, or run the command man greylist.conf (assuming you've installed man).

  5. Whenever the configuration file is changed, it is re-read by milter-greylist before the next email is processed, so there is no need to restart the program.

  6. The header of each email you receive has an extra line which starts with

    X-Greylist:

    The text which follows indicates how the message was processed. For example,

  7. Note that some spam will still get through greylisting for various reasons:

Install cpio

From the GNU website, "GNU cpio copies files into or out of a cpio or tar archive. The archive can be another file on the disk, a magnetic tape, or a pipe." This tool is needed to unpack .rpm files.

  1. Check for the latest version of cpio software (2.9 as of this writing).

  2. Download the file into your favorite directory (e.g. /root/usr/local) and unpack it:

    wget ftp://ftp.gnu.org/gnu/cpio/cpio-2.9.tar.gz
    tar zxvf cpio-2.9.tar.gz

  3. [optional] Define a symbolic link to the directory created by tar so you don't have to type the cryptic name all the time — I'll use this symbolic link in the discussion below:

    ln -s  cpio-2.9  cpio

    which means define a symbolic link (ln -s) to cpio-2.9 (or whichever version you're installing) and call the link cpio (or whatever name you like to use — substitute your choice for cpio below).

  4. Change to the cpio directory:

    cd cpio

  5. In this directory, create a file (e.g. config) with the following content:

    #! /bin/sh
    
    CPPFLAGS='-I/root/usr/local/include -I/usr/local/include' \
    LDFLAGS='-L/root/usr/local/lib -L/usr/local/lib -L/usr/lib' \
    './configure' \
    '--prefix=/root/usr/local' \
    "$@"
    
    # Run the following commands:
    #   ./config
    #   make
    #   make check
    #   make install
    #
    # If ./config runs cleanly and subsequently you change the
    # options to the configure script, first run the command
    #   make clean
    # to start afresh.

    Insert other configuration options as necessary — run

    ./configure --help

    to see all configuration options.

  6. Make the above file executable:

    chmod 0755 config

  7. From the cpio directory, run the commands mentioned at the end of the config file:

    ./config
    make
    make check
    make install

    If these commands run cleanly, you have successfully installed cpio.

  8. To conserve space, you may wish to remove the cpio directory and cpio-2.9.tar.gz file.

Install rpm2cpio

From the rpm website, "As the name implies, rpm2cpio takes an RPM package file and converts it to a cpio archive." For the limited use we'll make of this utility, we use a version written in perl. This tool is needed for rpm.

  1. Check for the perl version of rpm2cpio.

  2. Download the file into a directory on the path for executables (e.g. /root/usr/local/bin) and save it as rpm2cpio.pl.

    wget http://www.iagora.com/~espel/rpm2cpio -O rpm2cpio.pl

  3. Make the above file executable:

    chmod 0755 rpm2cpio.pl

  4. You have successfully installed rpm2cpio.

Unpack .rpm Files

From the rpmfind website, "The RPM Package Manager (RPM) is a powerful command line driven package management system capable of installing, uninstalling, verifying, querying, and updating computer software packages."

  1. Install cpio

  2. Install rpm2cpio

  3. To unpack a .rpm file, run it through rpm2cpio.pl and cpio as follows:

    rpm2cpio.pl rpmfilename.rpm | cpio -d -i -u

    where rpmfilename is the name of the .rpm file — see Install man, apropos, & whatis below for a more specific example.

  4. After unpacking the .rpm file, the unpacked contents can be copied/moved to the appropriate directories.

  5. Care must be taken as to where you unpack the contents and to where you copy/move it. In general, .rpm files are meant to be installed as if you had root access. By that I mean, not just that you can execute the unpacking from the root directory (/), but that you have permission to write (and sometimes overwrite) into all its subdirectories. In general, that's not the case for WestHost systems. Moreover, the contents of .rpm files may be directory-specific, meaning not only do they install into specific directories, but that configuration files expect to find their executables in specific directories and vice versa, so care must be taken to match the two.

    In other words, even if you had a working version of rpm to both unpack and install .rpm files, it might not be of much use.

Install groff

From the GNU website, "Based on a device-independent version of 'troff,' 'groff' (GNU Troff) is a document processor which reads plain text and formatting commands, produces formatted output from them, and then outputs it to another device." This tool is needed for man.

  1. Check for the latest version of groff software (1.19.2 as of this writing).

  2. Download the file into your favorite directory (e.g. /root/usr/local) and unpack it:

    wget ftp://ftp.gnu.org/gnu/groff/groff-1.19.2.tar.gz
    tar zxvf groff-1.19.2.tar.gz

  3. [optional] Define a symbolic link to the directory created by tar so you don't have to type the cryptic name all the time — I'll use this symbolic link in the discussion below:

    ln -s  groff-1.19.2  groff

    which means define a symbolic link (ln -s) to groff-1.19.2 (or whichever version you're installing) and call the link groff (or whatever name you like to use — substitute your choice for groff below).

  4. Change to the groff directory:

    cd groff

  5. In this directory, create a file (e.g. config) with the following content:

    #! /bin/sh
    
    CPPFLAGS='-I/root/usr/local/include -I/usr/local/include' \
    LDFLAGS='-L/root/usr/local/lib -L/usr/local/lib -L/usr/lib' \
    './configure' \
    '--prefix=/root/usr/local' \
    "$@"
    
    # Run the following commands:
    #   ./config
    #   make
    #   make check
    #   make install
    #
    # If ./config runs cleanly and subsequently you change the
    # options to the configure script, first run the command
    #   make clean
    # to start afresh.

    Insert other configuration options as necessary — run

    ./configure --help

    to see all configuration options.

  6. Make the above file executable:

    chmod 0755 config

  7. From the groff directory, run the commands mentioned at the end of the config file:

    ./config
    make
    make check
    make install

    If these commands run cleanly, you have successfully installed groff.

  8. To conserve space, you may wish to remove the groff directory and groff-1.19.2.tar.gz file.

Install man, apropos, & whatis

From the rpmfind website, "The man package includes three tools for finding information and/or documentation about your Linux system: man, apropos, and whatis. The man system formats and displays on-line manual pages about commands or functions on your system. Apropos searches the whatis database (containing short descriptions of system commands) for a string. Whatis searches its own database for a complete word."

  1. Install cpio.

  2. Install rpm2cpio.

  3. Install groff.

  4. Check for the most recent WestHost-compatible version of man (1.5o1-11 as of this writing) as a .rpm file.

  5. Download the file to your favorite directory (e.g. /root/usr/local):

    wget http://updates.redhat.com/enterprise/4Desktop/en/os/SRPMS/man-1.5o1-11.el4.src.rpm

  6. Run the following commands:

    mkdir /root/usr/local/manlcl
    cd /root/usr/local/manlcl
    rpm2cpio.pl ../man-1.5o1-11.el4.src.rpm | cpio -d -i -u
    tar xvf man-1.5o1.tar

  7. [optional] Define a symbolic link to the directory created by tar so you don't have to type the cryptic name all the time — I'll use this symbolic link in the discussion below:

    ln -s  man-1.5o1  manlcl2

    which means define a symbolic link (ln -s) to man-1.5o1 (or whichever version you're installing) and call the link manlcl2 (or whatever name you like to use — substitute your choice for manlcl2 below).

  8. Change to the manlcl2 directory:

    cd manlcl2

  9. In this directory, create a file (e.g. config) with the following content:

    #! /bin/sh
    
    CPPFLAGS='-I/root/usr/local/include -I/usr/local/include' \
    LDFLAGS='-L/root/usr/local/lib -L/usr/local/lib -L/usr/lib' \
    './configure' \
    '--prefix=/root/usr/local' \
    '-d' \
    '-confdir /etc' \
    "$@"
    
    # Run the following commands:
    #   ./config
    #   make
    #   make install
    #
    # If ./config runs cleanly and subsequently you change the
    # options to the configure script, first run the command
    #   make clean
    # to start afresh.

    Insert other configuration options as necessary — run

    ./configure --help

    to see all configuration options.

  10. Make the above file executable:

    chmod 0755 config

  11. From the manlcl2 directory, run the commands mentioned at the end of the config file:

    ./config
    make
    make install

    If all of the above commands run cleanly, you have successfully installed man, apropos, and whatis.

  12. To conserve space, you may wish to remove the manlcl directory and man-1.5o1-11.el4.src.rpm file.

  13. Setup man, apropos, & whatis configuration.

Configure man, apropos, & whatis

  1. Edit the file /etc/man.conf to make the following changes:

    In the place where the various MANPATHs are defined, insert the following two lines before all the other MANPATHs:

    MANPATH /root/usr/local/man
    MANPATH /root/usr/local/share/man

    You may wish to add other directories as needed if they didn't copy their man pages to one of the directories listed after a MANPATH.

  2. In the file /.bashrc change the line export PAGER="less" to export PAGER="less -r", and then logout/login again or run source /.bashrc .

  3. Run the command makewhatis -w to build the database for apropos and whatis.

    Note: you need to re-run this command whenever you add new man pages to your system.

  4. If, when you run man on a command for which there is no entry in the database, and the response is Failed to open the message catalog man on the path NLSPATH=<none>, then insert the line export LANG=en-US into your /.bashrc file, and then logout/login again or run source /.bashrc .

Install man-pages

In order to have man pages for the common system commands, you need to install them.

  1. Check for the most recent WestHost-compatible version of man-pages (1.67-15 as of this writing) as a .rpm file.

  2. Download the file to your favorite directory (e.g. /root/usr/local):

    wget http://updates.redhat.com/enterprise/4Desktop/en/os/SRPMS/man-pages-1.67-15.el4.src.rpm

  3. Run the following commands:

    mkdir /root/usr/local/man-pages
    cd /root/usr/local/man-pages
    rpm2cpio.pl ../man-pages-1.67-15.el4.src.rpm | cpio -d -i -u
    tar zxvf man-pages-1.67.tar.gz

  4. [optional] Define a symbolic link to the directory created by tar so you don't have to type the cryptic name all the time — I'll use this symbolic link in the discussion below:

    ln -s  man-pages-1.67  man-pages2

    which means define a symbolic link (ln -s) to man-pages-1.67 (or whichever version you're installing) and call the link man-pages2 (or whatever name you like to use — substitute your choice for man-pages2 below).

  5. Change to the man-pages2 directory:

    cd man-pages2

  6. In this directory, edit the file Makefile as follows:

    Change the line

    MANDIR=$(prefix)/usr/share/man

    to

    MANDIR=/root/usr/local/share/man

  7. From the man-pages2 directory, run the following command:

    make -s install
    makewhatis -w

    If the above commands run cleanly, you have successfully installed man-pages.

    Note: the above downloaded file doesn't contain man pages for all the commands (e.g. it's missing less) — if you find a better source, .

  8. To conserve space, you may wish to remove the man-pages directory and man-pages-1.67-15.el4.src.rpm file.

Author

This page was written by Bob Smith. Please all comments and corrections to me.

Acknowledgments


Valid XHTML 1.0! Valid CSS!
GetNARS2000!
NARS2000
© 2006-2020
Get GPL v3!   Get Firefox!   Get Thunderbird!   Get LibreOffice!   I Support Science!
Comments or suggestions? Send them to .