How to Install and Configure the Apache Server

All Releases

Last update: September 7, 2000

CONTENTS

1.Introduction

1.1Adding an Apache server to ALEPH:

2.Installing the Apache Server

2.1Installation

2.2Before Compiling Apache

2.3Compiling Apache

3.Configuring the Apache Server

3.1Configuring Apache

3.1.1General for all ALEPH versions:

3.1.2Configuring Apache for ALEPH versions prior to 12.1

3.1.3Configuring Apache for ALEPH version 12.1

3.1.4Configuring Apache for ALEPH versions 12.2 to 12.4

3.1.5Configuring Apache for ALEPH versions 14.1 and higher

3.2MakingLinks to Other Filesystems

3.3Running Apache Daemon

3.3.1Aleph versions lower than 14.1

3.3.2Aleph versions 14.1 and higher

4.Configuring ALEPH to Work with Apache

4.1For ALEPH versions 12.1 and above:

5.Running Apache on Startup

5.1On ALPHA

5.1.1ALEPH versions lower than 14.1:

5.1.2ALEPH versions 14.1 and upper:

5.2On Solaris

5.2.1ALEPH versions lower than 14.1:

5.2.2ALEPH versions 14.1 and upper:

5.3On AIX

5.3.1ALEPH versions lower than 14.1:

5.3.2ALEPH versions 14.1 and upper:

5.4On HP

5.4.1ALEPH versions lower than 14.1:

5.4.2ALEPH versions 14.1 and upper:

5.5On Linux

5.5.1ALEPH versions lower than 14.1:

5.5.2ALEPH versions 14.1 and upper:

6.Using Apache with multiple versions of ALEPH

1.Introduction

The Apache server is a popular standard server that is very well suited to ALEPH installations. The Apache server can rival (and probably surpass) almost any other UNIX-based HTTP servers in terms of functionality, efficiency and speed. Large and heavily trafficked ALEPH installations can improve their performance by adding an Apache server to their installation.

1.1Adding an Apache server to ALEPH:

Facilitates transfer of icons. (All ALEPH versions)

Provides reliable transfer of external files (linked to ALEPH) that are not defined as plain text. (All ALEPH versions)

Lets ALEPH work with CGI. (ALEPH version 12.2 or higher)

This document explains how to install and configure an Apache server to work with ALEPH.

For more information about the Apache server read the documentation at . Please review the Apache license at .

2.Installing the Apache Server

The steps described in the Installation section are necessary to install the Apache from scratch. If the Apache is already installed, and is running on your ALEPH installation, skip to Configuring the Apache server (3.0).

Italicized lines specify the steps you require to install fastcgi. These steps are not necessary if you do not intend to run fastcgi on your server. ALEPH fastcgi scripts are available from ALEPH version 12.3.

Note that the cgi (and fastcgi) versions of the ALEPH front make use of non-standard

modules of Apache, meaning they are not included in the precompiled version, so you should recompile Apache and include the non-standard modules.

Special care should be taken if you install a Linux system. The default installation of Linux includes a precompiled version of Apache that is not suitable for running ALEPH cgi or fastcgi. In a Linux system, Apache should be installed after the system package was installed.

2.1Installation

Define <apache_installation_root>, the root directory for the Apache installation. This is the directory where the Apache server will be installed

(e.g.: $aleph_product).

Ftp the file apache_1_3_6_tar.tar to <apache_installation_root>

Note: The latest version of Apache is 1.3.12 (February 2000). Use any version from 1.3.6 and higher. You can contact your ALEPH distributor or download:

Apache sources from:

The fastcgi module for Apache from:

The fastcgi-development-kit from:

Ftp the file mod_fastcgi_2.2.2.tar to <apache_installation_root

cd <apache_installation_root>

tar -xvf ./src/apache_1_3_6_tar.tar

From now on, <apache_install_dir> is used to specify the directory where Apache files are.

cd <apache_install_dir>

cd src/modules

tar -xvf <apache_install_dir>/src/mod_fastcgi_2.2.2.tar

mv mod_fastcgi_2.2.2 fastcgi

cd <apache_install_dir>

./configure --prefix=<apache_install_dir> \

--activate-module=src/modules/fastcgi/libfastcgi.a \

--enable-module=headers --enable-module=expires

2.2Before Compiling Apache

The following bugs are present on some operating systems:

On a System V Release 4, check where the CC compiler is (i.e. search for a directory different from‘/usr/ucb’). Make sure that `/usr/bin' and the CC-directory precede `/usr/ucb' in `PATH'. The `cc' command in `/usr/ucb' uses libraries which have bugs.

On AIX , there is a bug in the C compiler. The Apache server will compile but not run. IBM has released a ptf fixing it:

For the 3.6.4 xlc compiler, the ptfs are U462005, U462006, U462007, and U462023 through U462030

For the 4.4 C compiler, the APAR number is IX87837, and you can go to:

Use the AIX Fix Distribution Service located on the above web-site, and search on the APAR number as stated above.

2.3Compiling Apache

cd <apache_install_dir>

make

make install

3.Configuring the Apache Server

3.1Configuring Apache

3.1.1General for all ALEPH versions:

The configuration parameters for Apache are set in a file called httpd.conf. This file is generally located under <apache_install_dir>/conf. The file placement is different for ALEPH versions 14.1 and up (see 3.1.5 Configuring Apache for ALEPH versions 14.1 and up).

The following steps are common for all ALEPH versions:

Edit the file: <apache_install_dir>/conf/httpd.conf

Change the appropriate lines to contain the following values:

Port 80

user aleph (or the id of the user that runs ALEPH)

group aleph (or the group of the user that runs ALEPH)

ServerAdmin user@host, (the email address of the user that will get messages from Apache.)

ServerRoot <apache_install_dir>

If you want to prevent caching (i.e. set expire to 0) add the line:

Header append expire 0

Please refer to specific sections to see what other changes are needed for each ALEPH version

3.1.2Configuring Apache for ALEPH versions prior to 12.1

Start with General Section (3.1.1).

In ALEPH versions prior to 12.1, the Apache server can contribute to ALEPH only in icons and picture management, making page load more efficient. The only lines relevant in httpd.conf are those stated above for all the ALEPH versions.

If you want to transfer icons through the Apache server, you must define the proper links to the icons’ directories, as indicated in sections 3.2 and 4

3.1.3Configuring Apache for ALEPH version 12.1

Start with General Section (3.1.1).

In ALEPH versions 12.1 and above, the Apache server (or another httpd server implementing http/1.1) MUST be used in order to read the Online Documentation.

Please refer to sections 3.2 and 4 below to see how to make the proper definitions for the documentation.

3.1.4Configuring Apache for ALEPH versions 12.2 to 12.4

Start with General Section (3.1.1).

In ALEPH versions 12.1 and above, the Apache server (or another httpd server implementing http/1.1) MUST be used in order to read the Online Documentation.

Please refer to sections 3.2 and 4 below to see how to make the proper definitions for the documentation.

In addition, for versions 12.2 and above, access to ALEPH can be done through www_front_cgi using the Apache server.

In order to do so, other lines have to be added to the httpd.conf file (in addition to those described in section 3.1.1).

Edit the file: <apache_install_dir>/conf/httpd.conf

(Replace <$aleph_version> with your current ALEPH version (e.g. 505), <aleph_root> with the path to ALEPH root (e.g. /aleph/a50_5) and <user_for_$aleph_version> with the user you use to run ALEPH (e.g. m505))

Add the following lines under section 2 (“Main server configuration”)

SetEnv ALEPH_VERSION <$aleph_version>

SetEnv USER <user_for_$aleph_version>

SetEnv alephe_tab <aleph_root>/alephe/tab

SetEnv aleph_proc <aleph_root>/aleph/proc)

SetEnv LOGNAME <user_for_$aleph_version>

ScriptAlias /aleph-bin/ "<aleph_root>/aleph/exe/"

For cgi front:

(each ScriptAlias definition should come in only one line)

ScriptAlias "/ALEPH" "<aleph_root>/aleph/exe/www_front_cgi/ALEPH"

ScriptAlias "/S" "<aleph_root>/aleph/exe/www_front_cgi/S"

ScriptAlias "/B" "<aleph_root>/aleph/exe/www_front_cgi/B"

ScriptAlias "/N" "<aleph_root>/aleph/exe/www_front_cgi/N"

ScriptAlias "/D" "<aleph_root>/aleph/exe/www_front_cgi/D"

ScriptAlias "/U" "<aleph_root>/aleph/exe/www_front_cgi/U"

ScriptAlias "/G" "<aleph_root>/aleph/exe/www_front_cgi/G"

For the Course Reading application, (version 12.4 and upper): also include the following:

ScriptAlias "/R" "<aleph_root>/aleph/exe/www_front_cgi/R"

For fastcgi front (version 12.3 and higher):

ScriptAlias "/ALEPH" "<aleph_root>/aleph/exe/www_front_cgi_fast.fcgi/ALEPH"

ScriptAlias "/S" “<aleph_root>/aleph/exe/www_front_cgi_fast.fcgi/S"

ScriptAlias "/B" "<aleph_root>/aleph/exe/www_front_cgi_fast.fcgi/B"

ScriptAlias "/N" "<aleph_root>/aleph/exe/www_front_cgi_fast.fcgi/N"

ScriptAlias "/D" "<aleph_root>/aleph/exe/www_front_cgi_fast.fcgi/D"

ScriptAlias "/U" "<aleph_root>/aleph/exe/www_front_cgi_fast.fcgi/U"

ScriptAlias "/G" "<aleph_root>/aleph/exe/www_front_cgi_fast.fcgi/G"

For the Course Reading application, (version 12.4 and higher) also include the following:

ScriptAlias "/R"

"<aleph_root>/aleph/exe/www_front_cgi_fast.fcgi/R"

Add the following lines:

(Find a paragraph that starts with

<Directory "/apache_install_dir/cgi-bin">

and ends with </Directory>.

(after <Directory "/apache_install_dir/cgi-bin">

... </Directory> lines)

For cgi front:

<Directory "<aleph_root>/aleph/exe/">

AllowOverride None

Options ExecCGI

Order allow,deny

Allow from all

</Directory>

For fastcgi front (version 12.3 and higher):

<Directory "<aleph_root>/aleph/exe/">

AllowOverride None

Options ExecCGI

Order allow,deny

Allow from all

AddHandler fastcgi-script .fcgi

</Directory>

3.1.5Configuring Apache for ALEPH versions 14.1 and higher

In versions 14.1 and up, under the version directory, there is a subdirectory called apache, which includes all directories and files necessary for Apache configuration.

(i.e. /aleph/a50_5/apache).

To run a dedicated instance of Apache for ALEPH, make all configurations under this directory.

To use a running Apache instance and communicate with ALEPH, make the configuration in the httpd.conf file currently in use for Apache.

All the configuration steps indicated for lower versions of ALEPH should be carried out. Edit the file <root for Aleph>/apache/conf/httpd.conf (root for Aleph is the directory for Aleph, e.g. /aleph/a50_5)

Change the “Servername” value to your server name or IP address

If ALEPH is installed under a directory different from /aleph/a505, change all paths pointing to /aleph/a505 to <root for Aleph>. This is valid for the PidFile, htdocs directory and ScriptAlias.

Change the appropriate lines to contain the following values:

Port 80

user aleph (or the id of the user that runs ALEPH)

group aleph (or the group of the user that runs ALEPH)

ServerAdmin user@host, (the email address of the user that will get messages from Apache.)

ServerRoot <apache_install_dir>

Header append expire 0

(Replace <$aleph_version> with your current ALEPH version (e.g. 505), <aleph_root> with the path to ALEPH root (e.g. /aleph/a50_5) and <user_for_$aleph_version> with the user you use to run ALEPH

Correct the paths for alephe_tab and aleph_proc:

Add the following lines under section 2 (“Main server configuration”)

SetEnv alephe_tab <aleph_root>/alephe/tab

SetEnv aleph_proc <aleph_root>/aleph/proc)

Correct the values for ALEPH_VERSION, LOGNAME and USER:

SetEnv ALEPH_VERSION <$aleph_version>

SetEnv USER <user_for_$aleph_version>

SetEnv LOGNAME <user_for_$aleph_version>

Setup alias to use cgi (or fastcgi) front:

ScriptAlias /aleph-bin/ "<aleph_root>/aleph/exe/"

ScriptAlias /aleph-cgi/ "<aleph_root>/aleph/cgi/"

For cgi front:

(each ScriptAlias definition should come in only one line)

ScriptAlias "/ALEPH" "<aleph_root>/aleph/exe/www_front_cgi/ALEPH"

ScriptAlias "/S" "<aleph_root>/aleph/exe/www_front_cgi/S"

ScriptAlias "/B" "<aleph_root>/aleph/exe/www_front_cgi/B"

ScriptAlias "/N" "<aleph_root>/aleph/exe/www_front_cgi/N"

ScriptAlias "/D" "<aleph_root>/aleph/exe/www_front_cgi/D"

ScriptAlias "/U" "<aleph_root>/aleph/exe/www_front_cgi/U"

ScriptAlias "/G" "<aleph_root>/aleph/exe/www_front_cgi/G"

For the Course Reading application, (version 12.4 and upper): also include

ScriptAlias "/R" "<aleph_root>/aleph/exe/www_front_cgi/R"

For fastcgi front (version 12.3 and higher):

ScriptAlias "/ALEPH" "<aleph_root>/aleph/exe/www_front_cgi_fast.fcgi/ALEPH"

ScriptAlias "/S" "<aleph_root>/aleph/exe/www_front_cgi_fast.fcgi/S"

ScriptAlias "/B" "<aleph_root>/aleph/exe/www_front_cgi_fast.fcgi/B"

ScriptAlias "/N" "<aleph_root>/aleph/exe/www_front_cgi_fast.fcgi /N"

ScriptAlias "/D" "<aleph_root>/aleph/exe/www_front_cgi_fast.fcgi /D"

ScriptAlias "/U" "<aleph_root>/aleph/exe/www_front_cgi_fast.fcgi /U"

ScriptAlias "/G" "<aleph_root>/aleph/exe/www_front_cgi_fast.fcgi /G"

For the Course Reading application, (version 12.4 and higher) also include the following:

ScriptAlias "/R"

"<aleph_root>/aleph/exe/www_front_cgi_fast.fcgi/R"

Add the following lines:

(Find a paragraph that starts with

<Directory "/apache_install_dir/cgi-bin">

and ends with </Directory>.

(after <Directory "/apache_install_dir/cgi-bin">

... </Directory> lines)

For cgi front:

<Directory <aleph_root>/aleph/exe/">

AllowOverride None

Options ExecCGI

Order allow,deny

Allow from all

</Directory>

<Directory <aleph_root>/aleph/cgi/">

AllowOverride None

Options ExecCGI

Order allow,deny

Allow from all

</Directory>

For fastcgi front (version 12.3 and higher):

<Directory "<aleph_root>/aleph/exe/">

AllowOverride None

Options ExecCGI

Order allow,deny

Allow from all

AddHandler fastcgi-script .fcgi

</Directory>

If you are going to run Metalib and/or One2More, also include the following:

For cgi front:

ScriptAlias "/V" “<aleph_root>/aleph/exe/www_front_cgi/V"

ScriptAlias “/O” "<aleph_root>/aleph/exe/www_front_cgi/O"

For fastcgi front:

ScriptAlias "/V" I "<aleph_root>/aleph/exe/www_front_cgi_fast.fcgi/V"

ScriptAlias "/O"

"<aleph_root>/aleph/exe/www_front_cgi_fast.cgi/O"

3.2Making Links to Other Filesystems

  1. Go to: <apache_install_dir>/htdocs
  1. Link to the icon’s path so that the Apache server can find the icons.

Create links to ALEPH's www_<lng>/icon directories. The number of links you create depends on the number of languages you want to use (the following example shows English and German):

mkdir www_eng

cd www_eng

ln -s $alephe_root/www_eng/icon icon

cd ..

mkdir www_ger

cd www_ger

ln -s $alephe_root/www_ger/icon icon

Note: If you want to manage multiple versions of Aleph, see section 6

mkdir www_eng

cd www_eng

ln -s $alephe_root/www_eng/icon icon

cd ..

mkdir www_ger

cd www_ger

ln -s $alephe_root/www_ger/icon icon

  1. Define access to the documentation files:

ln –s $alephe_root/documentation documentation_<aleph_version>

(change <aleph_version> with your actual version number – 3 digits – e.g. 505)

cd <apache_install_dir>/htdocs

ln –s $alephe_root/documentation documentation_<aleph_version>

  1. Define access to the multimedia files:

From ALEPH version 14.2 onwards, you can view multimedia files from within ALEPH. The multimedia files are loaded to the browser through the Apache server.

To define access to the multimedia files:

check how $TMPMEDIA is defined (echo $TMPMEDIA). You will get a complete path (e.g. /aleph/a50_5/tmpmedia).

Create a similar directory structure under htdocs:

mkdir aleph; cd aleph

mkdir a50_5; cd a50_5

ln -s $TMPMEDIA tmpmedia (please note uppercase and lowercase)

  1. Similarly, make soft-links to other directories you want to access. For security purposes, be as restrictive as possible. Note that once a directory is accessible, all parts of the tree under it are also accessible.

Example:

To show the contents of /tmp, (not mandatory) you make a link to it as follows:

ln -s /tmp tmp

You are now ready to run the Apache daemon.

3.3Running Apache Daemon

3.3.1Aleph versions lower than 14.1

su root

<apache_install_dir>/bin/httpd –d <apache_install_dir>

3.3.2Aleph versions 14.1 and higher

su root

<apache_install_dir>/bin/httpd –d <aleph_root>/apache

(where <aleph_root is the path to ALEPH, e.g. /aleph/a50_5)

4.Configuring ALEPH to Work with Apache

Change the icon path defined for ALEPH so that Apache loads the icons. As aleph_user change the $alephe_root/www_server_defaults file.

Change the definition of the icon_path from:

setenv icon_path

to:

setenv icon_path

4.1For ALEPH versions 12.1 and above:

For ALEPH versions 12.1 and above, also add:

setenv doc_path

If you definea portdifferent from 80, the lines above should read:

(each setenv definition should come in only one line)

setenv icon_path

setenv doc_path

4.2For ALEPH versions 14.2 and above:

For ALEPH versions 14.2 and above, as aleph_user change the $alephe_root/www_server_defaults file.

Change the definitions of the icon_path, doc_path and server_media:

(each setenv definition should come in only one line)

setenv icon_path

setenv doc_path

setenv server_media

Define the following variables in the file $alephe_root/aleph_start_505:

setenv httpd_bin <apache_install_dir>/bin

setenv httpd_root ${ALEPH_MOUNT}/a5${VERSION_NUMBER}_5/apache

setenv HTTPD_PORT <the port number where the Apache server listens, e.g. 80>

5.Running Apache on Startup

Login as root.

Add the proper line(s) and/or files to the operating systems listed below. Choose the add-ins suitable for the operating system(s) in use. These add-ins ensure that the Apache daemon is run on startup (this depends on the system).

5.1On ALPHA

5.1.1ALEPH versions lower than 14.1:

cd /sbin/init.d

Create a file called httpd containing the following lines:

#!/sbin/sh

case "$1" in

'start')

<apache_install_dir>/bin/httpd -d <apache_install_dir>

;;

'stop')

<apache_install_dir>/bin/apachectl stop

;;

esac

Once the file has been created, ensure that this file is executable:

chmod 755 httpd

ln -s /sbin/init.d/httpd /sbin/rc3.d/S88httpd

5.1.2ALEPH versions 14.1 and upper:

(replace <aleph_root> with the root to ALEPH (i.e. /aleph/a50_5))

cd /sbin/init.d

Create a file called httpd containing the following lines:

#!/sbin/sh

case "$1" in

'start')

<apache_install_dir>/bin/httpd -d <aleph_root>/apache

;;

'stop')

<apache_install_dir>/bin/apachectl stop

;;

esac

Once the file has been created, ensure that this file is executable:

chmod 755 httpd

ln -s /sbin/init.d/httpd /sbin/rc3.d/S88httpd

5.2On Solaris

5.2.1ALEPH versions lower than 14.1:

cd /etc/init.d

Create a file called apache containing the following line:

<apache_install_dir>/bin/httpd -d <apache_install_dir>

Make sure this file is executable:

chmod 755 httpd

cd /etc/rc2.d

Create a softlink to the previous file:

ln -s ../inet.d/apache S94httpd

5.2.2ALEPH versions 14.1 and upper:

(replace <aleph_root> with the root to ALEPH (i.e. /aleph/a50_5))

cd /etc/init.d

Create a file called apache containing the following line:

<apache_install_dir>/bin/httpd -d <aleph_root>

Make sure this file is executable:

chmod 755 httpd

cd /etc/rc2.d

Create a softlink to the previous file:

ln -s ../inet.d/apache S94httpd

5.3On AIX

5.3.1ALEPH versions lower than 14.1:

mkitab "httpd:2:wait:/ <apache_install_dir>/bin/httpd –d \ <apache_install_dir>

5.3.2ALEPH versions 14.1 and upper:

(replace <aleph_root> with the root to ALEPH (i.e. /aleph/a50_5))

mkitab "httpd:2:wait:/ <apache_install_dir>/bin/httpd –d \ <aleph_root>

5.4On HP

5.4.1ALEPH versions lower than 14.1:

cd /sbin/init.d

Create a file called httpd containing the following lines:

#!/sbin/sh

case "$1" in

'start')

<apache_install_dir>/bin/httpd -d <apache_install_dir>

;;

'stop')

<apache_install_dir>/bin/apachectl stop

;;

esac

exit $rval

Make sure this file is executable:

chmod 755 httpd

ln -s /sbin/init.d/httpd /sbin/rc1.d/S890httpd

5.4.2ALEPH versions 14.1 and upper:

(replace <aleph_root> with the root to ALEPH (i.e. /aleph/a50_5))

cd /sbin/init.d

Create a file called httpd containing the following lines:

#!/sbin/sh

case "$1" in

'start')

<apache_install_dir>/bin/httpd -d <aleph_root>

;;

'stop')

<apache_install_dir>/bin/apachectl stop

;;

esac

exit $rval

Make sure this file is executable:

chmod 755 httpd

ln -s /sbin/init.d/httpd /sbin/rc1.d/S890httpd

5.5On Linux

5.5.1ALEPH versions lower than 14.1:

cd /etc/rc.d/init.d

Create a file called httpd containing the following lines:

#!/bin/tcsh

/aleph/product/apache/bin/httpd - d /aleph/product/apache

Make sure this file is executable:

chmod 755 httpd

Make proper links to this start file:

ln -s /etc/rc.d/init.d/httpd /etc/rc.d/rc1.d/S890httpd

ln -s /etc/rc.d/init.d/httpd /etc/rc.d/rc2.d/S890httpd

5.5.2ALEPH versions 14.1 and upper:

(replace <aleph_root> with the root to ALEPH (i.e. /aleph/a50_5))

cd /etc/rc.d/init.d

Create a file called httpd containing the following lines:

#!/bin/tcsh

/aleph/product/apache/bin/httpd - d <aleph_root>/apache

Make sure this file is executable:

chmod 755 httpd

Make proper links to this start file:

ln -s /etc/rc.d/init.d/httpd /etc/rc.d/rc1.d/S890httpd

ln -s /etc/rc.d/init.d/httpd /etc/rc.d/rc2.d/S890httpd

6.Using Apache with multiple versions of ALEPH

(this will probably be changed soon)

The best configuration for multiple versions of ALEPH is probably the definition of one virtual host for each version. Definition of virtual hosts is beyond the scope of this document.