Click to See Complete Forum and Search --> : Unlocking subdirectories within the cgi-bin


boredcrazy
03-28-2001, 12:07 AM
Here's my dilema.

I wrote this script on my virtual host that needs to read several text file which are inside of the cgi-bin.

For example, I would open
cgi-bin/data/x.txt

using
cgi-bin/x.pl


This worked fine with my virtual host... Now I've got an old used machine with corel linux and apache running and I want to put my proggie on it.

The scripts are working fine, but they return an error whenever they need to open a file.

All my files are CHMOD 777 so I can't figure out what's going on...

I think apache may be locking all subdirectories within the cgi-bin folder

Or even worse, preventing me from reading ANY file within the cgi-bin directory...

Please help

Infested Flar
03-28-2001, 12:12 AM
>>The scripts are working fine, but they return an error whenever they need to open a file.

Whats the Error??

>>All my files are CHMOD 777 so I can't figure out what's going on...

chmod 777 is BAD!

post an specific error here.. and one thing.. *.pl's should be only writable by the user the Apache is running.. (e.g. 'nobody').. so chmod 755 will do.. and of course.. the ownership of the *.pl's (should) be 'nobody' then..


-flar-

[ 27 March 2001: Message edited by: Flar ]

boredcrazy
03-28-2001, 12:38 AM
OK... More detail. You got it!
If I write something like this:

#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "Hello World";

I get :
"Hello World"
- - - - - - - - - - - - - - -

If I write something like this:

#!/usr/bin/perl
print "Content-type: text/html\n\n";
open(TEMPLATE, "data/template.txt");
local($/) = undef;
$FileContents = <TEMPLATE>;
close(TEMPLATE);

print $FileContents;


I get :
"The server encountered an internal error or misconfiguration and was unable to complete your request..."

"...premature end of script headers: /usr/lib/cgi-bin/catalog/login.pl"

boredcrazy
03-28-2001, 01:37 AM
Never mind...

I got someone to fix it for me.

Thank you for the help everyone.
Nerds are beautiful people.