7th CEENet Network Technology Workshop; Budapest, Hungary, August, 2001

Exercise with the Apache v.1.3 WWW Server on the Linux

1. Start Linux OS on Your computer.

2. Find, copy and unpack the Apache archive. Compile the server.

[root@pc01 httpd]# ls -al

total 48

drwxr-xr-x 12 root root 4096 Aug 21 11:36 .

drwxrwxr-x 6 root root 4096 Aug 21 11:36 ..

drwxr-xr-x 2 root root 4096 Aug 21 11:36 bin

drwxr-xr-x 2 root root 4096 Aug 21 11:36 cgi-bin

drwxr-xr-x 2 root root 4096 Aug 21 11:36 conf

drwxr-xr-x 3 root root 4096 Aug 21 11:36 htdocs

drwxr-xr-x 3 root root 4096 Aug 21 11:36 icons

drwxr-xr-x 3 root root 4096 Aug 21 11:36 include

drwxr-xr-x 2 root root 4096 Aug 21 11:36 libexec

drwxr-xr-x 2 root root 4096 Aug 21 11:37 logs

drwxr-xr-x 4 root root 4096 Aug 21 11:36 man

drwxr-xr-x 2 nobody nobody 4096 Aug 21 11:36 proxy

3. Configure the server (necessary directives)

<Directory /server/httpd/htdocs>

Options Indexes Includes FollowSymLinks

AllowOverride All

</Directory>

4. Start, stop and restart the server.

[root@pc01 httpd]# ps -ef | grep httpd

root 10490 1 0 11:37 ? 00:00:00 /server/httpd/bin/httpd

nobody 10491 10490 0 11:37 ? 00:00:00 /server/httpd/bin/httpd

nobody 10492 10490 0 11:37 ? 00:00:00 /server/httpd/bin/httpd

nobody 10493 10490 0 11:37 ? 00:00:00 /server/httpd/bin/httpd

nobody 10494 10490 0 11:37 ? 00:00:00 /server/httpd/bin/httpd

nobody 10495 10490 0 11:37 ? 00:00:00 /server/httpd/bin/httpd

nobody 10496 10490 0 11:37 ? 00:00:00 /server/httpd/bin/httpd

nobody 10497 10490 0 11:37 ? 00:00:00 /server/httpd/bin/httpd

nobody 10498 10490 0 11:37 ? 00:00:00 /server/httpd/bin/httpd

5. Modify the home (welcome) page of your server.

6. Server Side Includes.

7. Authentication.

8. CGI scripts.

9. Virtual servers.

cd /server/httpd

mkdir htdocs2

 

10. Compiling Apache server with the desired modules

[root@pc01 httpd]# telnet 0 80

Trying 0.0.0.0...

Connected to 0.

Escape character is '^]'.

OPTIONS * HTTP1.1

HTTP/1.1 200 OK

Date: Tue, 21 Aug 2001 10:02:00 GMT

Server: Apache/1.3.20 (Unix)

Content-Length: 0

Allow: GET, HEAD, OPTIONS, TRACE

Connection: close

Connection closed by foreign host.

and add directives for cache control with the desired values:

[root@pc01 conf]# telnet 0 80

Trying 0.0.0.0...

Connected to 0.

Escape character is '^]'.

OPTIONS * HTTP1.1

HTTP/1.1 200 OK

Date: Tue, 21 Aug 2001 10:28:55 GMT

Server: Apache/1.3.20 (Unix) PHP/4.0.6

Cache-Control: max-age=86400

Expires: Wed, 22 Aug 2001 10:28:55 GMT

Content-Length: 0

Allow: GET, HEAD, OPTIONS, TRACE

Connection: close

Connection closed by foreign host.

11. More work for the experienced students

 

 

Thank you, Miroslav Milinovic and Dubravko Penezic