(Logo) Introduction to WWW Server Configuration


IndexIndex to Course Material IndexIndex to Section 6 BackOther Multimedia NextForms and CGI scripts


If you want the HTML files you write to be accessible on the Internet rather than just as local files stored on your filesystem, then they must be placed in the public area of a WWW server.

Mapping of URLs to file and directory names

In the following section, URLs ("Uniform Resource Locators") are given in plain text, and filenames in italics.

For example, consider the URL: (refer to the explanation of the URL in Section 1 if necessary)

http://www.cryst.bbk.ac.uk/PPS2/course/section6/config.html
      |___________________|
                |
       Domain Name Server 
    (refer to the explanation in Section 1)
A WWW server is configured so that its publicly browsable area maps onto an actual directory on the filesystem of the host computer on which it runs. In the above example. the public area might be defined as the directory with the absolute pathname
/d/www/public/
(on a Unix system; on a PC the equivalent would be something like C:\D\WWW\PUBLIC)

Therefore the URL above would in fact be the file

/d/www/public/PPS2/course/section6/config.html
The URL http://www.cryst.bbk.ac.uk/PPS2/course/section6/ is equivalent to the directory
/d/www/public/PPS2/course/section6/
However, WWW servers can be configured for a default filename, such as index.html, to serve when no file is specified in the URL. In which case, the above URL would give the file
/d/www/public/PPS2/course/section6/index.html
Note that in an HTML hyperlink, an 'absolute' URL can be specified without a domain name. For example, the file afile.html contains:
<a href="/PPS2/course/index.html">...</a>
The first "/" can be thought of as being equivalent to the top level of the public area of the server hosting the file afile.html.

Note the difference between this and <a href="PPS2/course/index.html">...</a>.

cgi-bin

The URL of the form http://{domain name server}/cgi-bin/ (or http://{domain name}/htbin/) is a special case. 'cgi-bin' stands for Common Gateway Interface' binaries and is the location of a directory where the various extra binaries (executable files) that may be called by the Web-server are stored. This directory need not actually be named 'cgi-bin'. For example, suppose the Birkbeck Crystallography Dept. server was configured such that its cgi-bin directory was called /s/www/public/scripts/. The URL
http://www.cryst.bbk.ac.uk/cgi-bin/htimage
is the executable file called htimage, in this directory , i.e. the full path is /s/www/public/scripts/htimage

Input files can be specified as follows:

http://{domain name server}/cgi-bin/{program name}/{URL of input file}
Example:
http://www.cryst.bbk.ac.uk/cgi-bin/htimage/PPS2/course/section6/glycol.conf
      |___________________|       |_______|________________________________|
                |                     |                   |
        domain name server         executable      URL of input file
                                    software
i.e. the input file would be /d/www/public/PPS2/course/section6/glycol.conf

Files in cgi-bin do not have to actually be 'binaries'- they may be scripts written in just about any language that the host computer can interpret. These scripts may be referred to as 'CGI scripts' or 'CGI software', etc. A widespread application of such software is the processing of data submitted on WWW forms. This is described elsewhere in this Section, by David Moss (diagrams by Oliver Theis). 'Clickable imagemaps' also require CGI software; the current Section includes an Imagemap Tutorial, by Judith Murray-Rust

HTML files in your personal account

So far, we have assumed that you as HTML author have write-permission for the public area of your Web-server, which may not be the case. However, WWW-servers may be configured to serve additional publicly-browsable areas as follows.

Consider a URL of the form http://{domain name server}/~{user ID}/, for example

http://www.cryst.bbk.ac.uk/~ubcg00z/
The Birkbeck Crystallography server might be configured to map the public area of ~{user ID} onto the directory 'WWW' of the appropriate account.

(In Unix, ~ubcg00z means the top (home) directory of the account with ID ubcg00z . Suppose all the individual accounts were in the directory /d/user/ , then ~ubcg00z is equivalent to /d/user/ubcg00z.)

So the above URL actually refers to ~ubcg00z/WWW/ (i.e. /d/user/ubcg00z/WWW/).

Again, a filename can be specified as the default when none is given, such as home.html. So the above URL would correspond to the file ~ubcg00z/WWW/home.html

http://www.cryst.bbk.ac.uk/~ubcg00z/research/publications.html
is the file
~ubcg00z/WWW/research/publications.html
etc. As long as the WWW-server at your place of work is configured for this mapping to individual accounts, it is simple to mount your own Web pages.

(But make sure they are 'world-readable'! For example in UNIX, the command chmod 755 {filename} does the trick, i.e. changes the file permissions to -rwxr-xr-x . The same is also necessary for the parent directories, i.e. chmod 755 {parent-directory} and chmod 755 {grandparent-directory} , etc.)


IndexIndex to Course Material IndexIndex to Section 6 BackOther Multimedia NextForms and CGI scripts

Last updated 31st Mar '96