Putting Your Page on the Web
Table of Contents
UNIX and AFS Commands for File Management
Controlling Access to Your Files
Getting the Word Out About Your Page
Restricting Access to Web Pages
Before You Begin
This document explains how to make a web page created on a desktop computer available to others by putting it on a World Wide Web server. It is intended for users who are working with individual pages--that is, pages that no one else will need to modify or work with. If you are working with group pages, please see the ITS document Putting Group Pages on the UNC Web .
You have two choices of methods for making your web page available: A) your direct access in the computer labs to your AFS web storage space or B) a secure file transfer protocol (SFTP) program like Fetch or SSH/SFTP Secure Shell. You will also learn Unix commands to manage your files. To follow these steps you should be comfortable working in either a Windows or a Macintosh environment. You should have some sense of Unix file management and understand the concepts of directories, subdirectories, and files.
UNC World Wide Web Servers
The UNC-CH World Wide Web server, known as www.unc.edu , will be referred to throughout this document to demonstrate the techniques used to make your web pages available. In order to upload your web pages onto www.unc.edu, you must have an account on isis.unc.edu (Isis), the main email server for UNC. However, www.unc.edu is not the only World Wide Web server on campus. Your school, office, or department may maintain its own server from which you can make your pages available. A list of these servers is available at http://www.unc.edu/campus/aboutweb/howto/servers.html.
Getting Started
Options for Putting Files on the Web
You have two options for making your pages available on the web:
- If you are in one of the campus computer labs, you can log into your network account and access your web space just like you would any other drive.
- If you are not in the labs but have a direct internet connection, you can use SFTP programs like SSH/SFTP Secure Shell (Windows) and Fetch (Macintosh) to upload your files from your desktop to the server.
Publishing Pages from the Labs: AFS
ITS has recently installed a new file management system called AFS that allows you easy access to your storage space on different ITS central computers such as Isis and www.unc.edu (for more information about AFS, see the ITS document Introduction to AFS . When you log into a computer in the labs, you automatically have access to your AFS space, including your public_html directory. Simply look for the H: drive and save your web pages in the public_html directory.
Transferring Your Files with SFTP
If you are not creating web pages in the computer labs and do not have direct access to your AFS space, you will need to upload your files using an SFTP program. Several SFTP programs are available for you to transfer files from one computer to another. This document will discuss Fetch (for the Macintosh) and SSH/SFTP Secure Shell (for a Windows-based PC). See the following ITS documents for more information about various FTP programs: Mac Telnet & FTP or
Preparing to Transfer your Files
Before transferring your web pages from your local computer to a World Wide Web server you will need to save your HTML files as text-only files . When you select a file to upload in Fetch, the program will give you a number of file-type options from which to choose. Upload your HTML files as Text or Wrapped Text files.
File Names in UNIX
In Windows 3.1 and DOS, you are limited to an 8 character file name with a 3 character extension. In Windows 95 and higher, you can use long filenames, including spaces. In Unix, you can use long filenames with more than a 3 character extension, but you cannot put spaces in file names. Furthermore, Unix is case-sensitive, so you might want to avoid confusion by using all lower-case letters consistently.
Graphic Files
Graphic files are handled differently from text files. In web design, you will most often be using .gif and .jpg files for images. These should always be transferred to the web server as Raw Data . If you upload a directory to the web, it should also be transferred as Raw Data .
Using SSH/SFTP Secure Shell

If you are working on a Windows-based PC on campus, you can use SSH/SFTP Secure Shell to transfer your files. Double-click the SSH Secure Shell File Transfer Client icon on your desktop to start the application. Click Quick Connect to open the Connect to Remote Host box. Type isis.unc.edu in the Host Name field, your Onyen in the User Name field, and choose Password from the Authentication Method drop-down menu. Click Connect, then click OK when the server message appears. Enter your onyen password when the Password box appears:

After you enter your password and establish a connection, you will be prompted to save the profile. If you wish to save your profile for future sessions, type a name into the popup box and press Enter:
![]()
Once you either add a profile or close the box , the SSH Secure File Transfer program window will display. The left half of the window shows the files and folders on your local computer. The right side shows the files and folders on your Isis account. Above each list are buttons for the file system. To open a folder, double-click on it; to move back up a folder level, click the
Up icon. To change to a different drive on your local computer system, type the drive letter followed by a colon into the box above the Local Name list. For example, to switch to a USB Memory Drive on Drive E:, type in E: and press Enter.
Transferring Files

To upload files, find the files on your local computer that you want to move to the server; on the remote server, open the folder you want to put files in. (You should use the public_html directory for web pages). To download files, find the files on the server and the directory you want to put them in on your hard drive. To move a file from one system to the other, right-click on it, and then click on the upload or download dialog command, depending on which direction you want to move the file. The following are other options you may find helpful:
- To create a new folder on either file system, click the
New Folder button above the appropriate system. Double-click on the new folder to open it and move files into it. - To select several files grouped together, click on one file and then Shift-click on the last file in the group. To select several files not grouped together, click on one, and then Ctrl-Click on the others. To deselect a file in a group, Ctrl-click on it.
- To delete a file or folder, right-click it, then choose Delete from the shortcut menu .
- To rename a file or folder, right-click it, then choose Rename from the shortcut menu.
- See the SSH Secure Shell for Windows manual for further instructions on the SSH/SFTP Secure Shell application.
Using Fetch
Fetch is a simple, graphic-interface FTP program for the Macintosh that you can use to transfer your files from one computer to another. You can get a copy of Fetch from the ITS Help Desk in Suite 300 of Wilson Library or by downloading it from the ITS Shareware web page at http://shareware.unc.edu . Fetch will lead you through the file transfer process step by step. Start the program by double-clicking on the Fetch icon. It will automatically open a dialog box prompting you for information about the server you want to connect to.
To connect to the email server, type isis.unc.edu in the host field. Enter your User ID (Onyen) and password in the next two fields. Type public_html in the directory field to specify the directory to which you want to transfer files. Click on the OK button once you've entered the necessary information and the Fetch program window will open, displaying the name and contents of the directory you've selected.
Upload files to the host computer by clicking on the Put File... button in the program window. When you click this button, you will be prompted to locate (on your local computer) the file that you want to transfer. Select the file, files, or directory that you want to upload and click on the Open button. In the next dialog box, you will be prompted to name the file and specify what type of file it is. If you're transferring a text file, leave the option set to Text .
If it is a graphic file or a directory, make sure Raw Data is selected from the drop-down menu. Your filenames should follow this model:
- textfile.html
- graphicfile.gif
- graphicfile.jpg
If Fetch adds an extension like .txt to your filename, erase the extension before uploading the file. Fetch will finish the transfer process when you click on the OK button.
UNIX and AFS Commands for File Management
Once you've uploaded your pages from your local system to the server, you may need to do some basic file management on the server using a few basic Unix commands. These commands include:
- cd to change directories
- ls to provide a directory listing
- ls -al to see a list of files with all file information
- |more to see the results of another command one screen at a time; e.g., ls -al |more
- mv to move or rename a file or directory
- mkdir to make a directory or subdirectory
- rm to delete a file
- pico to edit a file using a common Unix text editor
- pwd to see the name of the present working directory
- man to access help pages for a given command (for example: man rm)
- fs listacl to see permissions on a directory
Controlling Access to Your Files
File permissions are the way to keep unauthorized people from changing or deleting your files. Because you are creating only individual pages (pages that only you need access to) and saving them in public_html, the default permissions are set so that you can change and delete your files, the system administrator can change or delete your files, but everyone else can only read them. You do not need to do anything to change these permissions. To see the permissions set for a directory in AFS, telnet into Isis and change to the public_html directory (cd public_html). Then enter the following command:
You will see something similar to the following:
For more information about AFS, see the ITS document Introduction to AFS .
Editing Your Page
To edit your page you can either make the changes on your desktop computer and upload the file or use a text editor on the server.
From Your Desktop
If you keep an up-to-date copy of your web page on your computer, you will not need to download the copy from the server. Simply edit the file, upload it using the instructions above, and replace the old file with the new one. If you don't have a copy of the html file, download one from the server using one of the FTP programs, SSH/SFTP Secure Shell or Fetch. If you're working in the computer labs, you can simply open the file, edit it, and resave it in the H: drive.
On the Server
You can edit your files on the server by using a Unix text editor, such as Pico. Pico is not the only text editing program in Unix, but it is one of the easiest. (If you prefer to use another, more flexible Unix editor, ITS provides documentation for the vi Editor and the ne Editor .) To edit an existing file using the Pico editor, type the following command at the command-line prompt:
where filename is the name of the file you want to open. Pico is a simple editor to use because it offers a list of available commands at the bottom of the display screen. The commands look like this:
The "^" symbol preceding each of the characters means that you need to use the "control" key in combination with the given character to perform the indicated function. Once you've made your changes to a file, press control-X to exit the program. The program will ask you if you want to save the changes that you have made and it will prompt you for a file name to write the changes to, with the current filename as a default. When you have entered the appropriate information, your changes will be saved.
Accessing Your Page
Once you have set up your environment for creating web pages on the www.unc.edu server, uploaded your files, and set the proper permissions for those files, your web pages will be accessible via a web browser such as Netscape at the following URL:
http://www.unc.edu/~onyen/filename.html
where onyen is your Onyen on isis.unc.edu. For instance, if your Onyen is jdoe, then the URL of your pages would be:
http://www.unc.edu/~jdoe/myfile.html
Checking Your Work
You should view your page after you make changes to make sure the page looks right. Also, because different browsers present pages differently, you should view your page from several different browsers, such as Netscape Navigator, Internet Explorer, and Lynx. Checking your work on Lynx is especially important because it is a text-based browser, and if your page includes graphics it may look funny in Lynx. You can access Lynx by choosing number 4 from the email menu.
Creating an Index Page
ITS recommends that you name your main home page file index.html. When someone tries to access your directory using a web browser, the file named index.html is automatically displayed; by default, this file is a listing of the files in your directory. If, instead, you name your home page index.html, your home page is displayed and people cannot get a listing of your files. Assigning this name to your home page will also allow you to refer to your home page without specifying a file name, like this:
"http://www.unc.edu/~onyen/"
You can rename your file by typing the following command at the command-line prompt:
mv filename index.html where filename is replaced with the original name of your file.
It is not necessary for you to name your file index.html, but it will make your directory more secure. If you choose to name your file something other than index.html, it is a good idea to make index.html an alias to your home page. Simply issue the following command at the command-line prompt:
and replace filename with the name you've chosen for your file.
Getting the Word Out About Your Page
Once you have your page on a server, you're ready to let the world know about it. You can use the low-tech word-of-mouth method, and you can also use web resources to get the word out. Take a look at the How to Announce Your New Web Site page at http://www.epage.com/faq/webannounce.html .
Restricting Access to Web Pages
Both institutional and personal web pages at UNC-CH are available to anyone with a browser and a connection to the Internet. In certain circumstances, though, you may want to restrict access to some of your web pages. For example, an instructor may want to password-protect certain original course materials. Students may want to password-protect online projects so that only peers and an instructor can access the page. NOTE: Password-protection functions at the directory level. You cannot password-protect individual files unless you create a separate directory for an individual page.
How to Restrict a Page
Log onto your Isis account, and choose 6. Exit this menu temporarily to a command prompt (ksh) from the menu. This will put you at the command prompt. Change to your public_html directory ( cd public_html ) and then change into the directory or sub-directory you wish to protect ( cd directoryname ). Type protect and press Enter.
You will now be running a program that will protect your files, and you need to answer some questions. Choose 1. Add password protection to restrict access, then double-check to be sure you are restricting the correct directory. If so, press y to continue, and then you will be asked to designate a userID and password for users of the page. Do not use your Isis Onyen; instead, make up a new userID, such as english12, and a new password.
How to Remove Restriction from a Page
Follow the above steps to get into the directory. Run the protect program again; this time choose 2) Remove password protection .
Potential Errors
Several things can go wrong when you upload your pages, though most of them are not very serious. Below are several of the most common errors associated with uploading web pages.
404 Not Found
If you get this message, it means your browser cannot locate the file. You may have typed the URL incorrectly, you may have failed to upload the file, or you may have a problem with the file name.
Strange Characters on the Page
Sometimes a page loads with a bunch of funny characters in it, like ^H , ^M , and boxes. These characters indicate that the file is not plain text. To solve the problem, re-save the file as Text Only and upload it again.
Icons Where Graphics Should Be
If small icons appear where your graphics should be, the graphics files referred to in the page are either not available, not saved in the correct format, or damaged. If you see an icon with a question mark, make sure the graphics files are in the proper directory and have the correct permissions.
If you see an icon with an image of a broken file, then Netscape has found the file but does not recognize it as the kind of file it reads. Check to be sure the files are saved in .gif or .jpg format and that they were uploaded as Raw Data.
Summary of Steps
- Create a public_html directory on www.unc.edu by going to the ITS home page at http://help.unc.edu , choosing Create/Manage Your Onyen , and setting up your personal web space.
- Save web page as Text Only with a .html extension and graphics files as .gif or .jpg .
- Transfer your files by using Fetch or SSH/SFTP Secure Shell, or by saving your files to the public_html directory on the H: drive in the computer labs.
- Open the URL http://www.unc.edu/~jdoe to check the page.


