首 页 教育新闻课件中心论文中心教学教案试题中心语文专题综合下载技术教程公务员  
设为首页
加入收藏
联系我们
您当前的位置:中国教育资源网 -> 技术教程 -> 网络相关 -> 服务器 -> Web服务器 -> 技术内容 退出登录 用户管理

apache 限制某些目录不能用phpWeb服务器教程

论文作者:佚名  论文来源:不详  论文发布时间:2006-6-18 23:06:02  论文发布人:chjchjchj

减小字体 增大字体

              摘要:apache 限制某些目录不能用php
php.ini 



safe_mode = On 

; By default, Safe Mode does a UID compare check when 
; opening files. If you want to relax this to a GID compare, 
; then turn on safe_mode_gid. 
safe_mode_gid = Off 

; When safe_mode is on, UID/GID checks are bypassed when 
; including files from this directory and its subdirectories. 
; (directory must also be in include_path or full path must 
; be used when including) 
safe_mode_include_dir = 

; When safe_mode is on, only executables located in the safe_mode_exec_dir 
; will be allowed to be executed via the exec family of functions. 
safe_mode_exec_dir = 

; open_basedir, if set, limits all file operations to the defined directory 
; and below. This directive makes most sense if used in a per-directory 
; or per-virtualhost web server configuration file. 

open_basedir =

 haohaoo 回复于:2003-01-18 12:57:53safe_mode_include_dir = 
safe_mode_exec_dir = 

open_basedir =
那个后面加不开放php权限的目录

 南非蜘蛛 回复于:2003-01-18 13:16:39上面有说明,测试一下就知道了,不是很难
我现在手里没有机器

 一颗小白菜 回复于:2003-01-19 11:05:01[quote:bf387d5aea="haohaoo"]safe_mode_include_dir = 
safe_mode_exec_dir = 

open_basedir =
那个后面加不开放php权限的目录[/quote:bf387d5aea]

open_basedir 用来指定只在某一个目录中执行PHP

对不需要开放PHP权限的目录,在PHP的 Apache-specific Functions 章节中有以下一句:
[quote:bf387d5aea]
 The behaviour of the Apache PHP module is affected by settings in php.ini. Configuration settings from php.ini may be overridden by php_flag settings in the server configuration file or local .htaccess files.
[/quote:bf387d5aea]
接着,有一个示例
[quote:bf387d5aea]
php_flag engine off
[/quote:bf387d5aea]

[quote:bf387d5aea]
engine  boolean

    This directive is really only useful in the Apache module version of PHP. It is used by sites that would like to turn PHP parsing on and off on a per-directory or per-virtual server basis. By putting engine off in the appropriate places in the httpd.conf file, PHP can be enabled or disabled. 
[/quote:bf387d5aea]

因此,我们只需要在不需要PHP权限的目录或者虚拟主机设置段(目录为<Directory>,虚拟主机为<VirualHost>中加上
[code:1:bf387d5aea]php_flag engine off[/code:1:bf387d5aea]

 南非蜘蛛 回复于:2003-01-19 13:10:01原来有php专家,我就不献丑了,呵呵,谢谢小白菜

 南非蜘蛛 回复于:2003-01-19 13:25:46php_value name value 
Sets the value of the specified directive. Can be used only with PHP_INI_ALL and PHP_INI_PERDIR type directives. To clear a previously set value use none as the value. 


php_value auto_prepend_file none 




php_flag name on|off 
Used to set a Boolean configuration directive. Can be used only with PHP_INI_ALL and PHP_INI_PERDIR type directives. 

php_admin_value name value 
Sets the value of the specified directive. This can NOT be used in .htaccess files. Any directive type set with php_admin_value can not be overridden in .htaccess files. 

php_admin_flag name on|off 
Used to set a Boolean configuration directive. This can NOT be used in .htaccess files. Any directive type set with php_admin_flag can not be overridden in .htaccess files. 


Example 4-2. Apache configuration example 

<IfModule mod_php4.c> 
php_value include_path ".:/usr/local/lib/php" 
php_admin_flag safe_mode on 
</IfModule> 
<IfModule mod_php3.c> 
php3_include_path ".:/usr/local/lib/php" 
php3_safe_mode on 
</IfModule>

 一颗小白菜 回复于:2003-01-19 14:00:30[quote:d0206cc7c3="南非蜘蛛"]原来有php专家,我就不献丑了,呵呵,谢谢小白菜[/quote:d0206cc7c3]

嘿~~  蜘蛛也在讽刺我了?嘿嘿    这里可是你的地盘哦  嘿嘿

我也只是前几天看文档的时候才注意到的

 南非蜘蛛 回复于:2003-01-19 14:04:23共同学习,我看了两天资料,系统的学习了一下,apache真是博大精深呀

[] [返回上一页] [打 印] [收 藏]  
 ∷相关技术评论  (评论内容只代表网友观点,与本站立场无关!) [查看发表评论...]
 
 中国教育资源网免费技术教程下载中心-站内广告 站内广告 中国教育资源网免费技术教程下载中心-站内广告 
 中国教育资源网站内搜索 站内搜索 中国教育资源网站内搜索 
 

   
 中国教育资源网免费技术教程下载中心-栏目导航 栏目导航 中国教育资源网免费技术教程下载中心-栏目导航 
· Windows 9XMEXP · Windows NT20002003
· LinuxBSD · 系统综合
· IISApache · 硬件技术
· Web服务器 · FTP服务器
· 邮件服务器 · 域名服务器
· Windows服务器 · 代理服务器
· 服务器综合
 
中国教育资源网免费技术教程下载中心-相关教程  相关技术 中国教育资源网免费技术教程下载中心-相关教程
· win2k下apache支持a
· 用PHP计算身份证校验
· 用php写的serv-u的w
· 用PHP实现完美的关键
· 用PHP实现自己的
· [图文] Apache服务器的安装
· Apache服务器的安全
· 浅析Apache中SSI和C
· Apache+Tomcat实现W
· Apache+Tomcat实现W
 中国教育资源网免费技术教程下载中心-本月热门教程 本月热门 中国教育资源网免费技术教程下载中心-本月热门教程 
 
 中国教育资源网免费技术教程下载中心-本日热门论文 本日热门 中国教育资源网免费技术教程下载中心-本日热门论文 
 
关于本站 - 网站帮助 - 免费课件 - 美容 - 绿色软件 - 软件下载 - 广告合作 - 下载声明 - 友情连接 - 网站地图 - 网站留言
浙ICP备06010405号 Email:cnkjz@163.com 技术支持:名流设计
版权所有 Copyright© 2002-2004 名流