r10 - 28 Aug 2006 - 19:04:12 - PaulBeebeYou are here: TWiki >  CSDocs Web  > WebServerFAQs

The Web Server

How Can I Get Started On The Web?

To publish a web page on the Computer Science Department webserver, go through the following steps. This should take about 30 minutes.

TIP Note: The term Home Page has come to mean two different things. Some people refer to a page that describes a person or institution as its "Home Page." Others think a "Home Page" is a page you create for your own use that contains a list of links to the sites you visit frequently. The page you are creating is of the first type.

What you should have in front of you

Chances are you have probably completed most of this step already. This document assumes you are logged into the console of a UNIX or NT workstation in the CS department, and that you are running Mozilla, Netscape or Internet Explorer to view this page. If you are using some other browser or you aren't logged into a CS computer, some of the instructions below won't work and might not make sense, and you will have to move or be prepared to improvise.

You will probably want to read both this document and the page you are editing at the same time. To make that easier, create a second browser window:
  • In Mozilla: File New | Navigator Window
  • In Netscape: File | Navigator Window
  • In Internet Explorer: File⇒New Window

In addition to a browser, you should have a window with a shell available because you will be typing a few commands. Finally, you should have your favorite text editor in a fourth window. This document doesn't assume any HTML-specific editor modes; you will be editing the file directly. Make sure you can switch between the windows easily.

Create your public WWW directory
If you have never put a document on the web, you will need to create your publicly accessible WWW directory.

On UNIX systems:

Execute the following command in your shell:
% mkdir ~/public/html

On Windows NT systems:

Create a directory called:
U:\public\html

This directory is where you will keep all of your web documents. It has a special place in the namespace of our web server.

Copy the sample home page

On UNIX systems:

Execute the following command:
% cp /common/www/home-sample.html ~/public/html/index.html

On Windows NT systems:

In your GUI, drag and drop the file W:\common\www\home-sample.html to U:\public\html and rename it to index.html

This file contains a WWW page for you to personalize.

TIP You can copy and personalize a page that looks like the default C.S. Department pages using these instructions.

Edit the file

Edit the file you just created. What you do to do this depends on the editor you are using. The first few lines of the file look like this:

        <HTML>
        <HEAD>
        <TITLE>Felix's Home Page</TITLE>
        <HEAD>
        <BODY>

Don't change anything yet.

View the document in Mozilla/Netscape/Internet Explorer

In the other Mozilla/Netscape/Internet Explorer window you created, choose File | Open... from the menu (File | Open File... in Mozilla). A dialog box with a text field and some buttons will appear. If there is anything in the text field, press the Clear button. Now type
http://www.cs.wisc.edu/~<username>/
in the text field.

In the other browser window, you should now see your page. If you didn't name your page index.html, there should be a short list of directories and files, one of which is your page. Just as the string ~<username>/public/html or U:\public\html is a complete path in the filesystem pointing to your web directory, the URL http://www.cs.wisc.edu/~<username>/ is a complete path to that same directory in the web namespace.

Examine the file

Take a look at the file in your text editor to get a general idea of the format of an HTML document. Bear in mind that tabs, space, and newlines seperate words, but otherwise do not matter to the finished product. Any combination of "whitespace" is treated as a single space. While there is a blank line between paragraphs in the sample file, it is the <P> tags that cause space to be included in the output. HTML is too big a topic to cover here. We will only discuss the <TITLE> and <BODY> tags.

Edit the title

The third line of the sample page looks like this: <TITLE>Felix's Home Page</TITLE>

If you look at the top of the browser window, you'll see that the string in the <TITLE> container is displayed there. Different browsers use the title in different ways. The title should be short and summarize the contents of the document. In this case, you can replace Felix with your own name.

After you have made this change, save the file without exiting your editor and press the Reload button in your other browser window. The new title should appear. From now on, whenever you make changes to the file, you can save it in your editor and reload it into your browser to see the result.

Edit the body.

The body is everything between the <BODY> and =</BODY> tags. The body is where you put your text, entities, and most of the elements. The sample file has a number of elemenst you might want to use in your own page.

As you look at the sample page in your editor and in your web browser, it should become clear what the different elements do in whatever browser you are using right now. Different browsers have different interpretations of the tags. That's important, so I'll say it again:

TIP Note: Different browsers have different interpretations of the tags. Things will look different if you move between browsers

Here's a list of the different tags, and common interpretations of them.

<STRONG>
Makes the text "stronger". Often, this means bold.
<EM>
Emphasized text. Often, this means italic text.
<H1>
Creates a first-level section heading.
<P>
Separates paragraphs.
<UL>
Creates an unordered (bulleted) list
<LI>
Creates a list item within a list container (like <UL>).
<A>
Creates a link to another document
<IMG>
Includes a picture

There are a number of elements not included in the sample document. Here are some of the more common ones.

<H2> through <H6>
These work exactly like <H1>, but create progressivly lower-level headings, for subsections, subsubsections, etc.
<OL>
Works like <UL>, but creates an ordered (numbered) list
<HR>
Creates a horizontal rule
<BR>
Creates a line break

Two of the included tags, <A> and <IMG>, had attributes. The <A> container was used to create a link to another document, which was specified by the HREF="/cgi-bin/finger?charlesm" attribute. In this case, that document is a script which fingers a user (charlesm) and creates a document with the result. Note that the path (URL) to the document starts with a /. When you link from one document to another in the Web, you can refer to the new location relative to the current one. In this case, we could omit the http://www.cs.wisc.edu because both documents are on the same server.

The <IMG> tag, as we said before, is used to include a picture. The picture should be either a JPEG or GIF file. the SRC attribute is used to specify the location of the picture. The filenames of JPEG files must end end in either .jpeg or .jpg and GIF filenames must end in the extension .gif. If you had a GIF file called me.gif and you wanted to include it in your document, you could put it in the same directory withat the document is located, and use the tag <IMG SRC="me.gif" ALT="A picture of me!">. The ALT attribute specifies a string to be printed if a browser cannot display pictures.

Now that you know what the elements do, you should figure out what you want to say (the hard part), and then use the tags and text to create "look" you want. Remember that, although you can preview what you create in your web browser as you go along, the "look" in Mozilla or Netscape may not be the "look" in a different browser.

Read more

The following are some links to other sites, with more comprehensive HTML tutorials, references, and validators.

How Do I Get Statistics For My Web Pages?

Users on departmental computers can receive weekly statistics outlining how many times their World Wide Web pages were accessed and what other pages on the web contain links to theirs.

To receive a statistics report, a file called .statinfo should be created in your WWW directory.

On UNIX systems:

~/public/html/.statinfo

On Windows NT systems:

U:\public\html\.statinfo

For projects that have their own aliases in the server's configuration files, put the .statinfo files in the directory pointed to by the alias. A .statinfo file will also work in internal directories, such as ~/public/html/test/.statinfo.

The .statinfo file should contain a list of addresses, one per line, to whom the statistics should be mailed. This is similar to a .forward file, except that the address must be valid internet mailing address, not a program or file. The statistics will be set to each person on the list every Friday night, shortly after midnight.

The statistics file will look something like this:


From: CS Web Stats <www-user@cs.wisc.edu>
Date: Wed, 26 Jul 95 05:08:46 -0500
To: keeper@lighthouse.caltech.edu
Subject: WWW Page Statistics (www.cs.wisc.edu)

The following is a list of relative World Wide Web URLs for files 
accessed in the past week and located under the directory

/u/k/e/keeper/public/html

Each URL is followed on the same line by the number of hits it received 
in the past week.  If the information is available, an indented list of 
pages which contain links to the URL appears below it.

/~keeper (3 hits):
  http://www.washington.edu:1183/ (2)

/~keeper/home-sample.html (1 hit):
  http://www.cs.wisc.edu/~bryan/index.hafh.html (1)

/~keeper/installs.html (3 hits):
  http://www.cs.wisc.edu/~keeper/keeper.html (1)

/~keeper/keeper.html (10 hits):
  http://www.cs.wisc.edu/~bryan/index.hafh.html (1)
  http://www.cs.wisc.edu/csl/lab-staff.html (1)
  http://www.caltech.edu/people/www.html (1)

/~keeper/nopu.html (1 hit)

/~keeper/pictures/felix.gif (20 hits):
  http://www.cs.wisc.edu/~samuela/samuela.html (3)
  http://www.cs.wisc.edu/~pmd/pmd.html (2)
  http://www.cs.wisc.edu/~masse/masse.html (1)
  http://www.cs.wisc.edu/~brey/brey.html (4)
  http://www.cs.wisc.edu/~sbennett/sbennett.html (3)
  http://www.cs.wisc.edu/~kuong/kuong.html (2)
  http://www.cs.wisc.edu/~bryan/index.hafh.html (1)
  http://www.cs.wisc.edu/~fisch/sample.html (1)


Note that the list of references includes the links from your own documents. This is intentional. Also note that adding up the hits on all the reference links will often yield a lower number than the total hit count of a page. This is because not all browsers send the URL for the refering page (referring links are a new feature of the HTTP protocol). Some referring pages may not contain links to the listed page. This can happen if the maintainer of the referring page removes the link, or more commonly if a user chose "Open" and entered the URL for your page while the referring page was loaded into their browser.

Please be careful not to overstate the importance of these numbers. If you wish to measure the success of your pages, the number of pages linking to it is probably a much better metric than the hit count. Remember, you get the hit before a user has even read the page.

TIP Note: Statistics reports like this will NOT inform you of who was actually downloading the files from your site. You may want to consider making your files available via FTP instead if you need individual download records.

How Is The Web Server Performing Right Now?

Current statistics on all the CS web servers are recorded by Cricket. To view them, go to the webserver section of the Cricket tree.

What Web Server Software Are We Using?

The computer sciences department uses the Apache web server.

See Also:

Where Do I Put My Web Pages?

User web pages go in a special directory in your public directory.

On UNIX systems:

~/public/html

On Windows NT systems:

U:\public\html

The web server maps this directory to http://www.cs.wisc.edu/~<'username>/ (where <username> is, of course, your username) If the html directory does not exist in your public directory, create it, and the web server will look there for your web pages.

See Also:

How Do I Get My Page Linked Into The CS Web Directories.

Directories of Computer Sciences Faculty and Research Staff, Administrative Staff, Graduate Students, Undergraduate Majors and All users with homepages are automatically generated. Links are created for every user with a filename that can be accessed by the URLs http://www.cs.wisc.edu/~<username>/<username>.html or http://www.cs.wisc.edu/~<username>/

How Can I Use Include Common HTML Code In Multiple HTML Documents?

You can use the <--#include="file" --> directive in an HTML file to include HTML contents from another file available on the web server. When using such include directives you must make sure the document containing the #include directive must have one of the following traits for the #include directive to be processed:

  • HTML file must end with a .shtml suffix
  • UNIX "execute" bit must be set (using chmod +x)

NOTE: using ~/username constructs in #include directives is expanded to ~username/public/html in the filesystem, much like URLs are translated (as discussed above).

How Can I Use Department Header Templates In My HTML Documents?

NOTE: Department web page headers are NOT maintained by the Computer Systems Lab. Improvement suggestions or bug reports with those templates should be directed to the publications committee at pubs@cs.wisc.edu

(The following paths were verified as of January 12, 2006.)

You can use the department by adding the following directives to your HTML document:

text use
<!--#include virtual="/includes/dept.head.html" --> UW copyright information and <HTML> tag
<TITLE>your_document_title_here</TITLE> Document title
<!--#include virtual="/includes/dept.headfinish.html" --> Department web page banner
&gt; breadcrumb1 [ &gt; breakcrumb2 ... ] "Breadcrumb" links in red banner bar
<!--#include virtual="/includes/dept.sidebar.html" --> Sidebar contents
<!--#include virtual="/includes/dept.end.html" --> trailer links at bottom of the page

Depending on your usage, you may want to make a copy of these HTML files, located in /s/www/html/includes, to add additional links to those headers for your personal/project/class web pages.

How Can I Use CGI Programs?

CGI scripts are able to run out of your html directory (~/public/html) via www.cs.wisc.edu. See the following for more information:

Can I Use The SSL Server?

https://www.cs.wisc.edu is the SSL version of http://www.cs.wisc.edu. Your personal secure web pages are stored in ~/public/html-s and can be viewed on the web at https://www.cs.wisc.edu/~username.

Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r10 < r9 < r8 < r7 < r6 | More topic actions
 
CSL Home
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback