Sonoma State University
Department of Computer Science
CS-210: Introduction to Unix
Exercise 7: Create a web page on Blue

Objective:

To create a webpage on Blue.

Location of your public HTML directory:

The Apache web server running on Blue will serve up web pages from ~/public_html as your website. The web server runs under the identity apache. You need to make sure the directory ~/public_html exists and is accessible to Apache.

Create a minimalist home page:

Your home page will be served up from a file titled, index.html. In exercise 2, you created a directory called public_html within your home directory on Blue. Please enter the following commands:

  1. cd ~/public_html
  2. echo "It worked" > ~/public_html/index.html
  3. Enter the following URL into a browser to see your home page on Blue (note substitute your login ID for userid):
    https://blue.cs.sonoma.edu/~userid/

Permissions on home page:

To make your home page readable by the web server, you will need to change the permissions on one of these using the chmod command:

  • The directory ~ (your home directory)
  • The directory public_html in your home directory
  • The file index.html inside the ~/public_html directory

Since you want these things to be available to the web server with the goal of sharing them via the Internet, you could set the "world" permissions to give the web server access. Setting world permissions to 'rwx' is too permissive since other users on Blue would be able to modify your website by editing your files in your home directory.

Goal: determine the minimal world permissions necessary to display web pages.

How could this be done? One approach is to add all the permissions possible (rwx), verify it works by refreshing your home web page (index.html), and then incrementally take permissions away from your home page until the page is no longer displayed. If the web page is not visible, you must have taken away a required permission. Therefore, restore that permission and take away a different permission. Repeat until permissions are minimal for world access while making your home page visible.

Note: when the permissions are correct, the Apache web server on Blue will display "It worked" in your web browser when you access your page's URL in a browser.

Requirements for your home page:

Your home page should minimally have the following HTML tags:

  • The doctype tag
  • The html tag
  • The head tag
  • The title tag
  • The body tag
  • An h1 (heading one) tag with some text inside it
  • A ul tag (to create a bulleted list)
  • An li tag (list tag for your bulleted list) along with text to be displayed in the list
  • An image tag with an image in it. You can supply your own image, or find a pubic domain one from https://unsplash.com/

Note: to upload images to Blue from an image you downloaded on a lab computer or your laptop, use secure FTP. Example: sftp username@blue.cs.sonoma.edu (substitute your login name on Blue for username)

HTML validation:

The website should be written in valid HTML, per this validator: https://validator.w3.org/

Example web pages from former CS-210 students:

Resources for HTML

https://www.w3schools.com/html/

Submitting your work

Please submit the following for this assignment:

  • A directory listing showing the permissions you set for the ~/public_html directory and index.html file permissions:You can create this with the following command: ls -al ~/public_html > ~/my_web_directory_permissions.txt
  • The URL to your webpage on blue.