Solved

Perl script.. I think it might be permissions problem

Posted on 1998-05-17
7
455 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For someā€¦
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.
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplicā€¦
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

706 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now