LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-29-2001, 12:27 AM   #1
morbo
Member
 
Registered: Dec 2001
Posts: 53

Rep: Reputation: 15
Apache and SSI/CGI PROBLEMS


I'm having a bit of trouble getting a certain CGI script to run in any dir other than the serverroot...

I have a user called 'test' (http://myip/~test) and SSI works fine in any file in any dir-but calling a cgi via SSI returns no error message on the site (the standard [error occured while processing this directive])-but in the error_log I get the following:

[Sat Dec 29 00:22:08 2001] [error] [client *.*.*.*] Premature end of script headers: /home/test/html/cgi-bin/counter.cgi

Also-when going to '/~test/cgi-bin/counter.cgi' I get a 500 Server error....

However-I can run the SAME script in my default 'var/www/html' dir with no problems. Here are my dir settings in my httpd.conf:

<Directory "/">
Options FollowSymLinks

AllowOverride None



</Directory>

<Directory "/var/www/html">
Options Indexes Includes FollowSymLinks ExecCGI
AddHandler cgi-script .cgi .pl
AllowOverride None
Allow from from all


Order Deny,Allow
</Directory>

<Directory "/var/www/icons">
Options Indexes MultiViews

AllowOverride None
Allow from from all


Order allow,deny
</Directory>

<Directory "/var/www/html/cgi-bin">
Options ExecCGI Indexes Includes
AddHandler cgi-script .cgi .pl
AllowOverride None
Allow from from all


Order allow,deny
</Directory>

<Directory "/home/*/html/cgi-bin">
Options ExecCGI Includes Indexes FollowSymLinks
AddHandler cgi-script .cgi .pl
AllowOverride None
Allow from from all


Order allow,deny
</Directory>
<Directory "/home/*/html">
Options Indexes Includes FollowSymLinks ExecCGI
AddHandler cgi-script .cgi .pl
AllowOverride None
Allow from from all


Order allow,deny
</Directory>

<Directory "/home/*/html/cgi-bin">
Options ExecCGI Indexes Includes FollowSymLinks
AddHandler cgi-script .cgi .pl
</Directory>

Any ideas?
 
Old 12-31-2001, 08:46 AM   #2
ifincham
LQ Newbie
 
Registered: Dec 2001
Distribution: Redhat / Mandrake / Suse / Debian
Posts: 6

Rep: Reputation: 0
Hi,

Maybe you are running Apache with Suexec support and the user does not have permissons on the script(s) concerned or some file/directory accessed by the script. If suexec is active then the script should 'automatically' run under the user's access rights not the httpd server userid.

See --> http://httpd.apache.org/docs/suexec.html

Regards
 
Old 01-18-2003, 04:04 PM   #3
Screech
LQ Newbie
 
Registered: Dec 2002
Posts: 4

Rep: Reputation: 0
This solved the same problems for me.

chmod -R 755 /var/www/cgi_bin
chgrp -R apache /var/www/cgi-bin
chown -R apache /var/www/cgi-bin

See also....
http://www.redhat.com/support/resou...he-FAQ/x33.html

Wam! No more Premature end of script headers errors.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
CGI works from SSI exec, but not from include. SkipHuffman Linux - Software 2 08-25-2005 10:15 PM
Apache CGI problems clb Linux - Networking 2 11-24-2004 10:03 AM
Apache 1.4.7 cgi problems Sm0k3 Programming 1 10-19-2003 02:12 PM
ssi and cgi not working... Flawless Slackware 12 03-09-2003 09:38 PM
Problems with apache and cgi Joshsawyer77 Linux - General 3 01-25-2003 01:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration