Goal:
- Learn
how to configure apache as
- web
server.
- cache server
- reverseproxy
- Learn
how to from a single cluster using reverseproxy.
- Learn
the basic facts about the content delivery network.
Assignment
Date: 9/9/2002
Due Day: 9/18/2002
Description:
Exercise 1. Configure
apache to run as a web server
- In this exercise,
we will learn how to configure apache to run as a web server.
- On our CS Unix machines, there
is a httpd program in /usr/sbin/. It is the Apache HyperText Transfer Protocol
(HTTP) server program. It is designed to be run as a standalone
daemon process. Read man page with "man httpd" for more info.
SYNOPSIS
httpd [ -X ] [ -R libexecdir ] [ -d serverroot ] [ -f con-fig ] [ -C directive
] [ -c directive ] [ -D parameter ]
- If "/usr/sbin/httpd -d /users/server/students/cs526/public_html/apache/ws2
-X" is run, the httpd program will treat /users/server/students/cs526/public_html/apache/ws2
as serverroot directory and read the directives in the conf/httpd.conf file
for configuring the apache server. -X is for debugging purpose, it indicates
to the httpd daemon that do not fork spare child process for improving performance.
Just run a single standalone process.
- An example of httpd.conf is
LoadModule config_log_module
/etc/httpd/modules/mod_log_config.so
LoadModule access_module /etc/httpd/modules/mod_access.so
User
cs526
ServerName sanluis.uccs.edu
Port 8388
DocumentRoot
/users/server/students/cs526/public_html/apache/ws2/htdocs
ErrorLog
logs/error_log
TransferLog logs/access_log
PidFile logs/httpd.pid
- The first directieve LoadModule
tells the httpd program to dynamically load in /etc/httpd/modules/mod_log_config.so
as dynamic shared object (very much like dll). The log_module code deals
with creating error log entries in the log files.
- Access_module deal with creating
access log entries in the log files.
- User directives tells httpd to
run itself as cs526 account.
- ServerName tells httpd the domain
to use when displaying error msg.
- Port directive tells httpd to use
8388.
- DocumentRoot specifies the actual
path to the default web document directory.
- EorrLog specifies the name of the
file for saving error log records.
- TransferLog specifies the name
of the file for saving the access records.
- PidFile specifies the names fo
the files for saving the process id of the httpd server. It can be used
by system admin to restart or stop the httpd server.
- For this exercise, we would like
you to copy the directory ~cs526/public_html/apache to your ~<login>/public_html
directory, using "cp -r ~cs526/public_html/apache ~<login>/public_html.
- login to blanca.
- cd public_html/apache/ws1/conf/
- edit httpd.conf file by replacing
the account on User directive with your own account.
- replace the port number with 8<last
3 digits of your SS#> in the Port directive.
- Run the apache web server as "/usr/sbin/httpd
-d /users/server/students/<login>/public_html/apache/ws1 -X"
- Go to any browser and enter "http://blanca.uccs.edu:8<last
3 digits of your SS#>/index.html" and se
e if the web page shows up.
- Check the logs in /users/server/students/cs526/public_html/apache/ws1/log/access_log
and see the access records is created.
- Email me the url of the access_log
file.
- Repeat that for sanluis but instead
of public_html/apache/ws1/conf/ use public_html/apache/ws2/conf/. Use "/usr/sbin/httpd
-d /users/server/students/<login>/public_html/apache/ws2 -X"
as command for starting web server.
- cp -r ws1 ws3 to create ws3 directory.
- login to shavano. Edit the httpd.conf
file and web page files in ws3/conf/htdocs directory to reflect the machine
shavano which will serve the web page. Create a subdirectory personnel and
a personnel web page with "this is shavano personnel web page "
as content in the htdocs directory.
- Run the web server and leave some
access records.