Lab environment and the first web application

advertisement
COMP 2680 Web Site Design and Development
Seminar/Lab 1.
Lab Environment
1. Objectives

Get yourselves familiar with the Linux environment that is usually used for hosting web server and web
applications.

Transfer files between computers.

Prepare directories and files so that your web applications can be browsed from other computers using web
browsers.

Your first web application.
2. Test environment
a) The web server, Apache, is running on the Ubuntu Linux system, cs.tru.ca. Your accounts are created on CS, and

you can access to CS with your account using PuTTY with port number 424.

you can WinSCP with the same port number to transfer/download/edit/manipulate(create/delete) files and
directories.
b) Here are some useful commands, when you use PuTTY:

passwd
change password

ls
list the current working directory

mkdir public_html
make a directory

chmod 711 public_html
change the access mode of a directory

chmod 644 index.html
change the access mode of a file

cd public_html
change the working directory

ls -l
list

pico index.html
text editor pico

chmod 644 index.html
change the mode

rmdir
remove directory

rm
remove file

pwd
print working directory

exit
c) Connect to cs.tru.ca using PuTTy, and change your password.
3. Your first web application
a) WinSCP might be a more convenient way to upload files to CS for all the assignments and project in this course.
b) All the web applications should be placed under ~your_user_name/public_html directory.

Your home directory should have the mode 711 (or 755) so that Apache can access the directory. You
may use ‘chmod 711 ~’.

The directory public_html under your home directory should have the mode 711 (or 755) so that Apache
can access the directory.

All the subdirectories of public_html should have the similar modes. All the web applications should have
the mode 644 (or 755) for the same reason.

On WinSCP, right mouse button -> Property -> Permission, to change the access modes.
c) Let’s write a simple web application, index.html, on Windows, and upload it to cs.tru.ca.

You can include ‘Wow! This course is interesting!’ in index.html.
<!DOCTYPE html>
<html>
<head>
</head>
<body>
Wow! This course is awesome.
</body>
</html>

Upload the file to ~your_user_name/public_html, so that you can view the document using a web browser.
The URL for your index.html is ???://???/~…/index.html. You should not include ‘public_html’.

Test if you can access the file on a web browser. If you cannot see your index.html, then check
o
The URL
o
The access modes for your index.html, public_html, and ~.
4. Assignment
a) You will be given roughly 1 assignment or 2 assignments every week to help you understand all the topics in the
lectures.
b) Submission

For this week assignment, you just need to send me the URL of the web application, not the file, in 3) by
email.

the URL of the web application, not the file itself

Please include the course number in the email title so that I can easily classify the submitted
assignment.

Due: 11:59 PM, January 13, 2015. Any late submission will not be accepted.

Total marks: 5

You should not update the application after you submitted. The information of any update of a
file/directory will be left on CS, and I can check the last update date and time.

The evaluation will be usually one of pass, half-pass, and fail. Most incomplete applications will get fail.
Download