PDA

View Full Version : CGI outside of cgi-bin


cngo
11-25-1998, 06:02 PM
I have a script outside of the cgi-bin. It works in the cgi-bin but not outside of it, instead I get a "Premature end of script headers." How do I fix this?

Del
11-25-1998, 06:08 PM
Futurequest is set up to only run CGI out of the cgi-bin directory. However, there is a workaround. Create a file called .htaccess inside of the dir you want to run cgi out of. In that .htaccess file you need the following line;

AddHandler cgi-script cgi

For the official word on this, check http://www.aota.net/ubb//Forum11/HTML/000001.html

Del

cngo
11-25-1998, 06:21 PM
I read the document at aota.net and had the .htaccess file in there already and I still get this error.

Deb
11-25-1998, 06:42 PM
Hello cngo,

The first question I would have to ask is are you trying to do this on the FutureQuest server or somewhere else?

The support we give in these forums is FQuest specific. Each server runs differently.

If you are running on the FQuest server could you please edit your user information to better help us be able to help you.

Thanks
Deb

cngo
11-25-1998, 06:52 PM
Yes I am on FQest. There is nothing wrong with the script. I downloaded it at http://solutionscripts.com/vault/powerlist/index.shtml and it works fine in the cgi-bin but not anywhere else.

cngo
11-25-1998, 06:52 PM
Yes I am on FQuest. There is nothing wrong with the script. I downloaded it at http://solutionscripts.com/vault/powerlist/index.shtml and it works fine in the cgi-bin but not in any other directory.

[This message has been edited by cngo (edited 11-25-98).]

Deb
11-25-1998, 07:11 PM
Great,

If you could let us know which domain you are working on we will check it out...

Until then it's like searching for a needle in a haystack quessing what the problem may be that you are having...

Let me know.. either here.. or via email if you are wanting this info to be a secret.

Deb

Del
11-25-1998, 08:17 PM
I tried it too, just for fun http://www.aota.net/ubb//smile.gif It doesn't work on my domain either. I tried 1 to 3 of the following lines in all possible ways in the .htaccess with no luck.

Options execCGI
AddHandler cgi-script .cgi
AddType application/x-httpd-cgi .cgi

At the bottom is a snippet from my error log, not much help. The other error log just says 'premature end of headers', even tho the script runs fine in the cgi-bin and under perl -cw. None of it seems to help much. The script is at downinit.com/test/test.cgi, all it does is print 'Testing' in plain text. Was hoping to find some funky lil trick that'd do it, but no luck so far.

Del


%% [Wed Nov 25 19:04:17 1998] GET /test/test.cgi HTTP/1.0
%% 500 /big/dom/xdowninit/www/test/test.cgi
%request
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*
Accept-Charset: iso-8859-1,*,utf-8
Accept-Language: en
Connection: Keep-Alive
Host: www.downinit.com
Referer: http://www.downinit.com/test/
User-Agent: Mozilla/4.05 [en] (Win95; I)
%response

cngo
11-25-1998, 08:29 PM
Not much luck with that either.

[This message has been edited by cngo (edited 11-25-98).]

Terra
11-25-1998, 09:01 PM
Del,

You had it right the first time, but botched it the second time... :p

AddHandler cgi-script cgi ***enter***

**I found one more problem, make sure there is a line feed 'LF' at the end of that line**

.cgi == bad
cgi == good http://www.aota.net/ubb//smile.gif

cngo -- I have checked your .htaccess files, just remove the period and it should work fine...

***
Oh heck, it gets deeper...

The directory needs to be set mode '755', not '777' or '775' -- you are running under suEXEC which switches Apache UserID to yours, removing the necessity to make directories or files group/world writeable... A very nasty security mistake a lot of *other* hosters make... :p

I have made the changes and tested your script... Look for a special file, you'll know when you see it... http://www.aota.net/ubb//smile.gif

You can find more information on this at:
http://www.apache.org/docs/suexec.html

It is *very* restrictive - with good reason... http://www.aota.net/ubb//smile.gif

--
TeRRaTech


[This message has been edited by ccTech (edited 11-25-98).]

uniprosper
12-19-1998, 06:29 PM
Hi,

I had exactly the same problem. But don't worry, as most of the time it can be sorted with a simply Directory CHMOD to 755.

I had ALL the files in the dir CHMOD 755, but that still didn't work. So, I then CHMOD 755 to the directories, and it worked perfect!

It works with .cgi and .pl files. Just make sure you add the line

AddHandler cgi-script cgi

and it should work perfectly.

Merry Christmas!
Lee

------------------
=======================
Get FREE promotion &
BOOST TRAFFIC NOW!
http://www.uniprosper.com
=========================