httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boyle Owen" <Owen.Bo...@swx.com>
Subject RE: [users@httpd] 'Premature end of script headers' error when starting Apache at boot time
Date Wed, 25 Feb 2004 08:47:47 GMT
> -----Original Message-----
> From: sujata@ked.biglobe.ne.jp [mailto:sujata@ked.biglobe.ne.jp]
> 
> Thanks a lot fr the suggestion...
> instead of /usr/bin/env python, i tried putting the full path 
> of python
> #!/usr/local/bin/python
> and it worked. but its not a very good solution, i would have 
> to change it in all srcipts..
> is there any better solution??

Could it be that the apache process doesn't have /usr/bin in its path
(so cannot find /usr/bin/env)? Make a simple CGI to print the $PATH, eg:

#!/bin/sh
echo "Content-type: text/plain"
echo ""
echo $PATH

to see what is happening.
  

Rgds,
Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored. 

> 
> 
> ???: "Boyle Owen" <Owen.Boyle@swx.com>
> ????: RE: [users@httpd] 'Premature end of script headers' 
> error when starting Apache at    boot time
> ??: Tue, 24 Feb 2004 10:54:38 +0100
> 
> > > -----Original Message-----
> > > From: sujata@ked.biglobe.ne.jp [mailto:sujata@ked.biglobe.ne.jp]
> > >
> > > I have successfully configured Apache 2.0.4 with RedHat 7.3
> > > and use Python 2.2.3 for cgi scripts.
> > > When I start Apache manually through
> > > /usr/local/apache/bin/apachectl startssl,
> > > I can execute the cgi scripts without any problem from the
> > > browser. This works fine.
> > >
> > > When I put the Apache start line in /etc/rc.local file so
> > > that Apache starts automatically
> > > at boot time, Apache starts without any problem, and I can
> > > access the HTML pages.
> > > But in case of CGI scripts, I get '500 internal server error'
> > > on the browser, and 2 errors
> > > in the error log  '/usr/bin/env: python: No such file or
> > > directory, referer: ..'
> > > and 'Premature end of script errors'.
> > 
> > The key error is '/usr/bin/env: python: No such file or directory,
> > referer: ..'
> > 
> > This means that the thread which executes the CGI cannot 
> find the python
> > interpreter. Is /usr/bin on a network drive which is maybe 
> not mounted
> > yet when apache starts at boot? (I'm not sure about apache 
> 2 - maybe the
> > threads inherit path information from the parent process...)
> > 
> > Rgds,
> > Owen Boyle
> > Disclaimer: Any disclaimer attached to this message may be ignored.
> > 
> > > In both cases, apache runs as root.
> > > I dont know much about this, but it seemed to be a permission
> > > problem, so confirmed that 755
> > > is set for my cgibin directory. /usr/local/bin/python also
> > > has 755 permissions.
> > > This has not helped. Its not finding python, but I dont know
> > > how to fix it.
> > >
> > > At this point, if I stop Apache and restart it manually,
> > > everything again works fine.
> > >
> > > Any ideas? Any help would be highly appreciated.
> > >
> > > Rgds
> > > Sujata
> > >
> > >
> > >
> > >
> > > 
> ---------------------------------------------------------------------
> > > 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
> > >    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> > > For additional commands, e-mail: users-help@httpd.apache.org
> > >
> > >
> > Diese E-mail ist eine private und personliche Kommunikation. Sie hat
> > keinen Bezug zur Borsen- bzw. Geschaftstatigkeit der SWX 
> Gruppe. This
> > e-mail is of a private and personal nature. It is not related to the
> > exchange or business activities of the SWX Group. Le 
> present e-mail est
> > un message prive et personnel, sans rapport avec l'activite 
> boursiere du
> > Groupe SWX.
> > 
> > This message is for the named person's use only. It may contain
> > confidential, proprietary or legally privileged information. No
> > confidentiality or privilege is waived or lost by any 
> mistransmission.
> > If you receive this message in error, please notify the 
> sender urgently
> > and then immediately delete the message and any copies of 
> it from your
> > system. Please also immediately destroy any hardcopies of 
> the message.
> > You must not, directly or indirectly, use, disclose, 
> distribute, print,
> > or copy any part of this message if you are not the 
> intended recipient.
> > The sender's company reserves the right to monitor all e-mail
> > communications through their networks. Any views expressed in this
> > message are those of the individual sender, except where the message
> > states otherwise and the sender is authorised to state them 
> to be the
> > views of the sender's company. 
> > 
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > 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
> >    "   from the digest: users-digest-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
>    "   from the digest: users-digest-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
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message