CNS DOCWEB Home
CNS Home Page
CNS Publications Page
Search All CNS Docs

DOCWEB Logo PDF Available

Putting Your World Wide Web Pages on CNS

CNS Document ID: D0122
Last Updated: 10/10/2002

Abstract

This document describes how you can use CNS as a Web server to make your documents available on the Web. It assumes you have some familiarity with the World Wide Web.

If you have an account at CNS that can be used to log in to CNS's NERSP system, you can store your files on CNS so they can be viewed from anywhere on the Internet (WWW).

The NERSP system also provides facilities for users to implement their own Common Gateway Interface (CGI) programs, and image maps.


UF Computing & Networking Services
112 Bryant Space Sciences Bldg, University of Florida
P.O. Box 112050
Gainesville Florida  32611-2050
(352) 392.2061

Table of Contents

Introduction
About the World Wide Web
World Wide Web Browsers
Using CNS to Make Your Documents Available on the Web
Using the Web Server on NERSP
Testing Your Documents on NERSP
Advanced Topics
Writing CGI Programs on NERSP for Processing Web Browser Input
Applets
Image Maps
Obtaining "Hit" Counts for Your CNS WWW Page
Security: Restricting Access to your Web Pages
Other Information Sources
Questions

Introduction

If you have an account at CNS that can be used to log in to CNS's NERSP (UNIX) system, you can store files on NERSP so they can be viewed from anywhere on the Internet, as a part of the "World Wide Web." You can also create CGI (Common Gateway Interface) programs on NERSP to process any data received if your documents ask for input. The NERSP server also supports image maps--images with various "clickable" zones which act as hyperlinks.

About the World Wide Web

The World Wide Web is a way to obtain information that is on the Internet. Information on the World Wide Web is organized into documents, often called "pages," that can contain formatted text and graphics, similar to magazine pages. Additionally, documents can include sound and video capabilities, and references (called "links") to other documents. Documents usually are grouped by a common subject, such as information about you, your department, your college, or some other common denominator. The information (text, graphics, sound, etc.) is stored in one or more files on a computer that is connected to the Internet.

World Wide Web Browsers

World Wide Web documents must be viewed using a World Wide Web browser. A Web browser is a program that requests documents over the Internet from Web servers. A Web server is simply a network-connected computer where documents are stored, and which runs software which recognizes and responds to requests from Web browsers.

Web documents are located using a special type of address called a Uniform Resource Locator (URL). Web browsers use the unique URL to find a specific document. Most URLs start with the characters http:// . These characters signal the beginning of a World Wide Web "address," or URL.

Web browsers are available for personal computers and for the CNS platforms. Popular browsers for both IBM-compatible and Macintosh personal computers include Microsoft's Internet Explorer and Netscape's browser. Netscape's browser is also available for UNIX workstations. CNS supplies the "lynx" browser on its NERSP system.

Using CNS to Make Your Documents Available on the Web

This section assumes you already have a document to place on the World Wide Web or that you know how to create one. See the section below on "Other Information Sources" if you need additional documentation about creating Web documents.

Using the Web Server on NERSP

This section assumes basic familiarity with using UNIX, the operating system which runs on the NERSP computer. If you would like an introduction to UNIX systems at CNS, please refer to the CNS document D0107, CNS UNIX 101: An Introduction to NERSP (available on the Web via DOCWEB , or as a hard-copy booklet from CNS Information Services [112 Bryant SSRB, 352-392-2061]).

To set up space for your Web pages on NERSP;

First, log on to nersp.cns.ufl.edu.

Next, enter the command: cd

This ensures that you are in your "home directory."

In your home directory on NERSP, create a subdirectory named public_html by using the command, mkdir public_html

Move the documents that you want to make available to the World Wide Web into your public_html subdirectory.

You can do this by using the cp command to copy them from another NERSP directory, or you can use ftp to move them from your PC or other computer. As mentioned earlier, this document assumes some familiarity with the UNIX operating system. If you need assistance, refer to CNS document D0107, CNS UNIX 101: An Introduction to NERSP, or contact the UF Computing Help Desk (352-392-HELP, helpdesk@ufl.edu).

When you add new documents to your public_html subdirectory, be sure to give everyone access to them by using the command

chmod -R o+rX public_html

By convention, your home page document should be named index.html, and it would typically contain hypertext links to the other documents in your public_html subdirectory, and possibly links to other documents around the Web. Your home page (index.html) on NERSP can then be viewed by any World Wide Web user who opens the URL:

http://nersp.cns.ufl.edu/~userid

...where "~userid" is a tilde character followed by your CNS userid (with no spaces). For example, if your userid is sally, your home page on NERSP would have the URL

http://nersp.cns.ufl.edu/~sally

Web users can also view your other documents directly, bypassing your home page, by opening URLs like the following:

http://nersp.cns.ufl.edu/~userid/filename.type

...where "filename.type" matches any filename in your public_html subdirectory. For example, to view a plain text copy of sally's resume that is in a file named resume.txt, one would open the URL:

http://nersp.cns.ufl.edu/~sally/resume.txt

Remember, the documents MUST be in your public_html subdirectory in order to be accessible by other users. Conversely, files that are NOT in your public_html subdirectory remain private.

Testing Your Documents on NERSP

You might want to test your home page and other documents you create on NERSP before you move them to your public_html subdirectory. You can do this by using the lynx command as follows:

lynx filename.filetype

...where filename.filetype is the name of a file in the current directory. Lynx is a text-only browser, and so will not show you any images which you may have linked into your page.

Advanced Topics

The information in these "advanced" sections presumes a familiarity with the UNIX operating system, and with programming in general.

Writing CGI Programs on NERSP for Processing Web Browser Input

The HTML markup language supports "form" tags which can be used to prompt the viewer for input. When someone views a document which includes a "form" and fills in one or more of the input fields, the data is transmitted back to the Web server where a specially-coded program associated with that HTML document processes the received data. The standardized interface between the Web server and these special programs is called the Common Gateway Interface, or CGI. Programs which process input from a Web browser are generally referred to as CGI programs.

CGI programs can be written in most languages available on CNS's NERSP UNIX system, including the Bourne-derived shells (bsh, ksh, bash), C-shell, Perl, and even C. For detailed information regarding using CGI programs on NERSP, see CNS document D0121, CGI Programs on NERSP.

Applets

Applets for the Web can be written in Java and stored on the NERSP system. The path to the Java compiler on NERSP is /usr/java130/bin/javac. Other relevent files may be found beginning in /usr/java130. Documentation about Java can be found at:

http://www.javasoft.com/.

Image Maps

NERSP also supports image maps, also known as clickable images. Image maps are a way to allow viewers of your Web document to link to other documents by clicking on different sections of a graphical image. The image might be a geographical map or a "tool bar" of icons. (Of course this only works if the viewer is using a graphical Web browser such as the Netscape browser or Internet Explorer by Microsoft.)

To use image maps in your Web documents on NERSP, you must:

  1. Create a graphical image in GIF format. Use your favorite Windows, MacOS, OS/2, or X-windows image editing tool on your graphical workstation. The resulting image must be in GIF format. Transfer this GIF file (in "binary" mode) to your public_html directory on NERSP.

  2. Create an "imagemap" configuration file which maps rectangles, circles, and polygons within your GIF image into URLs.

Use one of the several tools available for Windows, MacOS, and X-windows. A list of such tools is located on the Web at Webreference.com . Your "map" file can be in the NCSA format or the CERN format. (We recommend creating new imagemaps in NCSA format).

The URLs within imagemap files can be partial (or "relative") URLs when refering to your own documents or CGI programs on NERSP, in which case the partial URLs must be of the form

/~username/file

or

/~username/cgi-bin/file (if you prefer to store your CGI programs in a separate "cgi-bin" directory)

Replace "username" with your username, file with the name of a document, or with the name of your own CGI program.

Transfer (in "text" or "ASCII" mode) the imagemap file you just created to your public_html directory on NERSP.

3. Write HTML which references the appropriate CNS-supplied CGI program which will use your imagemap file to convert coordinates to URLs.

You must use an HTML <A HREF=> tag to refer to the appropriate CGI "mapper" program: <A HREF="/cgi-bin/MAPPER/~username/filename.imagemap">

where "MAPPER" is either imagemap for NCSA-format imagemap files, or htimage for CERN-format imagemap files.

This HTML "anchor" construction should be followed by the URL for your image file. Your image file URL must include the ISMAP tag, to indicate to the browser/client that this is a "clickable" image. The </A> tag indicating the end of the "anchor" should follow the URL for your image.

For example, let's say user "alberta" has created an image named toolbar.gif and a corresponding NCSA-format imagemap file named toolbar.imagemap, both stored in her public_html directory on NERSP. She could then enable that toolbar in her index.html file by using the tags

<A HREF="/cgi-bin/imagemap/~alberta/toolbar.imagemap">

<IMG SRC="/~alberta/toolbar.gif" ISMAP></A>

Note the ISMAP attribute of the <IMG> tag: it tells browser programs that this is an image map.

For more information about image maps, see the NCSA image map tutorial at http://hoohoo.ncsa.uiuc.edu/docs-1.4/tutorials/imagemapping.html.

Obtaining "Hit" Counts for Your CNS WWW Page

For Web pages stored on the NERSP, you can use a one-line command, issued at the NERSP command-prompt, to scan the Web-server logs. For more information about obtaining "hit" counts, please see CNS document D0130, Obtaining "Hit" Counts for Your CNS WWW Page.

Security: Restricting Access to your Web Pages

NERSP's Web server provides a facility to allow you to restrict access to your Web pages; either via userid/password challenge, or IP address exclusion, or combinations of the two. This security facility is invoked automatically by the presence of a file named .htaccess in the directory to be secured. You must create this file and place it into the directory you wish to be password-protected. For detailed information and instructions on how to do this, see CNS document D0123, Controlling and Restricting Access to Web Pages on NERSP.

Other Information Sources

If you are placing official information about your department or agency on the World Wide Web, please refer to your agency's publication standards and guidelines.

Note: URLs that contain both capitalized and lower case letters must by typed as shown; these are case-sensitive.

For more information about the University of Florida Acceptable Use Policy (AUP), see: http://www.it.ufl.edu/aupolicy.html

For more information about URLs, see: http://www.w3.org/hypertext/WWW/Addressing/Addressing.html

For more information about creating documents in HTML format, see: http://www.ncsa.uiuc.edu/General/Internet/WWW/HTMLPrimer.html

For ideas on document style, open the URL: http://www.w3.org/hypertext/WWW/Provider/Style/Overview.html

For more information about the Common Gateway Interface (CGI), see: http://hoohoo.ncsa.uiuc.edu/cgi/overview.html

For more information about the cgiparse and cgiutils helper programs, see: http://www.w3.org/Daemon/User/CGI/cgiparse.htmlhttp://www.w3.org/hypertext/WWW/Daemon/User/CGI/cgiutils.html

For more information regarding .htaccess and securing your Web files, see: http://hoohoo.ncsa.uiuc.edu/docs/tutorials/user.html

Questions

If you have questions about using CNS as a Web server for your documents, please call the CNS Support Desk at (352) 392-2061 or send e-mail to consult@lists.ufl.edu. If you need help with software to access the World Wide Web or have questions about using HTML, please call the UF Computing Help Desk at (352) 392-HELP or send e-mail to helpdesk@ufl.edu.

Your Comments are Welcome

We welcome your comments and suggestions on this and all CNS documentation. Please send your comments to:

UF Computing & Networking Services

112 Bryant Space Sciences Bldg, University of Florida
P.O. Box 112050
Gainesville, Florida 32611-2050

Phone: (352) 392.2061
E-mail: editor@cns.ufl.edu

CNS DOCWEB Home
CNS Home Page
CNS Publications Page
Search All CNS Docs