This page has been accessed times.
This file contains the answers to questions I get asked most often. If there's something you'd like to see covered, let me know.
If you find this info helpful, kindly drop me a line and let me know; I really enjoy getting feedback (both good and not so good)!
Max H. Parke
Lodi, New York
<mhp@lightlink.com>
(Example URL: http://www.lightlink.com/cgi-bin/imagemap...)
Lightlink has a system-wide cgi-bin directory where common cgi's such as the imagemap and Web page traffic counter programs reside; you don't need to do anything other than point to these in your HTML files to use them.
In my own work I don't like to use cgi-bin directories since I usually have several unrelated projects and would rather have the cgi's in separate directories. Using cgi-bin also causes certain conflicts with the Web server software.
The other way to identify CGI's is to have a filename suffix of `.cgi' on your CGI scripts. (Example: /home/www/username/foo/foobar.cgi)
Options ExecCGI FollowSymLinks
(Note: the FollowSymLinks is needed in your home Web directory to allow index.html to work properly).
The .htaccess file must be readable by the Web server (Example: chmod 604 /home/www/username/foo/.htaccess)
The directories themselves must be readable, too. (Example: chmod 701 /home/www/username/foo)
Options ExecCGI AuthType Basic AuthName SAMPLE PROTECTED DOCUMENT AuthUserFile /home/www/username/xxxdemo/.htpasswd AuthGroupFile /home/www/username/xxxdemo/.htgroup <Limit GET> require valid-user </Limit>
sample:5aa4g6lgnXyEs
mhpgroup: mhpNotes: the .htgroup file is not really used or needed in this example; also the files must be readable (see Q4 above). To create and maintain the .htpasswd file, you must use the htpasswd program, which is installed at Lightlink.
Click here for more information.
Content-type: text/html4) The CGI must be identified as such to the Web server; either by placing it in a `cgi-bin' directory, or having as the last four characters of its file name `.cgi' (the preferred way).
First, you start with a URL such as the following in your HTML file:
<A HREF="http://www.lightlink.com/cgi-bin/imagemap/username/fish/fishmap.txt"> <IMG SRC="xxx.gif" ISMAP>
^
|
|
The URL gets "split" into two parts as shown. The first
part causes the imagemap program to be run; the
second part identifies the file name of the image mapping text file which
you must create. The Web server automatically prepends /home/www/
to this, for a resulting filename of (in this example):
/home/www/username/fish/fishmap.txt(Note that in Lightlink, /home/www/username/ is actually an alias to /home/ftp/pub/username/www)
Finally, the imagemap program at the Web server reads the fishmap.txt file, and decides what to do based on where the mouse click occurred. An excerpt from fishmap.txt:
default /username/fish/none.html # Top fish eye circle /username/fish/ow.html 313,28 313,44Again, the Web server adds /home/www to the beginning of the file name corresponding to the mouse click. If the user clicked on the fisheye, the resulting
/home/www/username/fish/ow.htmlwould be displayed.
Note: The imagemap.conf file that appears in the tutorial's distribution is an old file that's not used.
http://www.lightlink.com/username/foo/foobar.cgiwill look for the CGI script in:
/home/www/username/foo/foobar.cgiwhich is actually an alias of:
/home/ftp/pub/username/www/foo/foobar.cgi
SSI is enabled by using a filename suffix of .shtml
instead of the usual .html suffix on ordinary html
files. Also, you must add the Includes directive to your
.htaccess file, for example:
Options Indexes FollowSymLinks Includes ExecCGI AddType text/html .shtml AddHandler server-parsed .shtml XBitHack full
This example .htaccess file will instruct the Web server to parse all documents which have a file name suffix of ``.shtml''.
Since using SSI increases server overhead, you should use it sparingly.
If you want your index.html file to be parsed automatically, so that your home page can take advantage of SSI features, use the following trick which came to us courtesy of one of our users. I haven't used this myself, but I have heard from more than one customer who has had success with it. Rather than trying to name your home page index.shtml, this trick works by changing the default for the entire directory to be parsed html.
You need to modify the .htaccess file in the directory containing the index.html file to be parsed as follows:
Options Indexes FollowSymLinks Includes ExecCGI AddType text/html .html AddHandler server-parsed .html XBitHack fullEvery .html file in that directory will be parsed.
You'll also need to change the permission to that of an executable file:
chmod 705 index.html