Constructing URLs to your server

Now that you have an http server, you'll want to reference it in your HTML documents and with your favorite Web browser.

Before you do anything, you should read this URL primer to familiarize yourself with URLs. You will want to pay attention to the section referring to HTTP URLs.


Definition

HTTP URLs have the basic form:

http://servername:port/path

servername

Your server's full hostname. It can be the server's real name or a DNS alias.

port

This is the port which your server is listening on. Specifying it in the URL is optional. If omitted, it is assumed to be 80.

If your ServerType is inetd, your port number was set in /etc/services.

If your ServerType is standalone, the Port directive set your port number.

path

This is the path to the document. This is not the absolute pathname of the document on your machine.

The server translates path as follows:

1. It looks for any defined Alias or ScriptAlias virtual names at the beginning of path. If it finds one, it replaces the virtual name with the real name and processes the request.

2. It looks for a prefix of /~, and if UserDir is not DISABLED, it will look in the user's public html subdirectory for the file.

3. It inserts DocumentRoot at the beginning of path and processes the request.


Setting up your Home Page

Some HTTP servers let you explicitly set up your home page (i.e. the page returned by the URL http://yourserver/ ).

To do this using NCSA httpd, create a DirectoryIndex file in the DocumentRoot directory.

Note that this index can be a symbolic link to another file.


Examples

My Resource Configuration file contains the following directives (among others):


DocumentRoot /u/Web
DirectoryIndex index.html
ScriptAlias /htbin /usr/local/etc/httpd/htbin
Alias /zftp /archive/ftp

An HTML document references http://hoohoo.ncsa.uiuc.edu/docs/Overview.html. The server finds no Alias or ScriptAlias virtual names in path, so it returns the file /u/Web/docs/Overview.html.

Someone references my home page as http://hoohoo.ncsa.uiuc.edu/. The server finds no virtual names, so it returns /u/Web/index.html.

Another HTML document references http://hoohoo.ncsa.uiuc.edu/htbin/uptime. The server finds the ScriptAlias /htbin at the beginning of path, and so executes the script /usr/local/etc/httpd/htbin/uptime.

Another HTML document references http://hoohoo.ncsa.uiuc.edu/zftp/README.txt. The server finds the Alias /zftp at the beginning of path, and returns the file /archive/ftp/README.txt.


Return to administration overview

httpd@ncsa.uiuc.edu