Solved

Perl script.. I think it might be permissions problem

Posted on 1998-05-17
7
465 Views
Last Modified: 2013-12-25
I have invested a lot of time into trying to get this bbs set up on my system. I am allowed to run cgi scripts outside my cgi-bin, so I set this up to be in my domain at http://www.freehound.com/design/board/ I was told to change the name of the script to index.cgi and when I do (and adjust the script accordingly) I get an internal server error. When I run index.cgi from telnet I get the following error

heras:~/www/design/board$ index.cgi
Content-type: text/html

Error retrieving homepage source file! at /usr/local/bin/index.cgi line 18.

When I name the file config.pl and try to access it through my web browser it simply prints out the script in my browser, as if I opened it with a word processor. When I run config.pl from telnet it gives me the correct html to run the board.

I have set chmod 777 on the script. I can't figure this out, I have successfully set up several scripts on my page but this one has me stumped. I am pasting the config.pl script in here. If anyone can help me please... I could use it this time, I'm losing my hair over this one.

I know the paths are correct. The /home/www/freehound is the correct path to my site. Thank you in advance for any help you can offer me.

#!/usr/local/bin/perl

############################################
##                                        ##
##                 WebBBS                 ##
##           by Darryl Burgdorf           ##
##                                        ##
##           Configuration File           ##
##                                        ##
############################################

## (1) Define the location of your files:

require "/home/www/freehound/design/board/webbbs.pl";

$dir = "/home/www/freehound/design/board";
$cgiurl = "http://www.freehound.com/cgi-bin/config.pl";

## (2) Tailor the appearance and functionality of your BBS:

$bodyspec = "BGCOLOR=\"#ffffff\" TEXT=\"#000000\"";

$HeadLinesFile = "";
$HeaderFile = "/home/www/freehound/design/board/header.txt";
$FooterFile = "/home/www/freehound/design/board/footer.txt";

$MessageHeaderFile = "/home/www/freehound/design/board/footer.txt";
$MessageFooterFile = "/home/www/freehound/design/board/footer.txt";

$DefaultType = "";
$DefaultTime = "Month";

$boardname = "Web Design's Discussion Board";

$InputColumns = 80;
$InputRows = 15;

$HourOffset = 1;

$ArchiveOnly = 0;
$AllowHTML = 0;
$AutoQuote = 1;
$SingleLineBreaks = 0;

$UseCookies = 1;
require "/home/www/freehound/cgi-bin/cookie.lib";

$UseAdmin = 1;

$Max_Days = 30;
$Max_Messages = 500;

$ArchiveDir = "/home/www/freehound/design/board/archive";

## (3) Define your visitors' capabilities:

$AllowUserDeletion = 0;
$AllowEmailNotices = 1;
$AllowPreview = 1;

$AllowURLs = 0;
$AllowPics = 0;

$NaughtyWords = "";

## (4) Define your e-mail notification features:

$mailprog = '/bin/mail';
$maillist_address = "freeware\@freehound.com";
$email_list = 0;

$HeaderOnly = 1;
$AdminEmail = 1;

&WebBBS;

## (5) If necessary, set up the WebAdverts configuration subroutine

sub insertadvert {
require "/full/path/to/ads_display.pl";
$adverts_dir = "/full/path/to/ads";
$display_cgi = "http://foo.com/ads/ads.pl";
$advertzone = $_[0];
$ADVUseLocking = 1;
$ADVLogIP = 0;
$NonSSI = 0;
$DefaultBanner = "";
$ADVNoPrint = 1;
&ADVsetup;
}
 
0
Comment
Question by:timshank
7 Comments
 
LVL 5

Expert Comment

by:icd
ID: 1828662
First of all, you can't call the script xxxxx.pl since the only way that the Web Server 'knows' that it is a script is by the extension (.cgi). It is still possible to run a .pl file from a telnet session but within a browser all you see is the content.

The difference to home in on is that when the file is called config.pl and it is run from a telnet session, it works. When it is called config.cgi then it does not work.

The error you are getting,

Error retrieving homepage source file! at /usr/local/bin/index.cgi line 18.

is an odd one. Perhaps it is an internal program error rather than a server error. Try doing a search for the text 'retrieving homepage' in all the scripts included with this bbs package.

The line number should give a clue, but the output you gave has nothing on line 18 that could be responsible. I would have expected a 'require' or something on line 18. Check your original source code at line 18.

0
 
LVL 6

Expert Comment

by:alamo
ID: 1828663
You aren't actually executing your script! You are executing index.cgi from the path, from the directory /usr/local/bin.

To execute your script via telnet use:

heras:~/www/design/board$ ./index.cgi

That should give you the *real* error message, which you can use to figure out the problem. Good luck!
0
 

Author Comment

by:timshank
ID: 1828664
still get the same error message, although I got the board working I'm still curious about why the error message. Thanks
0
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 
LVL 2

Accepted Solution

by:
tpryor earned 20 total points
ID: 1828665
must have been a path problem if the only difference was the name that broke it. It is easy to miss one in another file that refers to config.pl
0
 

Author Comment

by:timshank
ID: 1828666
indeed it is. Thank you. lets scoot this question outta the way.
0
 
LVL 6

Expert Comment

by:alamo
ID: 1828667
sheesh.
0
 

Author Comment

by:timshank
ID: 1828668
sorry about that alamo, I guess that was kinda rude of me.
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question