Solved

Perl script.. I think it might be permissions problem

Posted on 1998-05-17
7
458 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
DevOps Toolchain Recommendations

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

 
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

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Perl script to find new files and compress those new files 5 94
How can I do this in Pyhton? 12 125
Disk Ram Peak 1 40
Can I exclude specific directory with icacle command? 3 42
Introduction This tutorial will give you a fast look what you can do with WhizBase. I expect you already know how to work with HTML at least, and that you understand the basics of the internet and how the internet works. WhizBase is a server-s…
Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

776 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