httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Domoradov <alex....@gmail.com>
Subject [users@httpd] Dynamic open_basedir and mod_vhost_alias
Date Sat, 07 Apr 2012 09:51:51 GMT
Maybe anyone can point me in the right direction.

I need to modify this patch
http://www.phpbuilder.com/lists/php-developer-list/2000101/0994.php
and replace VIRTUAL_DOCUMENT_ROOT on the real path.

As described in patch note - "When using mod_vhost_alias the
DOCUMENT_ROOT = PATH_TRANSLATED - SCRIPT_NAME(request_uri)"

But in fact this is not always true. If we used any redirection
(mod_rewrite) for example, in the request_uri would be modified uri

For example

1. Without any redirects
url - http://project.domain.com/subdir1/test.php
SG(request_info).path_translated=/var/www/vhosts/project/subdir1/test.php
SG(request_info).request_uri=/subdir1/test.php

Looks everything is ok.

So we can use something like this
doc_root = strncpy( real_open_basedir_path,
SG(request_info).path_translated,
strlen(SG(request_info).path_translated) -
strlen(SG(request_info).request_uri) );

2. With some kind of redirects
url - http://magento.domain.com/index.php
SG(request_info).path_translated=/var/www/vhosts/magento/index.php
SG(request_info).request_uri=/index.php/install

And that is a BIG problem.

So my question. Could we get in php, maybe through apache API original
uri or doc_root? So later we can replace VIRTUAL_DOCUMENT_ROOT on the real path?

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


Mime
View raw message