实际上和子域open_basedir的限制 [英] open_basedir restriction in effect and subdomains

查看:314
本文介绍了实际上和子域open_basedir的限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关安全方面的原因我已经把我的警予的HTML根文件夹下面,让我的结构看起来像这样

  / conf目录
/ httpdocs资料
/ httpsdocs的
/警予

在运行网站时,我得到效果的错误open_basedir的限制,即 yii.php 这是由名为index.php的的httpdocs 是不是在允许的路径。由于这个网站是一个子不我编辑主域或子域的 vhosts.conf 的?

你会正确的设置是允许

  /var/www/vhosts/example.com/subdomains/mysubdomain/yii

路径进行访问?


修改

所以,我的 /var/www/vhosts/example.com/conf/vhost.conf 文件看起来像现在这样:

  AddHandler的fcgid脚本的.php
<目录/var/www/vhosts/example.com/httpdocs>
php_admin_value open_basedir的\".:/var/www/vhosts/example.com/subdomains/mysubdomain/httpdocs:/tmp/:/var/www/vhosts/example.com/subdomains/mysubdomain/yii\"
FCGIWrapper /var/www/vhosts/example.com/bin/php-cgi的.php
选项​​+ ExecCGI +的FollowSymLinks
所有允许
< /目录>

我已经重新配置,并重新启动Web服务器,但我仍然得到错误:

 警告:require_once()[一旦function.require-]:实际上open_basedir的限制。
文件(/var/www/vhosts/example.com/subdomains/mysubdomain/httpdocs /../的Yii / yii.php)不在允许路径(多个)内:
(/var/www/vhosts/example.com/subdomains/mysubdomain/httpdocs:/tmp)
在第26行/var/www/vhosts/example.com/subdomains/mysubdomain/httpdocs/index.php


解决方案

我找到了答案。您可以指定不同的模块或者简单的编辑虚拟主机文件好好尝试一下有多大的效果。这是关闭open_basedir的,但你可以相应地修改这些设置。

 <目录/var/www/vhosts/YOURDOMAIN.COM/subdomains/YOUSUBDOMAIN/httpdocs>
  < IfModule sapi_apache2.c>
  php_admin_value open_basedir的无
< / IfModule>
< IfModule mod_php5.c>
  php_admin_value open_basedir的无
  < / IfModule>
< /目录>

然后

 #在/ usr /本地/ PSA /管理/斌/ websrvmng --reconfigure的虚拟主机--vhost名= YOURDOMAIN.COM
#apachectl中停止
#apachectl中启动

见全文可以在这里找到: http://prattski.com/ 2008/09/13 / Plesk所open_basedir的修复/

For security reasons I have put my yii folder below the html root, so my structure looks like this

/conf
/httpdocs
/httpsdocs
/yii

when running the site I get an error open_basedir restriction in effect that yii.php which is called by index.php out of httpdocs is not in the allowed path. Because this site is a subdomain do I edit the vhosts.conf of the main domain or of the subdomain?

What would the proper setting be to allow

/var/www/vhosts/example.com/subdomains/mysubdomain/yii 

Path to be accessible?


EDIT

So my /var/www/vhosts/example.com/conf/vhost.conf file looks like this now:

AddHandler fcgid-script .php
<Directory /var/www/vhosts/example.com/httpdocs>
php_admin_value open_basedir ".:/var/www/vhosts/example.com/subdomains/mysubdomain/httpdocs:/tmp/:/var/www/vhosts/example.com/subdomains/mysubdomain/yii"
FCGIWrapper /var/www/vhosts/example.com/bin/php-cgi .php
Options +ExecCGI +FollowSymLinks
allow from all
</Directory>

I've reconfigured and restarted the web server but I still get the error:

Warning: require_once() [function.require-once]: open_basedir restriction in effect. 
File(/var/www/vhosts/example.com/subdomains/mysubdomain/httpdocs/../yii/yii.php) is not within the allowed path(s): 
(/var/www/vhosts/example.com/subdomains/mysubdomain/httpdocs:/tmp) 
in /var/www/vhosts/example.com/subdomains/mysubdomain/httpdocs/index.php on line 26

解决方案

I found the answer. You have to specify the different modules or else simply editing the vhost file doens't have much of an effect. This is to turn off the open_basedir but you can edit the settings accordingly.

<Directory /var/www/vhosts/YOURDOMAIN.COM/subdomains/YOUSUBDOMAIN/httpdocs>
  <IfModule sapi_apache2.c>
  php_admin_value open_basedir none
</IfModule>
<IfModule mod_php5.c>
  php_admin_value open_basedir none
  </IfModule>
</Directory>

then

# /usr/local/psa/admin/bin/websrvmng --reconfigure-vhost --vhost-name=YOURDOMAIN.COM
# apachectl stop
# apachectl start

Full article can be found here: http://prattski.com/2008/09/13/plesk-open_basedir-fix/

这篇关于实际上和子域open_basedir的限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆