httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben RUBSON <ben.rub...@gmail.com>
Subject Re: [users@httpd] Avoid internal request on PATH_INFO
Date Fri, 08 Apr 2016 16:53:52 GMT
>>>>> What I would like to avoid is the entry in the error log for /additional/path/info
which does not exist.
>>>> 
>>>> What entry?
>>> 
>>> Hello Eric,
>>> 
>>> These messages :
>>> client denied by server configuration: /my_document_root/additional/path/info
>>> 
>>> Only /my_document_root/api/ and some other paths are available for requests.
>> 
>> In addition, why does Apache makes internal request on PATH_INFO ?
>> 
>> Thank you !
> 
> Do you have a construction like:
> 
> <VirtualHost *:80>
>   ServerName    somesite
>   ServerAdmin   somesitemaster@somesite.invalid
>   DocumentRoot "/var/www/html/somesite"
>   AliasMatch ^/(.*) "/var/www/html/somesite/index.php/$1"
>   <Directory "/var/www/html/somesite">
>      AllowOverride None
>      Order deny,allow
>      Deny from all
>      Allow from all
>      <FilesMatch "^.*$>
>         ForceType application/x-httpd-php
>      </FilesMatch>
>   </Directory>
> </VirtualHost>
> 
> Then, the script is supposed to evaluate 
> $_SERVER['PATH_INFO'] and $_SERVER['QUERY_STRING']
> 
> (it doesn't have to be PHP and a virtual host, but I happened to
> have this code at hand. Replace whatever you have to replace).
> If that doesn't work, please show your config.

Thank you for your answer Kees.
My config is the following :

<Directory />
Options None
AllowOverride None
Order Deny,Allow
Deny from all
</Directory>

DocumentRoot /my_document_root

<Directory /my_document_root/api>
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
</Directory>

---

It works, but when I GET /api/script.pl/additional/path/info
/api/script.pl is correctly executed, HTTP 200 is returned, perfect.
But in the same time Apache generates the following error message :
client denied by server configuration: /my_document_root/additional/path/info

So I just would like to know why Apache tries to reach / makes an internal request to PATH_INFO.

Of course if I add the following config, it does not produces error messages anymore :

<Directory /my_document_root>
Options None
AllowOverride None
Order Allow,Deny
Allow from all
</Directory>

Thank you !
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message