CS1115/CS5002

Web Development 1

Dr Derek Bridge

School of Computer Science & Information Technology

University College Cork

Background: Unix file systyems

 

Absolute pathnames

File and directory names

Unix permissions

Ownerthe person who owns the file/directory
Groupusers who belong to the group associated with the file/directory
Otherall users who can login to the system
Read view the contents of the file
list the names of the files in the directory
Write modify the contents of the file or delete it
add files to the directory, remove files from it, rename files in it
Execute run the file (if it is a program)
traverse the directory and, if also have read permission, list the files, view their contents, view their permissions,…

Web servers

The Apache web server

httpd.conf example

ServerName www.example.com
                
Listen 80

DocumentRoot "/var/www/html"

Class exercise

A browser requests the following URLs. What will the server's responses be (assuming file/directory permissions are OK)?

What will the responses be if the cats directory lacks execute permissions?

Error pages

<!DOCTYPE html>
<html>
    <head>
        <title>404 error</title>
    </head>
    <body>
        <p>
            Oops!
        </p>
    </body>
</html>
ServerName www.example.com
                
Listen 80

DocumentRoot "/var/www/html"

ErrorDocument 404 /errors/bad_url.html

Directory listings and index fles

Class exercise

A browser requests the following URLs. What will the server's responses be (assuming file/directory permissions are OK)?

ServerName www.example.com
                
Listen 80

DocumentRoot "/var/www/html"

DirectoryIndex index.html

<Directory />
    Options +Indexes
</Directory>

Redirection and aliases

User web sites