This is a discussion on AllowOverride All not taken into account by apache 1.3.27 within the Apache Web Server forums, part of the Web Server and Related Forums category; I've got a complex cgi, with resources, all stored within a single directory in /cgi-bin/vacation-clisp/. Pictures ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I've got a complex cgi, with resources, all stored within a single directory in /cgi-bin/vacation-clisp/. Pictures are in /cgi-bin/vacation-clisp/images/. <VirtualHost *> ServerName vacation.intra.afaa.asso.fr ServerAdmin webmaster@afaa.asso.fr DocumentRoot /srv/www/vacation/ ErrorLog /var/log/httpd/vacation-error_log CustomLog /var/log/httpd/vacation-access_log afaa ScriptAlias /cgi-bin/ /srv/www/vacation/cgi-bin/ <Location /> AllowOverride All </Location> <Location /cgi-bin> AllowOverride All Options +ExecCGI -Includes SetHandler cgi-script </Location> </VirtualHost> I've all my "AllowOverride" set to "All" everywhere in /etc/httpd/*.conf, and since /cgi-bin has +ExecCGI and SetHandler cgi-script, I've put a .htaccess in /cgi-bin/vacation-clisp/images/ containing: Options -ExecCGI SetHandler None SetHandler default-handler However, I keep getting these "Premature end of script headers" errors: ==> /var/log/httpd/vacation-access_log <== 195.114.85.198 - - [31/Oct/2003:01:46:21 +0100] "GET /cgi-bin/vacation?XXXX HTTP/1.1" 200 2616 "http://vacation.intra.afaa.asso.fr/cgi-bin/vacation?XXXX" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021204" 0 vacation.intra.afaa.asso.fr 195.114.85.198 - - [31/Oct/2003:01:46:21 +0100] "GET /cgi-bin/vacation-clisp/images/logo-afaa.jpg HTTP/1.1" 500 626 "http://vacation.intra.afaa.asso.fr/cgi-bin/vacation?XXXX" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021204" 0 vacation.intra.afaa.asso.fr 195.114.85.198 - - [31/Oct/2003:01:46:21 +0100] "GET /cgi-bin/vacation-clisp/images/fond-palmier.jpg HTTP/1.1" 500 626 "http://vacation.intra.afaa.asso.fr/cgi-bin/vacation?" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021204" 0 vacation.intra.afaa.asso.fr ==> /var/log/httpd/vacation-error_log <== [Fri Oct 31 01:46:21 2003] [error] (13)Permission denied: exec of /srv/www/vacation/cgi-bin/vacation-clisp/images/logo-afaa.jpg failed [Fri Oct 31 01:46:21 2003] [error] [client 195.114.85.198] Premature end of script headers: /srv/www/vacation/cgi-bin/vacation-clisp/images/logo-afaa.jpg [Fri Oct 31 01:46:21 2003] [error] (13)Permission denied: exec of /srv/www/vacation/cgi-bin/vacation-clisp/images/fond-palmier.jpg failed [Fri Oct 31 01:46:21 2003] [error] [client 195.114.85.198] Premature end of script headers: /srv/www/vacation/cgi-bin/vacation-clisp/images/fond-palmier.jpg I even copied this .htaccess in all the directories up to /, and still get this error (and /cgi-bin/vacation is still handled by the cgi-script handler!). So, what should be done to have Apache 1.3.27 take into account AllowOverride All and the .htaccess files? -- __Pascal_Bourguignon__ http://www.informatimago.com/ |
|
|||
|
Pascal Bourguignon <spam@thalassa.informatimago.com> wrote:
> ScriptAlias /cgi-bin/ /srv/www/vacation/cgi-bin/ If you use ScriptAlias, everything will be considered as a CGI, so the .htaccess file won't be read. Besides, if you use ScriptAlias the > Options +ExecCGI -Includes is useless. Davide |
|
|||
|
Davide Bianchi <davideyeahsure@onlyforfun.net> writes:
> Pascal Bourguignon <spam@thalassa.informatimago.com> wrote: > > ScriptAlias /cgi-bin/ /srv/www/vacation/cgi-bin/ > > If you use ScriptAlias, everything will be considered as a CGI, so > the .htaccess file won't be read. Besides, if you use ScriptAlias the > > > Options +ExecCGI -Includes > > is useless. > > Davide Ok, I replaced all ScriptAlias with mere Alias, given that I have Options +ExecCGI and SetHandler cgi-script parameters in Location or Directory entries. But it still get the error. Does SetHandler cgi-script have the same effect as ScriptAlias, preventing reading ..htaccess? ==> vacation-error_log <== [Fri Oct 31 19:20:41 2003] [error] (13)Permission denied: exec of /srv/www/vacation/cgi-bin/vacation-clisp/images/logo-afaa.jpg failed [Fri Oct 31 19:20:41 2003] [error] [client 195.114.85.198] Premature end of script headers: /srv/www/vacation/cgi-bin/vacation-clisp/images/logo-afaa.jpg [Fri Oct 31 19:20:42 2003] [error] (13)Permission denied: exec of /srv/www/vacation/cgi-bin/vacation-clisp/images/fond-palmier.jpg failed [Fri Oct 31 19:20:42 2003] [error] [client 195.114.85.198] Premature end of script headers: /srv/www/vacation/cgi-bin/vacation-clisp/images/fond-palmier.jpg janus-2:/etc/httpd # grep ScriptAlias *.conf httpd.conf: # ScriptAliases are essentially the same as Aliases, except that httpd.conf: # ScriptAlias /cgi-bin/ "/srv/www/cgi-bin/" janus-2:/etc/httpd # cat virtual-vacation.conf <VirtualHost *> ServerName vacation.intra.afaa.asso.fr ServerAdmin webmaster@afaa.asso.fr DocumentRoot /srv/www/vacation/ ErrorLog /var/log/httpd/vacation-error_log CustomLog /var/log/httpd/vacation-access_log afaa Alias /cgi-bin /srv/www/vacation/cgi-bin <Location /> AllowOverride All </Location> <Location /cgi-bin> AllowOverride All Options +ExecCGI -Includes SetHandler cgi-script Order allow,deny Allow from all </Location> </VirtualHost> janus-2:/etc/httpd # cat /srv/www/vacation/cgi-bin/vacation-clisp/images/.htaccess Options -ExecCGI SetHandler default-handler janus-2:/etc/httpd # ls -ld /srv/www/vacation/cgi-bin/vacation-clisp/images/fond-palmier.jpg /srv/www/vacation/cgi-bin/vacation-clisp/images/ /srv/www/vacation/cgi-bin/vacation-clisp/ /srv/www/vacation/cgi-bin/ /srv/www/vacation/ /srv/www/ /srv/ / drwxr-xr-x 28 root root 4096 Oct 30 19:26 // drwxr-xr-x 8 root root 4096 Sep 18 03:38 /srv// drwxr-xr-x 24 root www 4096 Oct 30 22:49 /srv/www// drwxr-xr-x 4 root www 4096 Oct 31 15:57 /srv/www/vacation// drwxr-xr-x 3 root www 4096 Oct 31 15:57 /srv/www/vacation/cgi-bin// drwxr-xr-x 4 root www 4096 Oct 31 15:57 /srv/www/vacation/cgi-bin/vacation-clisp// drwxr-xr-x 2 root www 4096 Oct 31 19:19 /srv/www/vacation/cgi-bin/vacation-clisp/images// -rw-r--r-- 1 root www 48481 Oct 31 01:05 /srv/www/vacation/cgi-bin/vacation-clisp/images/fond-palmier.jpg -- __Pascal_Bourguignon__ http://www.informatimago.com/ |
|
|||
|
Pascal Bourguignon <spam@thalassa.informatimago.com> wrote:
> Permission denied: exec of > /srv/www/vacation/cgi-bin/vacation-clisp/images/logo-afaa.jpg failed Is trying to execute the .jpg file as a script. The .jpg ain't executable (of course) so you get a "permission denied". I think you have to specify WHAT have to be executed as a cgi and what has NOT to be executed using the SetHandler option. Or just put the scripts in the cgi bin dir and leave everything else outside (as is supposed to be). Davide |
|
|||
|
Davide Bianchi <davideyeahsure@onlyforfun.net> writes:
> Pascal Bourguignon <spam@thalassa.informatimago.com> wrote: > > Permission denied: exec of > > /srv/www/vacation/cgi-bin/vacation-clisp/images/logo-afaa.jpg failed > > Is trying to execute the .jpg file as a script. The .jpg ain't executable > (of course) so you get a "permission denied". I know that. > I think you have to specify WHAT have to be executed as a cgi and > what has NOT to be executed using the SetHandler option. Isn't it what I specified with SetHandler default-handler and Options -ExecCGI in the .htaccess in /cgi-bin/vacation-clisp/images/.htaccess file? > Or just put the scripts in the cgi bin dir and leave everything > else outside (as is supposed to be). Yes, but I want to keep all the resources of my program inside the same directory. That should not be so complicated... -- __Pascal_Bourguignon__ http://www.informatimago.com/ |
|
|||
|
Pascal Bourguignon <spam@thalassa.informatimago.com> wrote:
> Isn't it what I specified with SetHandler default-handler and Options > -ExecCGI in the .htaccess in /cgi-bin/vacation-clisp/images/.htaccess > file? No. Basically the SetHandler is telling apache to process all the files with the specified "handler". Since you didn't specified a file type everything will be processed as a CGI, exactly like before. To specify a file type use the AddHandler directive AddHandler cgi-script .cgi This way only file .cgi will be processed. Change or add file types as your needs. > Yes, but I want to keep all the resources of my program inside the > same directory. Well, the images could be in a different directory, so they can be shared with multiples applications. Doesn't sound so strange to me. Davide |
| Thread Tools | |
| Display Modes | |
|
|