首页 > 编程技术 > php

Apache Reference Manual (2)

发布时间:2016-11-25 15:18

AuthName directive
Syntax: AuthName auth-domain
Context: directory, .htaccess
Override: AuthConfig
Status: core
This directive sets the name of the authorization realm for a directory. This realm is given to the client so that the user knows which username and password to send. AuthName takes a single argument; if the realm name contains spaces, it must be enclosed in quotation marks. It must be accompanied by AuthType and require directives, and directives such as AuthUserFile and AuthGroupFile to work.
--------------------------------------------------------------------------------
AuthType directive
Syntax: AuthType type
Context: directory, .htaccess
Override: AuthConfig
Status: core
This directive selects the type of user authentication for a directory. Only Basic and Digest are currently implemented. It must be accompanied by AuthName and require directives, and directives such as AuthUserFile and AuthGroupFile to work.
--------------------------------------------------------------------------------
BindAddress directive
Syntax: BindAddress saddr
Default: BindAddress *
Context: server config
Status: core
A Unix® http server can either listen for connections to every IP address of the server machine, or just one IP address of the server machine. Saddr can be
*
An IP address
A fully-qualified Internet domain name
If the value is *, then the server will listen for connections on every IP address, otherwise it will only listen on the IP address specified.
Only one BindAddress directive can be used. For more control over which address and ports Apache listens to, use the Listen directive instead of BindAddress.
BindAddress can be used as an alternative method for supporting virtual hosts using multiple independent servers, instead of using <VirtualHost> sections.
See Also: DNS Issues
See Also: Setting which addresses and ports Apache uses
基于各种各样的理由,PHP 的设置需要依赖于 register_globals
参数打开,但是也成为安全的重要隐患,请看下面的一段代码:
<?php
if (authenticate_user()) {
$authenticated = true;
}
...
?>
远程用户可以简单的传递 'authenticated' 作为表单变量,即使
authenticate_user() 函数返回 false,$authenticated 还是会设置成 true。这是一个简单的例子,你或许会说,我的程序不会这样来写。
而实际上,在稍微复杂一些的应用里面,这个机制就会成为重大的漏洞。
因此,新版本的 PHP ,我们建议用户不要采用这个变量来控制应用,虽然我们没有打算要在不久的将来删除。
为了帮助用户建立 register_globals 设置为 off 的应用,增加了一些变量来代替旧的,下面是7 个新的数组:
$_GET - 包含了通过 GET 发送的表单变量
$_POST - 包含了通过 POST 发送的表单变量
$_COOKIE - 包含了 HTTP cookie 变量
$_SERVER - 包含服务器端变量 (例如:REMOTE_ADDR)
$_ENV - 包含环境变量
$_REQUEST - GET 变量,POST 变量和 Cookie 变量的混合,通过用户而来而不能信任的变量。
$_SESSION - 包含通过会话模块注册的 HTTP 变量
这些变量,在任何范围内,都自动设置为全局变量,可以在任何地方调用,而不需要加 global 关键字。
例如:
function example1()
{
print $_GET["name"]; // 没有必要写成:'global $_GET;'
}
另外一个值得一提的小窍门是在 $_SESSION 数组中增加一个记录能自动作为会话变量注册,就像你调用了
session_register() 函数。

KeepAliveTimeout directive
Syntax: KeepAliveTimeout seconds
Default: KeepAliveTimeout 15
Context: server config
Status: Core
Compatibility: KeepAliveTimeout is only available in Apache 1.1 and later.
The number of seconds Apache will wait for a subsequent request before closing the connection. Once a request has been received, the timeout value specified by the Timeout directive applies.
--------------------------------------------------------------------------------
<Limit> directive
Syntax: <Limit method method ... > ... </Limit>
Context: any
Status: core
Access controls are normally effective for all access methods, and this is the usual desired behaviour. In the general case, access control directives should not be placed within a <limit> section.
The purpose of the <Limit> directive is to restrict the effect of the access controls to the nominated HTTP methods. For all other methods, the access restrictions that are enclosed in the <Limit> bracket will have no effect. The following example applies the access control only to the methods POST, PUT, and DELETE, leaving all other methods unprotected:
<Limit POST PUT DELETE>
require valid-user
</Limit>
The method names listed can be one or more of: GET, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE, PATCH, PROPFIND, PROPPATCH, MKCOL, COPY, MOVE, LOCK, and UNLOCK. The method name is case-sensitive. If GET is used it will also restrict HEAD requests.
--------------------------------------------------------------------------------
<LimitExcept> directive
Syntax: <LimitExcept method method ... > ... </LimitExcept>
Context: any
Status: core
Compatibility: Available in Apache 1.3.5 and later
<LimitExcept> and </LimitExcept> are used to enclose a group of access control directives which will then apply to any HTTP access method not listed in the arguments; i.e., it is the opposite of a <Limit> section and can be used to control both standard and nonstandard/unrecognized methods. See the documentation for <Limit> for more details.
如今网络技术如日中天,才见CGI(Common Gateway Interface)又出ASP(Active Serve Page),接着杀出PHP(见后注),真是令人手忙脚乱目不暇接。这些新软件的出现,不仅给我们带来了全新的感受,同时也给我等配置较低的机器如何玩这些软件带来了问题,本文就我自己的体会,阐述在较低机器配置下如何安装PHP4.0软件。
 
  本人的“爱鸡”配置是:联想天琴909的改造产品:MMX166换成K6Ⅱ-400,内存仍为32兆字节,主板核心电压跳到2.2V……    
  软件只需要Windows 98+PWS(Personal Web Server),NT、LINUX、Win 2000一律不用装。安装过程如下:    
  1、您可以从Windows 98(正式版或OEM版)的安装盘的add-onspwssetup.exe中安装PWS,选典型安装或定制安装,使用缺省安装目录C:Inetpubwwwroot(完成单机改造成服务器的宏伟工程)。
 
  2、软件下载:http://www.php.net/distributions/php-4.0.0-Win32.zip或http://soft.km169.net/soft/wybc/php-4.0.0-win32.zip!    
  3、用解压缩工具把php-4.0.0-Win32.zip解压到PHP安装目录,如C:php(可不要说你没有WinZip呀)!    
  4、将PHP安装目录下的php.ini-dist文件拷贝到C:WINDOWS目录,并将C:WINDOWSphp.ini-dist改名为C:WINDOWSphp.ini;    
  5、将PHP安装目录下的Msvcrt.dll和php4ts.dll拷贝到C:WINDOWSSystem目录,如果C:WINDOWSSystem目录下已经存在这些文件,请不要覆盖(事先查找一下有无Msvcrt.dll);    
  6、修改C:WINDOWSphp.ini:    
  1) 将Extension_dir设置为PHP安装目录,如:extension_dir =C:php(在php.ini中左看右看,即可找到);    
  2) 配置要加载的动态链接库(DLL),注意一定要保证只能加载PHP安装目录下存在的动态链接库,如有不同的动态链接库名称,请改成与该版本自带这些动态链接库:php_calendar.dll、php_imap.dll、php_ldap.dll相一致,因此动态链接库的配置栏如下(一定要将;去掉):    
  Windows Extensions    
  extension=php_calendar.dll    
  extension=php_imap.dll    
在RedHat6.2上安装apache1.3.12+gd1.8.3+php4.04+tomcat+sybase11.9.2+oracle8.1.6+mysql全攻略 <br>
<br>
看了网上众多网友对php、jsp、sybase、oracle、apache等方面的安装经验,发现有很多都是重复而且不够全面,根据本人对以上各种东东长期总结和参考相关文档以及各位网友的文章,并经自己亲自实践,现将在RedHat6.2下apache1.3.12+gd1.8.3+php4.04+tomcat+sybase11.9.2+oracle8.1.6+mysql3.22.27的安装配置全部奉献给大家,希望能对大家有所帮助; <br>
<br>
运行环境:PⅢ550+256M+20G+530TX Lan+sis6326 8M+RedHat Linux6.2 <br>
安装规划:sybase安装在/sybase目录 <br>
oracle安装在/home/oracle目录 <br>
gd安装在/usr/local目录 <br>
apache安装在/www目录 <br>
tomcat安装在/usr/local/jakarta-tomcat目录 <br>
jdk安装在/usr/local/jdk122目录 <br>
<br>
一、资料准备 <br>
1、apache_1312.tar.gz <br>
2、php-404.tar.gz <br>
3、jakarta-tomcat.tar.gz <br>
4、sybase11.9.2包: <br>
sybase-common-1192-1i386.rpm <br>
sybase-ase-1192-1i386.rpm <br>
sybase-monserver-1192-1i386.rpm <br>
sybase-openclient-1111-1i386.rpm <br>
sybase-sqlremote-602-1i386.rpm <br>
sybase-chinese-1192-1i386.rpm <br>
5、oracle8.1.6.tar <br>
6、mysql3.22.27包: <br>
mysql-3.22.27-1.i386.rpm <br>
mysql-devel-3.22.27-1.i386.rpm <br>
mysql-client-3.22.27-1.i386.rpm <br>
7、jdk1_2_2-linux-i386.tar.gz <br>
8、mod-jserv.so <br>
9、gd183.tar.gz <br>
<br>
二、环境配置 <br>
1、系统安装 <br>
安装linux系统时创建目录/www、/sybase和/home并分配给各自较大空间,用于存储数据库资料和网页文件; <br>
2、环境变量 <br>
配置运行oracle和tomcat以及java的java运行环境变量 <br>
用root用户登录系统 <br>
#vi /etc/profile <br>
添加下列行 <br>
ORACLE_HOME=/home/oracle <br>
标签:[!--infotagslink--]

您可能感兴趣的文章: