首页 > 编程技术 > php

Apache Reference Manual (4)

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

<DirectoryMatch>
Syntax: <DirectoryMatch regex> ... </DirectoryMatch>
Context: server config, virtual host
Status: Core.
Compatibility: Available in Apache 1.3 and later
<DirectoryMatch> and </DirectoryMatch> are used to enclose a group of directives which will apply only to the named directory and sub-directories of that directory, the same as <Directory>. However, it takes as an argument a regular expression. For example:
     <DirectoryMatch "^/www/.*/[0-9]{3}">
would match directories in /www/ that consisted of three numbers.
See Also: <Directory> for a description of how regular expressions are mixed in with normal <Directory>s.
See also: How Directory, Location and Files sections work for an explanation of how these different sections are combined when a request is received
--------------------------------------------------------------------------------
DocumentRoot directive
Syntax: DocumentRoot directory-filename
Default: DocumentRoot /usr/local/apache/htdocs
Context: server config, virtual host
Status: core
This directive sets the directory from which httpd will serve files. Unless matched by a directive like Alias, the server appends the path from the requested URL to the document root to make the path to the document. Example:
DocumentRoot /usr/web
then an access to http://www.my.host.com/index.html refers to /usr/web/index.html.
There appears to be a bug in mod_dir which causes problems when the DocumentRoot has a trailing slash (i.e., "DocumentRoot /usr/web/") so please avoid that.
--------------------------------------------------------------------------------
ErrorDocument directive
Syntax: ErrorDocument error-code document
Context: server config, virtual host, directory, .htaccess
Status: core
Override: FileInfo
Compatibility: The directory and .htaccess contexts are only available in Apache 1.1 and later.
ContentDigest directive
Syntax: ContentDigest on|off
Default: ContentDigest off
Context: server config, virtual host, directory, .htaccess
Override: Options
Status: experimental
Compatibility: ContentDigest is only available in Apache 1.1 and later
This directive enables the generation of Content-MD5 headers as defined in RFC1864 respectively RFC2068.
MD5 is an algorithm for computing a "message digest" (sometimes called "fingerprint") of arbitrary-length data, with a high degree of confidence that any alterations in the data will be reflected in alterations in the message digest.
The Content-MD5 header provides an end-to-end message integrity check (MIC) of the entity-body. A proxy or client may check this header for detecting accidental modification of the entity-body in transit. Example header:
     Content-MD5: AuLb7Dp1rqtRtxz2m9kRpA==
Note that this can cause performance problems on your server since the message digest is computed on every request (the values are not cached).
Content-MD5 is only sent for documents served by the core, and not by any module. For example, SSI documents, output from CGI scripts, and byte range responses do not have this header.
--------------------------------------------------------------------------------
CoreDumpDirectory directive
Syntax: CoreDumpDirectory directory
Default: the same location as ServerRoot
Context: server config
Status: core
This controls the directory to which Apache attempts to switch before dumping core. The default is in the ServerRoot directory, however since this should not be writable by the user the server runs as, core dumps won't normally get written. If you want a core dump for debugging, you can use this directive to place it in a different location.
--------------------------------------------------------------------------------
DefaultType directive
ServerRoot directive
Syntax: ServerRoot directory-filename
Default: ServerRoot /usr/local/apache
Context: server config
Status: core
The ServerRoot directive sets the directory in which the server lives. Typically it will contain the subdirectories conf/ and logs/. Relative paths for other configuration files are taken as relative to this directory.
See also the -d option to httpd.
See also the security tips for information on how to properly set permissions on the ServerRoot.
--------------------------------------------------------------------------------
ServerSignature directive
Syntax: ServerSignature Off | On | EMail
Default: ServerSignature Off
Context: server config, virtual host, directory, .htaccess
Status: core
Compatibility: ServerSignature is only available in Apache 1.3 and later.
The ServerSignature directive allows the configuration of a trailing footer line under server-generated documents (error messages, mod_proxy ftp directory listings, mod_info output, ...). The reason why you would want to enable such a footer line is that in a chain of proxies, the user often has no possibility to tell which of the chained servers actually produced a returned error message.
The Off setting, which is the default, suppresses the error line (and is therefore compatible with the behavior of Apache-1.2 and below). The On setting simply adds a line with the server version number and ServerName of the serving virtual host, and the EMail setting additionally creates a "mailto:" reference to the ServerAdmin of the referenced document.
--------------------------------------------------------------------------------
ServerTokens directive
Syntax: ServerTokens Minimal|OS|Full
Default: ServerTokens Full
Context: server config
Status: core
Compatibility: ServerTokens is only available in Apache 1.3 and later
This directive controls whether Server response header field which is sent back to clients includes a description of the generic OS-type of the server as well as information about compiled-in modules.
 PHP是一种领先于ASP的技术。与ASP相比,它具有速度快、稳定性高、跨平台、易学习等优点。ASP学习者使用的OS几乎都是Windows平台,上面无疑都装有IIS。PHP所需求的服务器支持主要是由Apache提供的。事实上,IIS也可以提供这样的支持,具体步骤如下:
    1.    下载PHP。推荐网址:http://www.onlinedown.net/soft/1774.htm    下载后解压到一个文件夹里,推荐解压:C:php 里。以下都将使用这一文件夹描述。
    2.    将C:php里的dlls文件夹里的所有文件复制并粘贴到C:winnt ystem32里。再将C:php下的php4ts.dll复制到C:winnt ystem32下。
    3.    用记事本打开C:php下的php.ini-dist文件。找到如下一行:extension_dir = "./" 将其改为 extension_dir = C:php 将其保存到C:winnt ystem32下,注意:名为php.ini
    4.    首先打开控制面板-〉管理工具-〉internet服务管理器-〉展开左边的目录树-〉默认web站点-〉点击右键-〉属性-〉isapi筛选器->添加->筛选器名称:php;可执行文件:C:php apiphp4isapi.dll 然后再打开默认web站点属性面板下的主目录-〉配置-〉添加-〉可执行文件:C:php apiphp4isapi.dll;扩展名:php。
好了,大功告成了!

作为一个新生事物,Linux吸引了不少眼球,但是它能否快捷、方便地与Windows资源共享,是一个很重要的问题。大家知道,Windows之间可以利用“网络邻居”来实现资源共享,而Linux之间可以使用NFS来实现资源共享。那么,Linux与Windows之间呢?
Linux可以通过Samba来实现和Windows主机互通有无的。Samba采用Client/Server架构,执行Samba客户端程序,就可以访问Windows主机上的共享资源;而运行Samba服务器,Windows主机就可以访问Linux上的共享资源。下面以Red Hat 8.0为例,介绍在Linux环境里如何访问Windows共享资源。
  安装Samba
  如果不能确定是否已经安装了Samba软件包,可以在终端窗口执行以下命令进行查询:
$ rpm -qa | grep samba
  如果查询结果出现如图1所示的三个软件包,则表示已经安装Samba软件包。

  图一:查询是否安装Samba软件包
  如果没有安装过Samba软件包,则可以插入Red Hat 8.0第二张安装光盘,然后按照下面的步骤进行安装(以KDE环境为例):
  1. 鼠标依次单击主选单→系统设置→“软件包”选单项,将会打开“软件包管理”对话框。
  2. 在该对话框里找到“Windows文件服务器”,确保已经勾选该选项,然后单击对话框底部的“更新”按钮,如图2所示。
  3. 安装Samba软件包。

  图三:安装Samba软件包
  整个过程非常简单,系统会自动检测软件包之间的依赖性,完全不用操心。
  用命令方式访问Windows
  安装好Samba之后,就可以让它大显身手了。这里先介绍如何用字符命令方式访问Windows共享资源。
  1. 查询Windows主机的共享资源
  查询Windows主机的共享资源可以使用smbclient -L WindowsHostName命令。例如,要查询一台名为Peter的Windows主机上的共享资源,可以在终端窗口输入:
smbclient -L Peter
  然后回车即可。该命令的具体使用方法如图3所示。该命令可以准确地检查出Windows主机的共享文件夹,并且对中文文件名的支持也很好。

  图三:查询Windows主机的共享资源
  2. 连接Windows主机的共享目录
  我们可以使用“smbclient //WindowsHostName/ShareName”命令,连接Windows主机上的某个共享文件夹。如果该共享文件夹需要用户名和密码,则可以使用“smbclient //WindowsHostName/ShareName -U UserName”命令。例如,要连接Windows主机Peter上的共享目录Share,可以在终端窗口输入:
标签:[!--infotagslink--]

您可能感兴趣的文章: