Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2766467
  • 博文数量: 587
  • 博客积分: 6356
  • 博客等级: 准将
  • 技术积分: 6410
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-23 10:54
个人简介

器量大者,福泽必厚

文章分类

全部博文(587)

文章存档

2019年(3)

2018年(1)

2017年(29)

2016年(39)

2015年(66)

2014年(117)

2013年(136)

2012年(58)

2011年(34)

2010年(50)

2009年(38)

2008年(16)

分类: LINUX

2011-08-17 21:20:57

Warning: file_exists() [function.file-exists]:
open_basedir restriction in effect. File(/license.dat)
 is not within the allowed path(s): (/usr/vhome/y/a/n/yanb*.com/:/usr/vhome/tmp) in /usr/vhome/y/a/n/yanb*.com/www/includes/func/common.inc.php
 on line 788 ERROR:004
 
由于虚拟主机的配置导致用户的网访问时有类似于上面的出错信息,一般解决方法是用户修改代码和我们机器上的配置项匹配即可,但也有一种用户死活就是不修改代码。我们只好修改配置!
#begin yanbd.com

ErrorDocument 404 /404.htm
ErrorDocument 500 /cgi-pub/500
   ServerName   
   DocumentRoot /usr/vhome/y/a/n/yanb*.com/www
   php_admin_value open_basedir /usr/vhome/y/a/n/yanb*.com/:/usr/vhome/tmp  ##锁定PHP程序应用目录
 
正常的配置见上面。
只需要将php_admin_value open_basedir /usr/vhome/y/a/n/yanb*.com/:/usr/vhome/tmp
所在的行注释掉,然后重启apache服务(-k graceful优雅重启即可),Warning就会消失,这样可以解决问题,但实际上也带来了安全带隐患!
php.ini中禁用危险函数:
  1. 850[*.*.*.*][1044] cat /usr/local/confcenter/php.ini | grep disable_
  2. ;disable_functions = system,passthru,exec,shell_exec,popen,phpinfo
  3. disable_functions = dl,exec,passthru,shell_exec,system,proc_open,popen,parse_ni_file,show_source
  4. disable_classes =

说到危险函数,fsockopen就是非常著名的危险函数,它很容易给机器带来网站攻击! 它的攻击特点是网络流量瞬间很大(我们的机器outgoing大概有80-90M,这是正常情况下一个机柜的流量)!在日志中提取ip= && port  见附件! 类似于附件中的内容,就基本可以确定是网络攻击!尽管它危险,但它在很多的开源软件中被频繁使用!我们为了客户的需要还是没有禁用它,故在配置文件的disable_functions中根本没有它!

 

阅读(1578) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~