Solved

Perl script.. I think it might be permissions problem

Posted on 1998-05-17
7
457 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

919 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

16 Experts available now in Live!

Get 1:1 Help Now