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, .
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
Within WestHost Site manager
Install the GNU Compiler Collection.
Install the latest versions of PHP, MySQL, and phpMyAdmin
(for mod_auth_mysql
and other software).
Install Python (for SWIG
/Subversion
).
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.
Create /root
along with new directories under it:
mkdir -p /root/usr/local
cd /root/usr/local
mkdir bin sbin include lib man
Define and export these environment variables:
Using your favorite editor (you're on your own here, but I use
pico
), insert the
following line into the file /.bashrc
:
export PATH="/root/usr/local/bin:/root/usr/local/sbin:$PATH"
The above line enables the
system to find the executable programs to be created in
/root/usr/local/bin
or /root/usr/local/sbin
. Placing
the path to the new directories first allows the new programs to
override any old ones in the path.
Tell the system about the new environment variable:
source /.bashrc
The above command reruns your .bashrc
script
which has the side effect of creating duplicate entries in the
PATH
environment variable. This can be cleared up
either by exiting the telnet session (logout , login), or by
placing the following statement at the top of your
.bashrc
file:
export PATH="/bin:/usr/local/bin:/usr/bin:."
In the file /etc/ld.so.conf
, append the following
line to the bottom:
/ftp/usr/lib
and the following two lines to the top:
/root/usr/local/lib
/usr/local/lib
and run the command ldconfig
. When running this command,
you might encounter a message similar to
ldconfig: Can't link /usr/lib/libstdc++-libc6.1-1.so.2 to libstdc++-2-libc6.1-1-2.9.0.so
which you can safely ignore.
Berkeley DB
is a database program used by OpenLDAP
— you might also need it in other contexts.
Check for the latest version of Berkeley DB
software (5.3.21
as of this writing).
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
[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).
Change to the bdb/build_unix
directory:
cd bdb/build_unix
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.
Make the above file executable:
chmod 0755 config
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
.
To conserve space, you may wish to remove the bdb
directory and
db-5.3.21.tar.gz
file.
OpenLDAP
(Lightweight Directory Access Protocol) is a server which I use for my
Mozilla Thunderbird address book.
Install Berkeley DB.
Install groff.
Check for the latest version of OpenLDAP
software (2.4.16
as of this writing).
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
[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).
Change to the openldap
directory:
cd openldap
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.
Make the above file executable:
chmod 0755 config
From the openldap
directory, run the
commands mentioned at the end of the config
file:
./config
(this one takes quite a while — go do
something else and come back later)
make depend
make
make test
make install
If these commands run cleanly, you have successfully installed OpenLDAP
.
To conserve space, you may wish to remove the openldap
directory and
openldap-2.4.16.tgz
file.
Setup OpenLDAP
to
run.
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,
The schema are in the /root/usr/local/etc/openldap/schema
directory,
The pidfile
and argsfile
are in the /root/usr/local/var/run
directory, and
The bdb
directory is
/root/usr/local/var/openldap-data
.
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.
Make the above file executable:
chmod 0755 slart
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`
Make the above file executable:
chmod 0755 slop
Run the shell script slart
to start your LDAP server,
and run the shell script slop
to stop it.
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).
To view your LDAP server's contents, there are various free programs available — one I particularly like is Softerra's LDAP Browser.
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:
Define MySQL tables to contain the authentication data which controls access to web pages (and can be extended for additional authentication).
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
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.
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://
).
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 |
Check for the latest version of
mod_auth_mysql
software (3.0.0
as of this writing).
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
[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).
Change to the mam
directory.
cd mam
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.
Make the above file executable:
chmod 0755 config
From the mam
directory, run the
commands mentioned at the end of the config
file:
./config
apxs -i mod_auth_mysql.so
In your httpd.conf
file, uncomment the following
lines:
LoadModule mysql_auth_module modules/mod_auth_mysql.so
AddModule mod_auth_mysql.c
Type restart
at the command line.
If the above commands run cleanly and Apache restarts cleanly, you have
successfully installed mod_auth_mysql
.
To conserve space, you may wish to remove the mam
directory and
mod_auth_mysql-3.0.0.tar.gz
file.
Setup mod_auth_mysql
to
run.
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.
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.
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.
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.
Don't forget to restart
after each time you change a
.conf
file.
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."
Check for the latest version of Aspell
software (0.60.6
as of this writing).
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
[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).
Change to the aspell
directory:
cd aspell
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.
Make the above file executable:
chmod 0755 config
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
.
Lastly, you must install a dictionary, so download one (say the English dictionary).
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
[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).
Change to the aspell-en
directory:
cd aspell-en
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.
Make the above file executable:
chmod 0755 config
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
.
To conserve space, you may wish to remove the aspell
directory and
aspell-0.60.6.tar.gz
file.
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:
Check for the latest version of Libtool
software (2.4.2
as of this writing).
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
[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).
Change to the libtool
directory:
cd libtool
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.
Make the above file executable:
chmod 0755 config
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
.
To conserve space, you may wish to remove the libtool
directory and
libtool-2.4.2.tar.gz
file.
M4
is an implementation of the traditional UNIX macro processor.
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:
Check for the latest version of M4
software (1.4.16
as of this writing).
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
[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).
Change to the m4
directory:
cd m4
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.
Make the above file executable:
chmod 0755 config
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
.
To conserve space, you may wish to remove the m4
directory and
m4-1.4.16.tar.gz
file.
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:
Install M4.
Check for the latest version of Autoconf
software (2.68
as of this writing).
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
[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).
Change to the autoconf
directory:
cd autoconf
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.
Make the above file executable:
chmod 0755 conf
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
.
To conserve space, you may wish to remove the autoconf
directory and
autoconf-2.68.tar.gz
file.
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.
Install Python from the WestHost Site manager.
Check for the latest version of SWIG
software (2.0.8
as of this writing).
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
[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).
Change to the swig
directory:
cd swig
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.
Make the above file executable:
chmod 0755 config
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
.
To conserve space, you may wish to remove the swig
directory and
swig-2.0.8.tar.gz
file.
Highlight
is a syntax coloring program (along with other features) to
improve the display of many programming languages. It is used in ViewVC
.
Check for the latest version of Highlight
software (3.12
as of this writing).
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
[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).
Change to the highlight
directory:
cd highlight
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\"
.
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.
Make the above two files executable:
chmod 0755 mk
chmod 0755 mkinstall
Run the following commands:
mk
mkinstall
If these commands run cleanly, you have successfully
installed highlight
.
If you change any of the above options to mk
,
run make clean
.
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
.
To conserve space, you may wish to remove the highlight
directory and
highlight-3.12.tar.gz
file.
ViewVC
is a browser interface for CVS and Subversion version control repositories.
Install SWIG.
Install Highlight.
Check for the latest version of ViewVC
software (1.1.17
as of this writing).
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
[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).
Change to the viewvc-tmp
directory:
cd viewvc-tmp
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) []:
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
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
.
To change the colors displayed by ViewVC
, edit the file
/root/usr/local/viewvc/templates/docroot/styles.css
.
To conserve space, you may wish to remove the viewvc-tmp
directory and
viewvc-1.1.17.tar.gz
file.
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.
Install Libtool.
Install Autoconf.
Install ViewVC.
Install Berkeley DB.
Check for the latest version of Subversion
software (1.7.7
as of this writing).
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
[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).
Change to the subversion
directory:
cd subversion
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.
Make the above file executable:
chmod 0755 config
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
.
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
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.
Setup Subversion
to
run.
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
.
Create the master source repository, as in
svnadmin create /root/usr/local/repos
(there is no output from this command)
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
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.
Start the Subversion server with the command
/etc/rc.d/init.d/svnd start
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
.
Check for the latest version of
CURL
software (7.18.0
as of this writing).
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
[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).
Change to the curl
directory:
cd curl
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.
Make the above file executable:
chmod 0755 config
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
.
To conserve space, you may wish to remove the curl
directory and
curl-7.18.0.tar.gz
file.
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.
Install CURL only if you use the
urlcheck
keyword in greylist.conf
(probably not at first as it's a rather advanced option).
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.
Check for the latest version of
milter-greylist
software (4.1.1
as of this writing).
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
[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).
Change to the milter-greylist
directory:
cd milter-greylist
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.
Make the above file executable:
chmod 0755 config
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.
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
.
Setup milter-greylist
to
run.
To conserve space, you may wish to remove the milter-greylist
directory and
milter-greylist-4.1.1.tgz
file.
Setup milter-greylist
configuration.
In the directory milter-greylist
,
copy the file rc-redhat.sh
so we can edit it:
cp rc-redhat.sh milter-greylist.sh
Make the above file executable:
chmod 0755 milter-greylist.sh
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).
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
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
Copy the file milter-greylist.m4
to a safe directory:
cp /root/usr/local/milter-greylist/milter-greylist.m4 /root/usr/local/etc/.
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
Compile /etc/mail/sendmail.mc
by entering the following line:
m4 /etc/mail/sendmail.mc > /etc/sendmail.cf
Start/restart milter-greylist
and sendmail
by entering
the following line
restart
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.
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"
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.
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).
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.
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,
Delayed for hh:mm:ss ...
: The first time this message was seen,
it was delayed. On some subsequent receipt of the same message, the timer expired and
the message was forwarded to the appropriate mailbox. The time hh:mm:ss
indicates the hours, minutes, and seconds of the actual delay from the first time the
messge was seen to the first time it was seen after the timer expired. This time is
always greater than the delay introduced by milter-greylist
; any time beyond
that delay is due to how often the sending server resends the message.
Sender IP whitelisted, not delayed ...
: The IP of the sender
is whitelisted, so the message was forwarded to the appropriate mailbox.
Sender IP whitelisted by DNSRBL, not delayed ...
: The IP of the sender
is whitelisted in one of the RBL lists, so the message was forwarded to the appropriate
mailbox.
Sender DNS whitelisted, not delayed ...
: The DNS of the sender
is whitelisted, so the message was forwarded to the appropriate mailbox.
Sender succeeded SMTP AUTH, not delayed ...
: The sender used SMTP AUTH
to authenticate itself, so the message was forwarded to the appropriate mailbox.
Default is to whitelist mail, not delayed ...
: The recipient of this
message is not in the list of users to be greylisted and the default action is to whitelist
such email, so the message was forwarded to the appropriate mailbox. This action is taken
when there is a trailing entry in greylist.conf
which reads
racl whitelist default
.
IP, sender and recipient auto-whitelisted, not delayed ...
: A previous
message from the same sender was accepted after a timer expiration and retransmission, so
the sender was automatically whitelisted for a given period. This message was received
within that period, so it was forwarded to the appropriate mailbox.
Note that some spam will still get through greylisting for various reasons:
Sender is a spammer with its own SMTP server (i.e., not a zombie) and resends its spam as per the specification.
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.
Check for the latest version of
cpio
software (2.9
as of this writing).
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
[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).
Change to the cpio
directory:
cd cpio
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.
Make the above file executable:
chmod 0755 config
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
.
To conserve space, you may wish to remove the cpio
directory and
cpio-2.9.tar.gz
file.
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.
Check for the perl version of rpm2cpio.
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
Make the above file executable:
chmod 0755 rpm2cpio.pl
You have successfully installed rpm2cpio
.
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."
Install cpio
Install rpm2cpio
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.
After unpacking the .rpm
file, the unpacked contents can
be copied/moved to the appropriate directories.
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.
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.
Check for the latest version of
groff
software (1.19.2
as of this writing).
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
[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).
Change to the groff
directory:
cd groff
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.
Make the above file executable:
chmod 0755 config
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
.
To conserve space, you may wish to remove the groff
directory and
groff-1.19.2.tar.gz
file.
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."
Install cpio.
Install rpm2cpio.
Install groff.
Check for the most recent WestHost-compatible version of
man
(1.5o1-11
as of this writing) as a .rpm
file.
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
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
[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).
Change to the manlcl2
directory:
cd manlcl2
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.
Make the above file executable:
chmod 0755 config
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
.
To conserve space, you may wish to remove the manlcl
directory and
man-1.5o1-11.el4.src.rpm
file.
Setup man, apropos, & whatis
configuration.
Edit the file /etc/man.conf
to make the following changes:
In the place where the various MANPATH
s
are defined, insert the following two lines before all the other
MANPATH
s:
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
.
In the file /.bashrc
change the line export PAGER="less"
to export PAGER="less -r"
, and then logout/login
again or run source /.bashrc
.
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.
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
.
In order to have man
pages for the common system
commands, you need to install them.
Check for the most recent WestHost-compatible version of
man-pages
(1.67-15
as of this writing) as a .rpm
file.
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
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
[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).
Change to the man-pages2
directory:
cd man-pages2
In this directory, edit the file Makefile
as follows:
Change the line
MANDIR=$(prefix)/usr/share/man
to
MANDIR=/root/usr/local/share/man
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,
.
To conserve space, you may wish to remove the man-pages
directory and
man-pages-1.67-15.el4.src.rpm
file.
This page was written by Bob Smith. Please all comments and corrections to me.
/root
to
"keep a perfectly clean division between my stuff and the VDS's stuff".
NARS2000 © 2006-2020 |
|
Comments or suggestions? Send them to . |