You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by David Knecht <da...@anyweb.ch> on 2006/01/24 18:51:53 UTC

[users@httpd] Some kind of "file name mapping"

This is probably an easy one but I did not find a solution so far:

A cgi script is trying to read the file /aaa/bbb/../ccc/file. As this 
file does not exist on the server, error_log reports this error message:

[Tue Jan 24 18:44:52 2006] [error] [client 192.168.94.1] Can't access 
file /aaa/bbb/../ccc/file

My question: I would like to configure Apache 2.0.52 for Linux to read 
the file /xxx/yyy/zzz/file instead of /aaa/bbb/../ccc/file whenever 
/aaa/bbb/../ccc/file is read.

So far, I did not find an Apache feature that does this conversion. I 
thought about using mod_rewrite but access to /aaa/bbb/../ccc/file is 
just made by the cgi script, thus, I think - please correct me if I am 
wrong - mod_rewrite cannot be used for such conversions.

Of course I could define symbolic links or modify the cgi script to 
solve this problem but I am looking for a pure Apache-based solution to 
get some more flexibility and to learn more about Apache.

Any hints are welcome.

Thanks, David



---------------------------------------------------------------------
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


Re: [users@httpd] Some kind of "file name mapping"

Posted by Joshua Slive <jo...@slive.ca>.
On 1/24/06, David Knecht <da...@anyweb.ch> wrote:
> This is probably an easy one but I did not find a solution so far:
>
> A cgi script is trying to read the file /aaa/bbb/../ccc/file. As this
> file does not exist on the server, error_log reports this error message:
>
> [Tue Jan 24 18:44:52 2006] [error] [client 192.168.94.1] Can't access
> file /aaa/bbb/../ccc/file
>
> My question: I would like to configure Apache 2.0.52 for Linux to read
> the file /xxx/yyy/zzz/file instead of /aaa/bbb/../ccc/file whenever
> /aaa/bbb/../ccc/file is read.
>
> So far, I did not find an Apache feature that does this conversion. I
> thought about using mod_rewrite but access to /aaa/bbb/../ccc/file is
> just made by the cgi script, thus, I think - please correct me if I am
> wrong - mod_rewrite cannot be used for such conversions.
>
> Of course I could define symbolic links or modify the cgi script to
> solve this problem but I am looking for a pure Apache-based solution to
> get some more flexibility and to learn more about Apache.

If the cgi script is trying to read the file directly from the
filesystem, then there is nothing apache can do about it.  A cgi
script is just like any other program running on your system and will
have the same type of filesystem access.

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
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Some kind of "file name mapping"

Posted by David Knecht <da...@anyweb.ch>.
Yes, Apache does FollowSymLinks.

I was looking for a rather flexible /path1/to1/file1 to /path2/to2/file2 
mapping mechanism based on regular expressions (just like what 
mod_rewrite does for URLs) because such a mechanism could indeed be used 
for more than just a few links.

David

Doug McNutt wrote:
> At 18:51 +0100 1/24/06, David Knecht wrote:
>> My question: I would like to configure Apache 2.0.52 for Linux to read the file /xxx/yyy/zzz/file instead of /aaa/bbb/../ccc/file whenever /aaa/bbb/../ccc/file is read.
> 
> Does apache follow symbolic links? It surely follows hard links if the files are on the same partition.
> 
> Or do you need more structured naming than just a few links?


---------------------------------------------------------------------
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


Re: [users@httpd] Some kind of "file name mapping"

Posted by Doug McNutt <do...@macnauchtan.com>.
At 18:51 +0100 1/24/06, David Knecht wrote:
>My question: I would like to configure Apache 2.0.52 for Linux to read the file /xxx/yyy/zzz/file instead of /aaa/bbb/../ccc/file whenever /aaa/bbb/../ccc/file is read.

Does apache follow symbolic links? It surely follows hard links if the files are on the same partition.

Or do you need more structured naming than just a few links?

-- 
-->  There are 10 kinds of people:  those who understand binary, and those who don't <--

---------------------------------------------------------------------
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