Instructional Module w50b

Web Site Setup

Background: W50a | Related modules | Module Home | Related Exercise W55h | Next reading: W54c

to Top Overview

to Top

Organizing information is the most important task in getting a Web site set up, but there are a number of technical issues that impact site design as well. This module covers some of these issues:

  • Directory trees: a way of organizing information on computers
  • How Web servers access files on a Web site
  • Mirroring a Web site in its development environment

to Top File Structures
Computer File Structures
to Top
to Top

Here are the basics:
People store an incredible number of files on computer disks! In order to organize these so they're not all jumbled together, "folders" or "directories" can be set up to put files in logical places. All computers use a hierarchical "tree" pattern for saving files in directories. (It's called a tree, but the "root" is at the top, so it's a very upside-down tree!) 

Hierarchical file structure illustrated

Every disk has a "root directory" containing files and other directories. These subdirectories may contain other files and directories.

How does this apply to the Web?
The "root" directory for a Web server is the directory in which that server starts looking for files. It doesn't have to be the root of the disk itself. For example, the Washtenaw Community College Web "root" URL is at
www.wccnet.edu
but the root directory of the Web is actually
/home/httpd/html

As you have noticed, directories and subdirectories in URLs are separated by forward-slashes / 

In addition, the directory one level up can be represented by two dots .. and the current directory by a single dot .

These dots can be used in creating links, as you can see in module W23d, "Understanding Relative and Absolute Addressing ".

 

On a Web Server

to Top
to Top

A Web server is a computer whose tasks include:

  • waiting for someone to ask for a Web file
  • hunting for the file they asked for
  • either:
    • sending the requested file, or...
    • ...sending an error message explaining why the file can't be sent.

Often, the Web server has other duties to attend to, such as email handling, and virus detection. So the server computer has a large, complex directory tree, only part of which is dedicated to the Web.

Software that handles Web services has to have some way of knowing where to start looking for Web files that people request. There are two general ways to point it in the right direction:

If the Web files are all in one place:

When the server software is installed, enter the path to the root of the Web directory. This is the case on the server for a corporation's Web site, or the WCC main Web server, www.wccnet.edu, where the path /home/httpd/html always leads to the Web files.

If the Web files are spread around the server:

People who create the Web files need to use a pre-determined name. This is the case on many Internet Service Providers' sites, where each subscriber can set up their own Web site. It is also the case on WCC's student server, where each student has their own space of Web files. Here, the predertermined name is public_html, as it is on many Web servers.

So if you plan to set up a Web site on a shared server like WCC's student server, you will need to start by creating a directory named public_html and putting all your Web files in it. Note that this must be spelled exactly right to work - including not capitalizing anything!

The directory needs to be "public" in the sense that anybody can read the information in it. The rest of your directory space on the server is "private" - only you (and the system administrators) can read the files on it.

How does the Web server software know how to reach the right part of the directory? This is determined by the URL (Web address), which usually contains a tilde ~ followed by your user code. For example, if your user code is
ssw110
and the server's name is
stu.wccnet.edu
and the file requested is
home.htm
the complete URL of your site would be
http://stu.wccnet.edu/~ssw110/home.htm

This tells the server software on stu.wccnet.edu to look for the directory belonging to user ssw110 and find the public_html directory in ssw110. (Notice that public_html is never part of the Web address!)


 
to Top Planning a Web Site
Mirroring: How it Works

to Top
to Top

In many organizations, one person is in charge of the Web site - or a specific part of it. Since you're reading this, let's assume that person is you! How should you get started with your Web site organization, and how should you maintain it once it's up and running?

A good, practical way to do this is on your own computer is called "mirroring":

Mirroring

  1. Create a subdirectory on your hard drive (or for a class, set aside a diskette, Zip disk, or memory device) which will represent your Web site. A good name to use is public_html since it is the name used on many servers.
  2. In your Web directory or diskette, create a file called home.htm. This will be your your home page, but will not be the page the Web server brings up by default. This is for learning purposes only, so your instructor can see your file structure from a Web server.
  3. If you need other subdirectories on your Web site, create them on your own disk as well. If you have many, you may find it useful to draw a diagram showing the relationships between them.
  4. When you are ready to put files on the Web, use your FTP program to create directories and subdirectories with exactly the same names as the ones on your disk - beginning at the level below your main Web directory. Then use the FTP program to transfer files from your disk to the Web server. (If you're using a service like CompuServe or AOL that doesn't give you access to the directory structure of your site, you'll have to keep it very simple: one directory for the whole site. Primitive, but it works as long as the site doesn't get too large!)
Your own files are now the "master" version of the Web site...be sure to back them up regularly! If anything goes wrong with the server, or if you need to move your site to another place, you'll have the latest files right where you need them - with you.

The advantage of using exactly the same directory names and file structures in both places is that you can create relative file links and have them work both on your own computer and on the server.

Put files in your public_html directory only when they are ready to go up on the Web. Don't put practice files, or large Photoshop or other graphics files in public_html. Instead, create a separate directory for each class or project outside public_html for files that don't go on the server.

Creating a Mirror Site

to Top
to Top
Do it!

Use Windows Explorer to create a Web structure on your own disk space. It should have:

  • A folder named public_html
  • Inside this, a folder for each class that requires you to put files on the Web.
    For example:
    inp150
    inp152

    Remember: Just Say No to Spaces in File Names!
  • Move all your existing assignment files (but not practice files) into the appropriate class folder.

 


to Top About This Document
Review Button

Click here for review questions (shared with Modules W50a and W50c).

Audience

to Top
to Top

This module is for people who are familiar with computers and the World Wide Web, and need to set up a Web site.

 

Objectives

On successful completion of this module, you will be able to:

  1. Describe the hierarchical organization of computer file systems
  2. Describe the role of the folder public_html on a Web server
  3. Discuss the principle of "mirroring" a Web site in a development environment
  4. Create a mirrored development environmentto Top
Module w50b: Web Site Setup
This document is part of a modular instruction series in Computer Instruction. For more information, see the overview or the list of modules in this series, W: World Wide Web. This document has been used in the following classes: INP 150.
History:
Original: 3 June 2004, by Laurence J. Krieg
Last modification: Monday, 31-Aug-2009 11:48:06 EDT
Copyright
Copyright © 2004, Laurence J. Krieg, Washtenaw Community College
Instructors: You may point to this file in your Web-based materials; however, its location may change without notice.
Students: You are welcome to make a copy for your personal use.
All other uses: Please contact the author, Laurence J. Krieg, for permission: krieg@ieee.org.
Background: W50a | Related modules | Module Home | Related Exercise W55h | Next reading: W54c

to Top