|
Web Server Directory Mapping
|
|
This page helps you find where to put HTML pages and CGI scripts
and how to figure out their address on the web server.
But first, let's review some basics.
The web page address a user enters into a browser
is called a Universal Resource Locator, better known as a URL.
Web pages are files stored on the server's harddrive just like any other file.
You may know that you don't need a web server to view a page.
You can enter the file's path on the harddrive into the browser's address box instead.
Your web server has a directory structure that is just a subdirectory of a drive.
The web server directories start at what's called the document root (or default directory).
This is where you put your home page.
You can put other HTML pages and subdirectories there as well.
Those subdirectories are what make up your web server's directory structure.
In order for a URL to point to a page in a subdirectory,
it must include the name of that subdirectory.
This relationship between directories and URLs is called a mapping.
The mapping to your web server's document root gets set for you when you install the web server.
The problem is that the document root is different for every web server.
The document root is not the only mapping.
The one most important to us is the Standard CGI directory.
This is where CGI scripts go.
Once you find this directory,
you still have to figure out how to point your browser at it
(with the help of this page of course).
|
Where to Put Pages and Scripts
The following table helps you find
both the document root and Standard CGI directories
for some common web servers.
If your web server is not listed,
the directories are probably similar.
So give them a try.
If these directories do not work,
then you will have to refer to your web server's documentation and other resources.
Even if you have one of the servers listed, the mappings may have been altered.
And, in the case of Netscape FastTrack, installation does not set a mapping
for the Standard CGI directory by default.
This means you have to make the mapping yourself.
The table also includes a CGI Directory Mapping column.
This is used later when we build URLs.
|
Default Web Server Paths
|
Document Root |
CGI Directory |
CGI Directory Mapping |
| Netscape FastTrack |
C:\Netscape \Server \docs |
could be C:\Netscape \Server \cgi-bin |
could be cgi-bin |
| Microsoft Internet Information Server (IIS) |
C:\InetPub \Wwwroot |
C:\InetPub \Scripts |
Scripts |
| Microsoft Personal Web Server |
C:\Webshare \Wwwroot |
C:\Webshare \Scripts |
Scripts |
| O'Reilly Website |
C:\Website \htdocs |
C:\Website \cgi-shl |
cgi-shl |
|
How to Point a Browser to Pages and Scripts
After all that, you should know where to put your HTML pages and CGI scripts.
Next, you need to point your browser at them.
To do that, you need to figure out their URLs.
A URL consists of three parts.
- Host Name -
The host name usually looks like "www.domain.com"
or "127.0.0.1".
Ways to find your host name are discussed further below.
- Mapping -
The URL for an HTML page in the Document Root
is just a host name and a path.
It does not include a mapping.
A mapping is needed for CGI scripts.
The Standard CGI directory mapping can be found
for some common web servers in the table above.
As you can see,
it is usually just the name of the Standard CGI directory.
- Path -
Path is just the name of the project's sub directory
and the file name.
Put these together in this format.
http://HostName/Mapping/Path
You should end up with a URL that looks something like this.
http://127.0.0.1/cgi-bin/mydir/myscript.exe
And that's just what you enter in your browser.
|
How to Find a Host Name
If you can visit your web server's home page,
then you can see the Host Name
in the URL you enter at the top of your browser.
The Host Name follows http://
and ends at the next slash (/).
If that does not work, try one of the following solutions.
They are in order from best to worst.
- If your web server is provided by a web hosting company,
then anyone in the world can visit your site
by entering a host name that looks like "www.domain.com".
The web host's technical support will help you find your host name.
- If your web server is on a networked PC,
then anyone in the company can visit by using the Computer Name as the host name.
Read the instructions on
How to find a PC's Computer Name or IP Address.
- If the Computer Name does not work for other employees,
try the PC's IP address as the host name as described in
How to find a PC's Computer Name or IP Address.
- If the browser is on the same PC as the web server,
try using "localhost" as the host name.
- If localhost does not work from the web server PC,
try using "127.0.0.1" as the host name.
This is called the Loop Back IP address.
If that does not work and you have an ISP you can dial out to,
dial out and try it again. Once it works,
you might be able to disconnect and continue to use this host name.
|

|
|
|