[CCP14 Home: (Frames | No Frames)]
CCP14 Mirrors: [UK] | [CA] | [US] | [AU]

(This Webpage Page in No Frames Mode)

Collaborative Computational Project Number 14

for Single Crystal and Powder Diffraction

CCP14

Apache 1.2.6 Web Server for UNIX/SGI-O2 Installation and Config (obsolescent)

The CCP14 Homepage is at http://www.ccp14.ac.uk

[Back to CCP14 Web/Config Main Page]

[Apache 1.2.6 is obsolescent. Look instead into Compiling and Configuring the latest Apache 1.3.x Webserver]

[Why use this webserver | Where to get this webserver | Compiling the apache 1.2.6 webserver]
[Setting up the .conf config files. | Starting and stopping the server | Automatic startup of the server]
[Checking Server Status]


Why Use Apache over other Web Servers

[Apache 1.2.6 is obsolescent. Look instead into Compiling and Configuring the latest Apache 1.3.x Webserver]

The apache webserver is free and available on a wide variety of UNIX operating systems (as well as Windows). Thus if you want to create a mirror of this site, it is not a problem to use a free web-server that the CCP14 will help you with.

It is presently the most popular web-server on the internet and comes with convenient, enhanced functionality not easily available on other web-servers. This includes a powerful redirection meta-language as well as fixing up common spelling errors. Perl can also be compiled inside the server to provide extra increases in performance for Perl based scripts

There is a large base of on-line, web and newsgroup based help, commbined and technical books (including a Apache for Dummies book) meaning problems can generally be solved. Linux on PC is probably a better system to use than an SGI O2 as it has a wide user base; but an SGI O2 was chosen as this type of system is supported at the Daresbury Laboratory.

As of writing this, Apache 1.3.0 (1.3.1 just announced) is the latest version but seems to be buggy on an SGI O2 running IRIX 6.3. While the server compiled very easily using the ./configure command, on attempting to run the server, a variety of errors occured. There are a number of complaints about this version of Apache and it looks like 1.2.6 is a more tested version to be using. For CCP14 based applications, Apache 1.2.6 is quite adequate.

Be wary on using 1.3.0 documentation as a guide for doing on the fly configuring of 1.2.6. It is not easy to find the old 1.2.6 documentation on the website. It is at http://www.apache.org/docs-1.2/ or
http://www.hensa.ac.uk/mirrors/apache/docs-1.2/


Where to get this webserver

[Apache 1.2.6 is obsolescent. Look instead into Compiling and Configuring the latest Apache 1.3.x Webserver]

The main Apache website is at http://www.apache.org.

On entering the website, it is possible to go to a close mirror site, of which there are many all over the place. You can find a closer mirror site automatically using the Apache "find a closer mirror site" CGI script at http://www.apache.org/dyn/closer.cgi.

The Apache distribution directory is at http://www.apache.org/dist/. Download the apache_1.2.6.tar.gz (or .Z) file. (It is possible to get binaries).

Apache Modules

The functionality of Apache can be radically expanded by compiling in various modules. Only two extra modules are used for CCP14 applications and enhance general usability. The rewrite_module source code is included in the distribution but you have to download the mod_spelling.c file that is in the http://www.apache.org/dist/contrib/modules/ area.


Compiling and Installing the Web Server

[Apache 1.2.6 is obsolescent. Look instead into Compiling and Configuring the latest Apache 1.3.x Webserver]

The stages for compiling and installing the apache 1.2.6 web server are: (Note: You will need root mode to install the executable. While you can get around this with a /usr/local set to a user who administers this area but apache can only be start to listen to the default port 80 as "superuser/root".)

To extract the apache distribution file type either

This creates an apache_1.2.6 subdirectory. Go into this directory and then go into the src subdirectory (cd apache_1.2.6/src).

Copy the mod_speling.c module that you downloaded into the src directory.

Configuring the Configuration file

Run Configure script in the src directory (type ./Configure) and this will setup the makefile ready compiling.

Run make to compile the apache server and create the httpd executable.

The following may have to be done in "superuser/root" mode.
Assuming everything when nicely, run make install to install to:

You have finished creating an executable ready for configuring - YAY! :-)


Configuring Apache

Before configuring and starting apache, you have to decide where your web pages are going to exist. /usr/local/etc/httpd/htdocs is a common default but the CCP14 web-pages are on a dedicated external 18 GIG hard-disk directly connected to the web-server. Do not use NFS links to a remote hard-disk as this can create a lot of pain, and slow things down. At worst, keep this as a backup in case the primary web_data hard disk fails. A backup (and a test for trying out regional mirror scripts) is kept on a central Daresbury lab computer. The following is just an example, adapt it to your directory structure.

The CCP14 root web page area starts from a directory called:
/web_disc/ccp14/web_area

One thing to note is that this directory is not the root area for http://www.ccp14.ac.uk. Because the CCP14 server uses virtual domains, it is best to have a fall back directory where very old web browsers will go that do not recognise the virtual domain name protocol. This is the equivalent of going to the sv1.ccp14.ac.uk webserver (the real name of the O2 computer) where you are encouraged to upgrade to a relatively modern web browser but also have the possibility of browsing around from this area into the CCP14 web area using your old browser.

Other decisions are how to setup virtual domains, of which the domain names have to be inserted into the DNS. The network administrator would normally implement this. The virtual domains have been devided in such a way that people who would only want to mirror the roughly crystallographic part of the webserver could do so.

The main configuration stages for apache 1.2.6 are:

Setting up access.conf (/usr/local/etc/httpd/conf/access.conf)

An example access.conf file for the CCP14 can be obtained by clicking here

Generally most of the Apache options are safe but several options have to be set before the server will run correctly:

Document Root, in the CCP14 case:
<Directory /usr/people/ccp14/web_area>

Setting up server-status

Enable the following which allows you to look at problems with the web-server in real time via a web-interface. However, in theory, this would only work from within the computers/domains defined. http://www.ccp14.ac.uk/server-status

<Location /server-status>
SetHandler server-status

order deny,allow
deny from all
allow from .dl.ac.uk
allow from .ccp14.ac.uk
</Location>

This might also be a good time to tighten up the CGI security. Following is also how this was done, and also setting up for the RIB system which gives an example of how to restrict access by domain and/or password. (note: /cgi-bin is aliases to these real directories in httpd.conf and srm.conf)

<Directory /usr/local/etc/httpd/cgi-bin>
AllowOverride None
Options +ExecCGI -Indexes #means people cannot browse directories
                          #but can run the CGI scripts
</Directory>

<Directory /usr/local/rib>
AllowOverride None 
Options  +ExecCGI -Indexes #means people cannot browse directories
                          #but can run the CGI scripts
order allow,deny
allow from all
</Directory>

<Directory /usr/local/rib/cgi-bin/admin>
AllowOverride All  #Means you can define a .htaccess file 
                   #that only people who supply a username and password
                   #can do things in the admin area
Options  +ExecCGI +Indexes #means directories can be browsed
                           #and can also run the CGI scripts
order deny,allow
deny from all
allow from .dl.ac.uk       #In theory, only people from these
allow from .ccp14.ac.uk    #domains can work in the RIB admin area
</Directory>
Then in the /usr/local/rib/cgi-bin/admin directory have a .htaccess file with the following contents. (thanks to RIB people at http://www.nhse.org for help with this .htaccess file.
AuthUserFile /usr/local/etc/httpd/doobry-twang/doobry/.htpasswd  #not real directory
AuthGroupFile /dev/null
AuthName doobryribusername   #not real username - use something you can remember (6 to 8 characters is good)
AuthType Basic
</Limit GET>
require user doobryribusername  #not real username - use something you can remember (6 to 8 characters is good)
</Limit>
<Limit POST>
require user doobryribusername   #not real username - use something you can remember (6 to 8 characters is good)
</Limit>

</Directory>
Then in the /usr/local/etc/httpd/doobry-twang/doobry directory (give it a name you know of) have a .htpasswd file with the following contents. (again, thanks to RIB people at http://www.nhse.org for help with this .htaccess file.
doobryribusername:kdinsldkldfk
Leave the encrypted password blank if you just want to enter a username and no password. (not recommended) Otherwise, just use the UNIX crypt command to generate your encrypted password to insert into the .htpasswd file.

Then, providing you have access permissions (and the username and password), you can go into http://www.ccp14.ac.uk/rib/cgi-bin/admin/RIB.pl to administer the RIB system.

Setting up httpd.conf (/usr/local/etc/httpd/conf/httpd.conf)

An example httpd.conf file for the CCP14 can be obtained by clicking here

Setting up mime.types (/usr/local/etc/httpd/conf/mime.types)

An example mime.types file for the CCP14 can be obtained by clicking here

The mime.types file sets the file extensions that the apache web server will properly recognise. Normally this is kosher but a few things seem to be missing that have to be added manually.

Setting up srm.conf (/usr/local/etc/httpd/conf/srm.conf)

An example mime.types file for the CCP14 can be obtained by clicking here


Configuring redirects so old links will correctly forward

[Apache 1.2.6 is obsolescent. Look instead into Compiling and Configuring the latest Apache 1.3.x Webserver]

As http://www.ccp14.ac.uk/ was originally at http://www.dl.ac.uk/CCP/CCP14/, it is important that everything redirects. All decent web-servers have a redirect option and it is just a matter of requesting the web-administrator of that machine to set the redirects. http://www.dl.ac.uk/CCP/CCP14/ is a Netscape based server and has no problem doing this.

The same goes with an old address on the gserv1.dl.ac.uk machine such this it also redirects correctly. http://gserv1.dl.ac.uk/CCP/CCP14/


Manually Starting and stopping the apache 1.2.6 server

You must be in Super User/root mode to do the following:

To Stop:

kill -TERM `cat /usr/local/etc/httpd/logs/httpd.pid`
After it has stopped, to start:
/usr/local/etc/httpd/httpd


Automatically startup of the server on an SGI O2 running IRIX 6.3 (rc2.d)

Refer for info on this under: Installing Apache 1.3.3 - Automatic startup of the server


Checking Server Status

If you are using a web-browser within the Daresbury (.dl.ac.uk) or CCP14 (.ccp14.ac.uk) domains, you check the server-status via the web by using the address at

http://www.ccp14.ac.uk/server-status

Another method is Telnet to the server and check if it is running that way.

telnet www.ccp14.ac.uk 80           [RETURN](80  stands for port 80)
HEAD / HTTP/1.0 
  (type [RETURN] twice)
You should get the output of something akin to:
HTTP/1.1 200 OK
Date: Thu, 06 Aug 1998 16:42:15 GMT
Server: Apache/1.2.6
Last-Modified: Fri, 10 Jul 1998 14:03:06 GMT
ETag: "41d6d8-12be-35a61f1a"
Content-Length: 4798
Accept-Ranges: bytes
Connection: close
Content-Type: text/html

Connection closed by foreign host. 


[CCP14 Home: (Frames | No Frames)]
CCP14 Mirrors: [UK] | [CA] | [US] | [AU]

(This Webpage Page in No Frames Mode)

If you have any queries or comments, please feel free to contact the CCP14