[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


Apache 1.3.28 Web Server for UNIX/SGI-O2 Installation and Config

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

[Back to CCP14 Web/Config Main Page]

[Why use this webserver | Where to get this webserver | Compiling the apache 1.3.23 webserver]
[Setting up the config files(s). | Starting, Stopping and Restarting the server | Automatic startup of the server]
[Checking Server Status]

Why Use Apache over other Web Servers

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; as well as technical books (including an "Apache for Dummies" book). This means problems can generally be solved relatively quickly (unless they are due to nuances with the SGI IRIX operating system and Apache - which have happened). Linux (or more likely FreeBSD UNIX) 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 (1st August 2003), Apache 1.3.28 was recently announced and mainly to keep ahead of the script kiddie hackers, it was time to upgrade from 1.3.27. Thus (based on Apache.org recommendations) 1.3.27 was upgraded to 1.3.28.

(Note: Before attempting an upgrade, backup the currently running Apache installation so it can be re-enabled if things go wrong) Be wary that obviously upgrading the OS can put you into possible strife as well.

This can be done by "mkdir /usr/local/apache/apache-1.3.11.old"; going into the /usr/local/apache directory and using the command:
tar cf - . | (cd /usr/local/apache/apache-1.3.11.old ; tar xpf - )

Be wary that if you have much in the way of log files, this could be a GIG or so extra on your hard-disk.

Where to get this 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://httpd.apache.org/dist/httpd/. Download the apache_1.3.28.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. Unlike Apache 1.2.6, Mod_rewrite and Mod_spelling are included with the source code but have to be enabled manually.

Compiling and Installing the Web Server

The stages for compiling and installing the apache 1.3.28 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.3.28 subdirectory. Go into this directory and then go into the src subdirectory (cd apache_1.3.28/src).

Configuring the Configuration file

Run Configure script in the src directory (type ./Configure) and this will setup the makefile ready compiling. It may give you a warning saying this is not what you want. Yes it is, unless you want to install the software somewhere else where you would use the command specified in the INSTALL file. Be wary than when upgrading from previous versions of Apache, the latest Apache by default installs the binaries into /usr/local/apache/bin and the configuration files into /usr/local/apache/conf. These can be over-ridden.

Run make to compile the apache server and create the executables.

The following may have to be done in "superuser/root" mode.
Assuming everything when nicely, run make install to copy a lot of files into the /usr/local/apache/ area. This includes:

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 for Apache 1.2.6 and other web servers, /usr/local/apache/htdocs for Apache 1.3.x) But the CCP14 web-pages are on a dedicated external 50 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.

Example Config Files

The CCP14 root web page area starts from a directory called:

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.3.28 are:

Unlike previous versions of Apache, most of the config is now in the httpd.conf file.

Setting up http.conf (/usr/local/apache/conf/access.conf)

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

Generally most of the Apache options are safe but options and information has to be set before the server will run correctly:

NB: If the variable is not mentioned, it is most likely the default is being used though most of the following is using the default.

Section 1: Global Environment

Section 2: 'Main' server configuration

Setting up server-status and server-info

Examples of Setting up Virtual Hosts in Apache 1.3.28

Setting up mime.types (/usr/local/apache/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(?).

Configuring redirects so old links will correctly forward

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, Stopping and Restarting the apache 1.3.28 server

In this particular installation of Apache 1.3.28, the httpd.pid PID file is in /usr/local/apache/logs. It is the least effort to use the Apache supplied scripts to do any stop/start/restart.

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

To Restart (i.e., stop then quickly start it up again):

/usr/local/apache/bin/apachectl  restart

To Stop:
/usr/local/apache/bin/apachectl  stop
To Start:
/usr/local/apache/bin/apachectl  start

If upgrading to a new version of the webserver, "apachectl restart" may not be good enough and you may have to do "apachectl stop" the "apachectl start" for the new version to get put into memory over the old version.

Automatically startup of the server on an SGI O2 running IRIX 6.3/IRIX 6.5

Under Construction - not complete/most likely wrong - and Specific for IRIX 6.3/IRIX 6.5. Consult your OS documentation (or better yet - local OS guru) to find out how to do this on your system.

What can be said, whatever family that IRIX UNIX comes from, it sucks and it is no wonder Bill Gates is a billionaire selling Windows. Putting something to automatically start up is not that trivial and following is a possibly dodgy implementation. Basically, it seems it is commond just to copy the lpd deamon script the /etc/init.d directory (which then has a link put to it from the /etc/rc2.d directory). Then edit in Apache, and edit out LPD.

Thus as root go into the /etc/init.d directory and copy the relevant file; In this case on the CCP14 Server; cp bsdlpr httpd. Make sure it is exectuable (chmod +x httpd).

Change the script so you pretty much get something like the following (start-script.txt).

Then type ln -s /etc/init.d/httpd /etc/rc2.d/S62httpd (giving the link a number after the LPR deamon showing the order it will be started up in)

Then (still as root), type cp /etc/config/bsdlpr /etc/config/httpd

Then type ln -s /etc/config/httpd /var/config/httpd

In theory, /etc/chkconfig can then be used to check on the status of things. If httpd does not appear by typing chkconfig, try chkconfig httpd on

(Summary of all of this, next killer apps for UNIX will be "c:\config.sys" and "c:\autoexec.bat")

From: "Andrew" [grof@home.com]
Newsgroups: comp.infosystems.www.servers.unix
Subject: Re: Do I need Apache after installing Linux6.1 ?
Date: Sat, 16 Oct 1999 23:27:22 GMT

RedHat 6.1 comes with Apache...

Your configuration files are in /etc/httpd/conf

The log files are in /var/log/httpd

The default location for web content is /home/httpd

To start the server, run /etc/rc.d/init.d/httpd start

To stop the server, run /etc/rc.d/init.d/httpd stop

To reset the server do this: kill -HUP `cat /var/run/httpd.pid`

If you don't seem to have it installed, simply use RPM to install it.

>I have just installed RedHat Linux 6.1.   It seems that a web server is
>included in Linux6.1.  Is that right?   Do I need to install Apache 1.3.9
>after installing Linux6.1 ?
>Thanks for your help.

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

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

type /usr/bsd/telnet www.ccp14.ac.uk 80           [RETURN](80  stands for port 80)
type HEAD / HTTP/1.0
  (type [RETURN] twice)
You should get the output of something akin to the following on your terminal:
sv1 227% /usr/bsd/telnet www.ccp14.ac.uk 80
Connected to sv1.ccp14.ac.uk.
Escape character is '^]'.

HTTP/1.1 200 OK
Date: Wed, 19 Jun 2002 01:25:22 GMT
Server: Apache/1.3.28 (Unix)
Last-Modified: Fri, 03 Nov 2000 23:57:51 GMT
ETag: "cc469eb-1b14-3a0350ff"
Accept-Ranges: bytes
Content-Length: 6932
Connection: close
Content-Type: text/html

Connection closed by foreign host.
sv1 228%                              


[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