|
CSCI A348/A548 Lecture Notes 3
Fall 1999
|
Since the enrollment has only recently settled
this will be a review lecture to help you with the first assignment.
In the process the most common Unix commands (for us), and introduce
cron
, crontab
and
starthttpd
. Notice though that there are a few
new things.
Review: Basics of Web Communication
- the display of an HTML document involves an interplay between
the web user, browser, and server. A CGI script complicate this picture
only at the server end; the user and the browser may have no knowledge
that they are causing a program to run
- a web client communicates with a web server using the hypertext
transport protocol (HTTP). HTTP transactions perform simple actions like
retrieving an HTML page or executing a script
- CGI, or the Common Gateway Interface from the browser's point of
view the execution of a script is identical to the retrieval of a static
page. All communication with the script is mediated by the server
- from the browser's point of view the execution of a script
is identical to the retrieval of a static page. All communication with
the script is mediated by the server
- scripts are typically distinguished from ordinary HTML for example
by their location
- the output of each script typically starts
with a
Content-type
header which identifies
the Media Type of the script output. The header must be followed
by a blank line.
A review of Apache install
We have described the basic directory structure and have identified
three important elements:
- the web server program (an executable)
- the web server root directory
- the web server document root directory
We have described the installation of a web server starting from a
precompiled (binary) distribution.
We have identified the conf
directory and three
configuration files:
-
httpd.conf
, that contains information
that the server needs at startup
-
srm.conf
that contains information that the
server needs while it runs
-
access.conf
defines the access to the
files on your site
We made the following changes to the configuration files:
- specified the server root and the port number in
httpd.conf
- specified the locations of the script and document
root directories (in
srm.conf
)
- specified two path names in
access.conf
for the document root and scripts directories.
Then we were ready to start the web server.
We described how the server can be started and stopped.
We mentioned that we need to be able to restart the server
automatically if we need to be on-line continuously, and we have
said we will describe ways to do that using cron
.
The process id (pid) of the http daemon is located
in a file httpd.pid
in the logs
directory.
The same directory contains a file where accesses are logged and
a file where errors are recorded. We looked at them and described
them briefly.
Java and Perl programs
I will write the minimal, shortest programs in Perl and Java,
compile and run them for you. I will also use the Perl script
as a CGI application.
HTTP
We will use telnet
to request files from the server.