You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Darrel Austin <da...@darrelaustin.com> on 2002/04/29 22:16:07 UTC

Premature end of script error (WAS: Config'ing CGI's)

> It looks like you are getting there (slowly ;-).

Yes! Thank you! I wouldn't be this far without the helpful advice from this
list.

So, here's what I have now, for the record:

<VirtualHost xxx.xxx.xxx.xxx>
DocumentRoot /var/www/virtualhosts/site/html
ServerName server.com
AddHandler cgi-script .cgi
<Directory /var/www/virtualhosts/site/html/bugzilla/>
Options +ExecCGI
</Directory>
</VirtualHost>

And this takes care of the execution and permissions problem. Thanks!

On to the next problem. ;o)

(This actually may be drifting away from an actual Apache issue, so, if it
is, let me know.)

Upon accessing this directory now, I get an Internal Server error. My error
logs show the following:


[Mon Apr 29 14:36:12 2002] [error] (2)No such file or directory: exec of
/var/www/virtualhosts/site/html/bugzilla/query.cgi failed
[Mon Apr 29 14:36:12 2002] [error] [client xxx.xxx.xxx.xxx] Premature end of
script headers: /var/www/virtualhosts/site/html/bugzilla/query.cgi

It appears that it both can NOT find the file AND that it CAN find the file,
but is puking on the headers. What does that mean? For the record, that file
does exist in that location.

-Darrel






on 4/29/02 2:06 PM, Joshua Slive at joshua@slive.ca wrote:

> 
> On Mon, 29 Apr 2002, Darrel Austin wrote:
> 
>> Thanks everyone for the feedback! I'm still trying to digest this.
> 
> It looks like you are getting there (slowly ;-).
> 
>> 
>> OK, so here's what I have now:
>> 
>> <VirtualHost xxx.xxx.xxx.xxx>
>> DocumentRoot /var/www/virtualhosts/site/html
>> ServerName servername.com
>> Options +ExecCGI
>> AddHandler cgi-script .cgi
>> </VirtualHost>
> 
>> Does the "Options +ExecCGI" command apply to nested directories, or only the
>> parent directory spec'ed in the virtual host directive?
> 
> This is answered by the FAQ reference I gave you, but I'll rephrase it
> here: Options directives (and pretty much every other directive) do apply
> to nested directories.  But Options directives can override each other,
> and since the Options in the <VirtualHost> is applied before other Options
> directives that you probably have elsewhere in <Directory> containers, it
> gets overriden by those other Options.  Note in particular that
> 
> <VirtualHost xxx>
> Options +ExecCGI
> </VirtualHost>
> <Directory /var/www>
> Options Indexes
> </Directory>
> will result in ExecCGI being OFF in /var/www and below directories,
> because "Options Indexes" sets everything but Indexes to off.
> 
>> Am I even putting the options and the AddHandler in the correct part of the
>> config file?
> 
> The AddHandler is fine there, because it isn't likely to get overridden.
> It could also be placed in a specific <Directory> section.
> 
>> quite grasp the manual in context. The examples seem to make sense in and of
>> themselves, but I get completely lost when attempting to figure out WHERE
>> specific commands should go.
>> http://httpd.apache.org/docs/misc/FAQ.html#options mentions the DIRECTORY
>> tag, but I can't figure out where it goes in relation to the VirtualHost
>> tag.)
> 
> It can go pretty much anywhere.  If you want it to apply ONLY to that
> virtualhost, then put it inside the <VirtualHost> tags.  Otherwise, put it
> immediately before or after the <VirtualHost> section.
> 
>> For future reference, just so I get this straight, from what I understand
>> the +/- appends any previous Options statement while if you don't use the
>> +/- the options are all defaulted to none before applying the new
>> declaration. Correct?
> 
> Exactly.
> 
> Joshua.
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Premature end of script error (WAS: Config'ing CGI's)

Posted by Darrel <da...@darrelaustin.com>.
>The problem is almost surely that the shebang line at the top of the
>script doesn't point to the correct location of perl.  Therefore,
>when the OS goes to try to execute it, it fails.

Thanks Joshua...that appears to be part of the culprit. This BugZilla 
app has some messy scripting configurations in it.

Anyways, this appears to be more of a perl issue know...thanks for 
getting me to this point!

-Darrel
-- 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Premature end of script error (WAS: Config'ing CGI's)

Posted by Joshua Slive <jo...@slive.ca>.
On Mon, 29 Apr 2002, Darrel Austin wrote:
> [Mon Apr 29 14:36:12 2002] [error] (2)No such file or directory: exec of
> /var/www/virtualhosts/site/html/bugzilla/query.cgi failed
> [Mon Apr 29 14:36:12 2002] [error] [client xxx.xxx.xxx.xxx] Premature end of
> script headers: /var/www/virtualhosts/site/html/bugzilla/query.cgi
>
> It appears that it both can NOT find the file AND that it CAN find the file,
> but is puking on the headers. What does that mean? For the record, that file
> does exist in that location.

Those are actually both part of the same error.  When Apache execs the
script, it gets the response from the operating system "No such file ..."
and therefore it doesn't get the appropriate script headers.

The problem is almost surely that the shebang line at the top of the
script doesn't point to the correct location of perl.  Therefore,
when the OS goes to try to execute it, it fails.

See:
http://httpd.apache.org/docs/howto/cgi.html#pathinformation

Joshua.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org