First, read basicUnix.html about logging into the University Unix systems.
A Different Type of Lab
We've been writing a lot of programs and creating files. Every webpage you look at with a browser is a file you have downloaded to the computer you are using. This is a very powerful idea.
We will create files using a text "markup" language called html so that we can have them look nice in a web browser. You will be given a template in html; all you have to do is change it slightly.
~/public_html
is special to software looking for web pages. Any and all files that you put into
this directory can become available on your web page. (If your user id
is foobar, your web page is http://udel.edu/~foobar). If the
web browser finds a file there called index.html, it automatically
displays that file.
To see if you have this directory, change your working directory
to your home directory and then see if the directory
"public_html" is listed. If you don't have the
directory already, create the public_html
directory.
public_html
directory and create a
cisc106 directory. The public_html/cisc106
directory
will store your CISC106 web page. In a later step in this lab, you
will create a personal web page (if you don't already have one) AND a
web page specifically for this course.
The files for your personal web page go into the directory "~/public_html", and will be accessed via the URL http://udel.edu/~userid (where userid is your UDelNet ID).
The "CISC106 web page" goes into the folder "~/public_html/cisc106", and will be accessed with the URL http://udel.edu/~userid/cisc106. You can use this same technique to create as many web pages as you like under your main web page, just by creating new files or subdirectories to store the content.
<html> <head> <title>Sara Sample's Web page</title> </head> <body> <h1>Sara Sample's Web page</h1> I had to do this <b>web page</b> for my <a href="http://www.udel.edu/CIS/106h/18F/index.html"> Honors CISC106 class</a>. Right now it is pretty minimal, but I hope to make it better later. </body> </html> |
Here's what that looks like once it is formatted by a web browser:
Sara Sample's web pageI had to do this web page for my Honors CISC106 class. Right now it is pretty minimal, but I hope to make it better later. |
chmod a+rx ~/public_html/index.html
More details: You need to repeat this chmod command each time you add new directories or files under public_html that you want users of the Web to be able to access. chmod is short for "change mode", where the "mode" of a file is the part that specifies who can edit/read/execute the file. To see file modes, use the shell command "ls -al". Directories (including public_html) need to have read/execute permission (in the 'ls -al' their mode should appear as 'drwxr-xr-x') while files can appear as read-only: '-rw-r--r--'. You have to look at a unix/linux shell and play with ls and chmod for this to make any sense.
http://udel.edu/~userid
If it
doesn't come up, make sure you set all your file permissions
correctly. The most common problem is not changing permissions
correctly. If you try that again, and it still
doesn't work, check with your TA or with a classmate for help. Be
sure to understand how to use the chmod command on both files and
directory names.
<img src="imagename.png">
, where
"imagename.png" is the (case-sensitive) name of your file. The
browser will then include the pic in your page. If the picture
doesn't show, check the file name, directory, and permissions.
Parts of this lab were borrowed from Phill Conrad and Terry Harvey with permission.