Helpful Information
 
 
Category: Perl/ CGI
Help with links script going crazy!!!

Hi,

I downloaded a links cgi program.... I got everything set up on the page, but when I went to test it I got an access denied error....


Here is the readme

Hello. These are the instructions for how to install the Free Links Script.
You should have the following files...

* links.cgi ---- the script that runs the links page
* links.html --- the html file for the links page
* readme.txt --- the file you're reading now

If you're missing any of these files, you can download them from
http://www.shavenferret.com/scripts/links

******************************************************************************
* Installation
******************************************************************************

First of all, open links.cgi in a text editor. If perl is not located
at /usr/bin/perl on your system, change the first line of it to #! and then
the location of perl. If you don't know where perl is, ask your system
administrator, or telnet in and type "whereis perl" at the command prompt.
Scroll down to line 25. If you aren't planning on creating the data directory
in the same directory as the script, change "data" to the server path (not the
URL) to the the data directory. Do not include a trailing slash. Now scroll
down to line 28. Enter the server path (not the URL) to links.html. Scroll
down to line 31 and enter the full URL of links.html. Scroll down to line 34
and enter the URL of links.cgi. Scroll down to line 37, and enter the path
to your mail program. This should actually be okay on most unix systems.

If links.cgi cannot be found at /cgi-bin/links.cgi, open links.html in a text
editor and replace the text /cgi-bin/links.cgi with the URL of links.cgi.

Now upload both files (as ascii, not binary) and create the data directory.
Set links.cgi's permissions to 755, links.html's permissions to 777, and the
data directory's permissions to 773 (if this doesn't work on your system, try
setting links.html's and the data directory's permissions to 777).

Congratulations, your done setting up the script! The last step is to
activate it. To do this, simply go to the uploaded links.html page, enter
"shavenferret.com" in the form at the bottom of the screen, and click the
button.

******************************************************************************
* Troubleshooting
* If you're having problems with the script, please read the following before
* asking me for help.
******************************************************************************

* Script returns 500 Internal Server Error
* Make sure you've changed the first line of links.cgi to #! and then
the path to perl on your system
* Make sure you've uploaded links.cgi as ascii, not binary.
* Make sure you've set the permissions for links.cgi to 755.

* Password: shavenferret.com does not work
* Make sure you've entered it as all lower case
* Make sure that you've either placed the data directory in the same
directory as links.cgi, or entered the server path (not the URL) to
the directory in links.cgi
* Make sure that you've set the directory's permissions to 773, or if
that doesn't work on your server, 777

* Links page is not updated
* Make sure that you've entered the server path (not the URL) to the
links page in links.cgi
* Make sure that you've set links.html's permissions to 777

******************************************************************************

If you still need help, go to
http://www.shavenferret.com/scripts/help.shtml

And here is the main part of the script....

#!/usr/bin/perl
##############################################################################
# Cliff's Free Links Script Version 2.14 #
# Copyright 1998 Shaven Ferret Productions #
# Created 6/4/98 Last modified 1/5/2000 #
# Available at http://www.shavenferret.com/scripts #
##############################################################################
# COPYRIGHT NOTICE #
# Copyright 1998 Shaven Ferret Productions All Rights Reserved. #
# #
# This script can be used\modified free of charge as long as you don't #
# change this header or any of the parts that give me credit for writing #
# this. If you really need to remove the return links, go to #
# http://www.shavenferret.com/scripts/register.shtml #
# By using this script you agree to indemnify me from any liability #
# that might arise from its use. In simple English, if this script somehow #
# makes your computer run amuck and kill the pope, it's not my fault. #
# #
# Redistributing\selling the code for this program without prior written #
# consent is expressly forbidden. #
##############################################################################

# Enter the PATH (not the URL) to the directory where you will keep the data
# files. Do not include a trailing slash.
$datadir = "cgi-bin";

# Enter the PATH (not the URL) to the links page.
$linkspath = "links.html";

# Enter the full URL of the links page.
$linksurl = "http://www.lovelarge.com/links.html";

# Enter the URL of the uploaded links.cgi file.
$scripturl = "/cgi-bin/links.cgi";

# Enter the path to your mail program.
$mailprogram = "'/usr/sbin/sendmail -t";

##############################################################################
# Congratulations! You've finished defining the variables. If you want to, #
# you can continue screwing with the script, but it isn't necessary. #
##############################################################################

Did you CHMOD the files as indicated?

Also, it says to enter the PATH for certain things, when you clearly have not...the values datadir, and linkspath are not valid paths. Also, it says a URL entry for your script path, and while you are using /cgi-bin, not all hosts will recognize that as a direct to URL entry...

Hi,

Thanks for responding.... I'm new to all of this.... What is a path? What would I have to put in? I did the chmod... But I was not sure how to adapt the script... thanks. Since it may not recognize the cgi bin what url would I have to use? Thanks for your help.

datadir should be something like
$datadir = "/usr/local/bin/~username/httpd/cgi-bin";
or
$datadir = "/usr/local/bin/~username/www/htdocs/cgi-bin";

It just depends on your host and how they set up the box you are being hosted on; you should contact your host and get them to tell you your path to your www root and your path to your cgi-bin (if the cgi-bin does not reside below your root).

linkspath should be pretty similiar to datadir, but it won't be pointing to your cgi-bin.

The URL for your cgi-bin would be your domain name, just how you have it in linksurl....http://www.lovelarge.com/cgi-bin/links.cgi

You are probably getting the 500 error because datadir and linkspath are nowhere to be found according to the script, it needs the full server path to find them...once you get that, you should be working (in theory).

HI,

I think that is where I am messing up is the data directory.... It's really confusing stuff to me.... I'm not sure what the data directory is.... I only had two files when I unzipped it besides the readme.... There was a links.cgi which I put in the cgi bin. Than there was a link.html which I put with my other html.... It keeps telling me to log in to activate the script, but when I try to log in the admin panel it tells me that I've got the wrong password... I did all the suggestions in the troubleshoot of the readme but i'm still trying to figure out what's going on.... So I need to chmod the data directory when I find out what it is? Thanks for your help..










privacy (GDPR)