[vox-tech] Apache error

vox-tech@lists.lugod.org vox-tech@lists.lugod.org
Wed, 24 Apr 2002 13:12:44 -0400


Alfredo,

- Could you mail the output from the following commands (change the
  FILE line to be whatever is supposed to be the real "merged.htm"
  not the symlinks):
=========
  FILE=/var/www/html/iprs_tmp/nobody_23-Apr-2002_7042/merged.htm
  ls -l $FILE; file $FILE; head -2 $FILE
=========

  I would also recommend you combine those four Directory directives into 
two and correct for a few of the observations... 

    TTFN,
      Mike

On Wed, Apr 24, 2002 at 08:47:10AM -0700, ALLO (Alfredo Lopez) wrote:
> > what do you have in your ScriptAlias setting for apache...
> 
> # The InterPro specific requirements are as follows
> 
> ScriptAlias /iprs-bin/  "/var/www/html/iprs-bin/"
> AddHandler cgi-script  .pl
> <Directory "/var/www/html/iprs-bin">
>     AllowOverride ALL
>     Options None
>     Options ExecCGI
>     Order allow,deny
>     Allow from all
> </Directory>
> 
> ScriptAlias /iprs_tmp/  "/var/www/html/iprs_tmp/"
> AddHandler cgi-script  .pl
> <Directory "/var/www/html/iprs_tmp">
>     AllowOverride ALL
>     Options None
>     Options ExecCGI
>     Order allow,deny
>     Allow from all
> </Directory>

> And on the Directory section at the en of the httpd.conf file I have:
> 
> <Directory "/var/www/html/iprs-bin">
> Options ExecCGI FollowSymLinks
> AllowOverride None
> Allow from from all
> Order allow,deny
> </Directory>
> 
> <Directory "/var/www/html/iprs_tmp">
> Options ExecCGI FollowSymLinks
> AllowOverride None
> Allow from from all
> Order allow,deny
> </Directory>

Observations:
- You may not have noticed by you define a Directory directive for 
  /var/www/html/iprs-bin (and iprs_tmp) two places.  Right after the 
  ScriptAlias and then again at the end of the httpd.conf file.
- In the first two Directory directives you have two separate "Options"
  lines, the first says no options the second says you want ExecCGI...
  You should probably nuke the "None" lines.
- In the second Directory entries you have a typo
  "Allow from from all" instead of "Allow from all"
- Between the first and second Directory entries you have three sets of
  Options:  "None", "ExecCGI", "ExecCGI FollowSymLinks" in that order.
- Between the first and second Directory entries you have two sets of
  AllowOverride: "All", "None" in that order.

  Without testing I don't even begin to understand how these two sets
of Directory entries combine ... I don't really know apache that well
the following is from the apache documentation:

/usr/share/doc/apache/manual/mod/core.html
# How the sections are merged
# 
#    The order of merging is:
#     1. <Directory> (except regular expressions) and .htaccess done
#        simultaneously (with .htaccess, if allowed, overriding
#        <Directory>)
#     2. <DirectoryMatch>, and <Directory> with regular expressions
#     3. <Files> and <FilesMatch> done simultaneously
#     4. <Location> and <LocationMatch> done simultaneously
# 
#    Apart from <Directory>, each group is processed in the order that they
#    appear in the configuration files. <Directory> (group 1 above) is
#    processed in the order shortest directory component to longest. If
#    multiple <Directory> sections apply to the same directory they they
#    are processed in the configuration file order. The configuration files
#    are read in the order httpd.conf, srm.conf and access.conf.

  The way I read that is most things will be checked in order they are
defined... so it will be some collection of those things... probably the
second directory entry wins (unless the internal logic short circuits and 
stops processing early for things like "none").
  
> From: msimons@moria.simons-clan.com Tuesday, April 23, 2002 7:14 PM
> > On Tue, Apr 23, 2002 at 06:58:19PM -0700, ALLO (Alfredo Lopez) wrote:
> > > [Tue Apr 23 16:25:09 2002] [error] (13)Permission denied: exec of
> > > /var/www/html/iprs_tmp/nobody_23-Apr-2002_7042/merged.htm failed
> > > [Tue Apr 23 16:25:09 2002] [error] [client 152.73.207.250] 
> > Premature end of 
> > > script headers: 
> > /var/www/html/iprs_tmp/nobody_23-Apr-2002_7042/merged.htm