Contents introduction 3



Download 79.74 Kb.
Date29.07.2017
Size79.74 Kb.
#24219


How to Install and Configure the Apache Server


All Releases
Last update: September 7, 2000

CONTENTS


1. Introduction 3

1.1 Adding an Apache server to ALEPH: 3



2. Installing the Apache Server 4

2.1 Installation 4

2.2 Before Compiling Apache 5

2.3 Compiling Apache 6



3. Configuring the Apache Server 7

3.1 Configuring Apache 7

3.2 Making Links to Other Filesystems 13

3.3 Running Apache Daemon 15



4. Configuring ALEPH to Work with Apache 16

4.1 For ALEPH versions 12.1 and above: 16

4.2 For ALEPH versions 14.2 and above: 16

5. Running Apache on Startup 18

5.1 On ALPHA 18

5.2 On Solaris 19

5.3 On AIX 20

5.4 On HP 20

5.5 On Linux 21



6. Using Apache with multiple versions of ALEPH 23

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 http://www.apache.org/ . Please review the Apache license at http://www.apache.org/LICENSE.txt .

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 , 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
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:

http://www.apache.org/dist/


  • The fastcgi module for Apache from:

http://www.fastcgi.com/dist/mod_fast_cgi_2.2.2.tar.gz


  • The fastcgi-development-kit from:

http://www.fastcgi.com/dist/fcgi-devkit-2.1.tar.gz

Ftp the file mod_fastcgi_2.2.2.tar to
cd
tar -xvf ./src/apache_1_3_6_tar.tar
From now on, is used to specify the directory where Apache files are.

cd
cd src/modules

tar -xvf /src/mod_fastcgi_2.2.2.tar

mv mod_fastcgi_2.2.2 fastcgi
cd
./configure --prefix= \

--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: http://service.software.ibm.com/cgi-bin/support/rs6000.support/downloads
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

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 /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: /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

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: /conf/httpd.conf

(Replace <$aleph_version> with your current ALEPH version (e.g. 505), with the path to ALEPH root (e.g. /aleph/a50_5) and 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

SetEnv alephe_tab /alephe/tab

SetEnv aleph_proc /aleph/proc)

SetEnv LOGNAME
ScriptAlias /aleph-bin/ "/aleph/exe/"
For cgi front:

(each ScriptAlias definition should come in only one line)

ScriptAlias "/ALEPH" "/aleph/exe/www_front_cgi/ALEPH"

ScriptAlias "/S" "/aleph/exe/www_front_cgi/S"

ScriptAlias "/B" "/aleph/exe/www_front_cgi/B"

ScriptAlias "/N" "/aleph/exe/www_front_cgi/N"

ScriptAlias "/D" "/aleph/exe/www_front_cgi/D"

ScriptAlias "/U" "/aleph/exe/www_front_cgi/U"

ScriptAlias "/G" "/aleph/exe/www_front_cgi/G"

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



ScriptAlias "/R" "/aleph/exe/www_front_cgi/R"
For fastcgi front (version 12.3 and higher):

ScriptAlias "/ALEPH" "/aleph/exe/www_front_cgi_fast.fcgi/ALEPH"

ScriptAlias "/S" “/aleph/exe/www_front_cgi_fast.fcgi/S"

ScriptAlias "/B" "/aleph/exe/www_front_cgi_fast.fcgi/B"

ScriptAlias "/N" "/aleph/exe/www_front_cgi_fast.fcgi/N"

ScriptAlias "/D" "/aleph/exe/www_front_cgi_fast.fcgi/D"

ScriptAlias "/U" "/aleph/exe/www_front_cgi_fast.fcgi/U"

ScriptAlias "/G" "/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/exe/www_front_cgi_fast.fcgi/R"
Add the following lines:

(Find a paragraph that starts with



and ends with .



(after

... lines)
For cgi front:

/aleph/exe/">

AllowOverride None

Options ExecCGI

Order allow,deny

Allow from all




For fastcgi front (version 12.3 and higher):

/aleph/exe/">

AllowOverride None

Options ExecCGI

Order allow,deny

Allow from all

AddHandler fastcgi-script .fcgi



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 /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 . 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
Header append expire 0
(Replace <$aleph_version> with your current ALEPH version (e.g. 505), with the path to ALEPH root (e.g. /aleph/a50_5) and 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 /alephe/tab

SetEnv aleph_proc /aleph/proc)
Correct the values for ALEPH_VERSION, LOGNAME and USER:

SetEnv ALEPH_VERSION <$aleph_version>

SetEnv USER

SetEnv LOGNAME
Setup alias to use cgi (or fastcgi) front:

ScriptAlias /aleph-bin/ "/aleph/exe/"

ScriptAlias /aleph-cgi/ "/aleph/cgi/"

For cgi front:

(each ScriptAlias definition should come in only one line)

ScriptAlias "/ALEPH" "/aleph/exe/www_front_cgi/ALEPH"

ScriptAlias "/S" "/aleph/exe/www_front_cgi/S"

ScriptAlias "/B" "/aleph/exe/www_front_cgi/B"

ScriptAlias "/N" "/aleph/exe/www_front_cgi/N"

ScriptAlias "/D" "/aleph/exe/www_front_cgi/D"

ScriptAlias "/U" "/aleph/exe/www_front_cgi/U"

ScriptAlias "/G" "/aleph/exe/www_front_cgi/G"

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



ScriptAlias "/R" "/aleph/exe/www_front_cgi/R"
For fastcgi front (version 12.3 and higher):

ScriptAlias "/ALEPH" "/aleph/exe/www_front_cgi_fast.fcgi/ALEPH"

ScriptAlias "/S" "/aleph/exe/www_front_cgi_fast.fcgi/S"

ScriptAlias "/B" "/aleph/exe/www_front_cgi_fast.fcgi/B"

ScriptAlias "/N" "/aleph/exe/www_front_cgi_fast.fcgi /N"

ScriptAlias "/D" "/aleph/exe/www_front_cgi_fast.fcgi /D"

ScriptAlias "/U" "/aleph/exe/www_front_cgi_fast.fcgi /U"

ScriptAlias "/G" "/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/exe/www_front_cgi_fast.fcgi/R"

Add the following lines:


(Find a paragraph that starts with



and ends with .



(after

... lines)
For cgi front:

/aleph/exe/">

AllowOverride None

Options ExecCGI

Order allow,deny

Allow from all


/aleph/cgi/">

AllowOverride None

Options ExecCGI

Order allow,deny

Allow from all


For fastcgi front (version 12.3 and higher):

/aleph/exe/">

AllowOverride None

Options ExecCGI

Order allow,deny

Allow from all

AddHandler fastcgi-script .fcgi


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

ScriptAlias "/V" “/aleph/exe/www_front_cgi/V"

ScriptAlias “/O” "/aleph/exe/www_front_cgi/O"
For fastcgi front:

ScriptAlias "/V" I "/aleph/exe/www_front_cgi_fast.fcgi/V"

ScriptAlias "/O"

"/aleph/exe/www_front_cgi_fast.cgi/O"


3.2Making Links to Other Filesystems





  1. Go to: /htdocs




  1. Link to the icon’s path so that the Apache server can find the icons.

Create links to ALEPH's www_/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_

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

cd /htdocs

ln –s $alephe_root/documentation documentation_


  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

/bin/httpd –d

3.3.2Aleph versions 14.1 and higher


su root

/bin/httpd –d /apache

(where

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 http://:$2/aleph/u5${VERSION_NUMBER}_5/alephe/www
to:
setenv icon_path http:///www

4.1For ALEPH versions 12.1 and above:

For ALEPH versions 12.1 and above, also add:

setenv doc_path http://ram42.exlibris.co.il/documentation_${ALEPH_VERSION}
If you define a port different from 80, the lines above should read:

(each setenv definition should come in only one line)


setenv icon_path http://:
/www

setenv doc_path



http://ram42.exlibris.co.il:
/documentation_${ALEPH_VERSION
}

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 http://:${HTTPD_PORT}/www

setenv doc_path

http://:${HTTPD_PORT}/documentation_${ALEPH_VERSION}

setenv server_media http://:${HTTPD_PORT}


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

setenv httpd_bin /bin

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

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')


/bin/httpd -d

;;


'stop')

/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 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')

/bin/httpd -d /apache

;;


'stop')

/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:

/bin/httpd -d
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 with the root to ALEPH (i.e. /aleph/a50_5))

cd /etc/init.d


Create a file called apache containing the following line:

/bin/httpd -d
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:/ /bin/httpd –d \

5.3.2ALEPH versions 14.1 and upper:


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

mkitab "httpd:2:wait:/ /bin/httpd –d \

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')


/bin/httpd -d

;;


'stop')

/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 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')


/bin/httpd -d

;;


'stop')

/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 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 /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.
Alternately, if you want to run multiple versions of ALEPH on the same computer, without having to deal with virtual hosts, do the following:


  • To use Apache only for file transfer (online documentation, icons):

Under the htdocs directory, where you define the links to Aleph files, define the following:
(In the following lines, replace $alephe_root with the path corresponding to the version)
cd /htdocs

mkdir a50_5 (or the corresponding root for the Aleph version)

cd a50_5

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

cd /htdocs

mkdir a50_5 (or the corresponding root for the Aleph version)

cd a50_5

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

Now for the next version:


cd /htdocs

mkdir a53_5 (or the corresponding root for next the Aleph version)

cd a53_5

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


cd /htdocs

mkdir a53_5 (or the corresponding root for the next ALEPH version)

cd a53_5

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
In each $alephe_root/www_server_defaults file, define the icon_path as follows:
setenv icon_path http:///a50_5/www

(replace a50_5 with the corresponding version root)

setenv icon_path http:///a50_5/www

(replace a50_5 with the corresponding version root)




  • To run www_front_cgi (ALEPH version 12.2 and up) or fastcgi (ALEPH version 12.3 and up – not Linux), carry out the following steps:




  1. Install Apache as indicated in the document, but do not run the daemon or correct the configuration file

  2. Under each ALEPH version root (e.g. /aleph/a50_5):

  • mkdir apache

  • cp –r /cgi-bin apache

  • cp –r /htdocs apache

  • cp –r /conf apache

  • cp –r /logs apache

  • cp –r /icons apache

  • cd ./apache/conf

  • edit the httpd.conf file and correct it (according to the steps indicated for the current ALEPH version in section 3.1)

  • for each version of ALEPH you will need a different port. Choose port 80 for the main version you want to run (with no port)

  • cd ../htdocs

  • make links to icons (the same as indicated in version 3.2)

  • su

  • /bin/httpd –d /aleph/a50_5/apache (change a50_5 to whichever version you are dealing with)

  • add to the httpd file used for startup (according to the Operating System) one line per ALEPH version, containing:


/bin/httpd –d /aleph/a50_5/apache (change a50_5 to whichever version you are using)







Download 79.74 Kb.

Share with your friends:




The database is protected by copyright ©ininet.org 2024
send message

    Main page