Apache Reference Manual (3)

 更新时间:2016年11月25日 15:17  点击:1971
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

在多数WEB开发者眼中,ASP和JSP都被认为是领跑者,而PHP却被认为是个弱小的“挣扎者”,或者说它是一门被贬低为业余者才使用的语言,不值得参与企业WEB开发的竞争。在我看来,PHP没有被当作竞争者的理由是评论者缺乏对它的了解,而且也不了解用于WEB开发的其他操作系统。和一些观点相反,Windows不再占有WEB虚拟主机服务市场的最大份额,我猜想它在WEB开发这一领域里也在被摧城拔寨。

在企业开发里为什么没有PHP?

很显然,PHP被认为落后ASP和JSP太多,以至于它是没有什么用的,但是这恰恰与事实不符。PHP本身就是一门强大的语言。它事实上在每个发行版的Linux上都有,在Mac OS X上也有。获取开发和使用PHP代码的构件(building-block)工具和软件都是免费的。用于开发PHP应用程序的商业集成开发环境(commercial integrated development environments,IDES)也可以找到——这样的工具有Komodo(它运行在Linux和Windows上)和Zend Studio(这个应用程序能够运行在任何带有Java运行环境的操作系统上)。你几乎可以在每个WEB虚拟主机上运行由PHP建立的网站,而不要考虑服务器所运行的是什么操作系统,这一事实让PHP更加具有吸引力。
PHP能够提供什么?
先把PHP周围有什么忘掉一会儿,而考虑一下PHP自身能够提供什么。它是一门强健的服务器端语言,能够提供相当多的功能,而且能够迅速地为页面提供服务。
容易使用
使用C或者Perl或者具有类似风格和句法的另一种语言的任何用户都能够很快上手PHP。尽管它是设计用在WEB上的,但是它也能够作为命令行语言使用。你正在编写的WEB应用程序需要每个小时或者每天执行一次某些代码吗?使用cron或者类似的计划安排管理器,你可以计划安排PHP代码在你希望的时候执行,使用普通的命令解释脚本或者批处理文件就能够执行这样的代码。不需要自动调用浏览器就能够查看专门的网页,从而执行你的事件,也没有必要依赖来访者的点击来告诉你的系统:特定的代码需要在特定的时候被执行。PHP在这一领域可扩展性的事实是绝对具有吸引力的。
PHP的好处
我不是JSP或者ASP的老手,在此我也不想贬低这些语言。相反,我会把注意力放在PHP的好处上。
本地化
PHP让你能够为网站的访问者提供本地化的服务。当用户点击进入网站的时候,网站会根据他们浏览器的设置自动地以其母语向其提供页面。要实现这一点不需要使用用于语言翻译的烦杂文件,而是使用和本地化的C程序所具有的相同能力,通过一个叫做gettext的系统实现的。如果被请求的语言文件存在,那么用户所看到的文本就是其母语;如果语言文件不存在,那么文本就是缺省的英语或者其他任何你所指定的语言。许多本地化的UNIX应用程序都将gettext作为标准,它让第三方的翻译变得轻而易举。
轻易地使用命令行
PHP支持在需要的地方设置和执行命令行程序。使用标准的UNIX diff工具,它能够生成错误最后一次修改同要使用电子邮件发送到错误的所有者的当前注释之间的不同。PHP代码对在系统上所编写的两个文件执行diff,将其输出作为输入,再生成一个要发送的电子邮件。这封电子邮件是通过PHP自己来发送的。

其他好处
上面的只是我在自己程序里所用到的强大功能中的两个,而还其他的功能。例如,你可以:

即时创建简单的Flash动画。
即时创建PDF文档。
使用高级数学功能,以及面向对象的编程技术。
读取和写入到本地和IMAP邮箱。
在PHP里就可以使用任何标准的Internet协议。想要编写基于PHP的FTP、WEB或者新闻客户端?没有问题!只使用PHP你就完全能够编写出使用标准TCP/IP套接字的客户端和服务器,并以此创建自己的协议。
实现对加密的支持,以及对各种数据库服务器的支持。
缺乏远见的评论

我觉得,那些寻找顶级WEB开发语言而排除掉PHP的人是极其短见的。我使用PHP编写代码已经有很多年了,无论是像错误追踪系统这样的高级功能,还是简单地重复使用页眉和页脚这样的普通功能,我都使用PHP编写过。我用PHP编写过半静态的页面,也编写过全功能的多媒体演示。我不是唯一一个使用PHP的人。如果PHP不值得引起注意,如果它只是小儿科或者爱好者的语言,那它为什么会是在WEB开发上成长最快的语言呢?如果它没有ASP或者JSP那么强大,那么它为什么会被用在流量巨大WEB网站上?例如Yahoo,据说它就是由PHP建成的。


开发人员习惯用熟悉的产品

我敢肯定,ASP 和JSP有它们各自的强项,但是我相信人们是用它们不是因为它们能够提供比PHP更加强大的功能,而是因为人们已经了解了它们,并希望以自己习惯的方法编写代码。排除PHP只能表示对这一语言的无知。

<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.
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。
好了,大功告成了!

[!--infotagslink--]

相关文章

  • Lua语言新手简单入门教程

    这篇文章主要给大家介绍的是关于Lua语言新手入门的简单教程,文中通过示例代码一步步介绍的非常详细,对各位新手们的入门提供了一个很方便的教程,需要的朋友可以参考借鉴,下面随着小编来一起学习学习吧。...2020-06-30
  • lua读取redis数据的null判断示例代码

    最近在工作中遇到了一个问题,通过查找相关资料才得知原因是因为返回结果的问题,下面这篇文章主要给大家介绍了关于lua读取redis数据的null判断的相关资料,文中通过示例代码介绍的非常详细,需要的朋友可以参考下...2020-06-30
  • Django def clean()函数对表单中的数据进行验证操作

    这篇文章主要介绍了Django def clean()函数对表单中的数据进行验证操作,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧...2020-07-09
  • C#中out与ref的区别实例解析

    这篇文章主要介绍了C#中out与ref的区别实例解析,对C#初学者有不错的学习借鉴价值,需要的朋友可以参考下...2020-06-25
  • 记一次EFCore类型转换错误及解决方案

    这篇文章主要介绍了记一次EFCore类型转换错误及解决方案,帮助大家更好的理解和学习使用asp.net core,感兴趣的朋友可以了解下...2021-09-22
  • Vue3中reactive函数toRef函数ref函数简介

    这篇文章主要介绍了Vue3中的三种函数,分别对reactive函数toRef函数以及ref函数原理及使用作了简单介绍,有需要的朋友可以借鉴参考下...2021-09-24
  • Apache启动报错No space left on device: AH00023该怎么解决

    Apache启动报错No space left on device: AH00023错误可能是进程导致了,虽然小编不知道什么原因但网上提供的解决办法确实是可以解决我们的问题,下面来看看。对于这类错误是因为linux系统的ipc信号量造成的,apache启动时...2015-10-21
  • c#基础系列之ref和out的深入理解

    有过C#基础知识的都应该清楚Ref和Out的使用方法,所以下面这篇文章主要给大家介绍了关于c#基础系列之ref和out的相关资料,文中通过示例代码介绍的非常详细,需要的朋友可以参考借鉴,下面随着小编来一起学习学习吧...2020-06-25
  • apache配置黑名单和白名单及账户权限控制

    本文我们将分享apache配置黑名单和白名单,apache层的账户权限控制,以及apache黑名单白名单过滤功能,apache rewrite规则实现白名单。 apache配置黑名单和白名单的两...2016-09-14
  • Lua判断变量是否为数字、字符串是否可以转换为数字等

    这篇文章主要介绍了Lua判断变量是否为数字、字符串是否可以转换为数字等,本文讲解了Lua 判断是字符还是数字的方法、Lua判断数字的方法、判断可否转换为数字的方法、判断并且准备一个初值的方法,需要的朋友可以参考下...2020-06-30
  • apache开启gzip详解教程

    今天在用百度工具检测时发,发现有个提示如下 原来可以开启gzip啊,因为我的是apache所以和iis不同,经过网站搜索开启方法如下 一,找到你的httpd.conf文件,打开找到如下 ...2016-01-28
  • 解决PHPstudy Apache无法启动的问题【亲测有效】

    这篇文章主要介绍了PHPstudy Apache无法启动的问题及解决方法【亲测有效】,本文给大家总结了三种方法供大家参考,需要的朋友可以参考下...2020-10-30
  • apache http server遇到了一个问题,需要关闭

    重装系统后,重新安装了xamp,最近启动的时候经常报apache http server遇到了一个问题,需要关闭,显示如图: 解决方法:查看szModName报错的模块,然后把PHP安装目录下对应的模块...2016-01-28
  • Windows Server 2016 上配置 APACHE+SSL+PHP+perl的教程详解

    Windows Server 2016 上配置 APACHE+SSL+PHP+perl怎么配置?小编推荐了一篇介绍Windows Server 2016 上配置 APACHE+SSL+PHP+perl的教程,有需要的同学快来看看吧! ...2017-07-06
  • nginx+apache+mysql+php+memcached+squid搭建集群web环境

    当前,LAMP开发模式是WEB开发的首选,如何搭建一个高效、可靠、稳定的WEB服务器一直是个热门主题,本文就是这个主题的一次尝试。...2016-01-27
  • 详解Ref在React中的交叉用法

    众所周知,react推出了hooks之后,很多项目就开始往hooks上靠拢,所以也就出现了class和hooks交叉使用的项目。这个时候使用ref需要注意一些东西...2021-06-20
  • Lua流程控制语句if else的使用示例

    今天小编就为大家分享一篇关于Lua流程控制语句if else的使用示例,小编觉得内容挺不错的,现在分享给大家,具有很好的参考价值,需要的朋友一起跟随小编来看看吧...2020-06-30
  • 隐藏Nginx或Apache以及PHP的版本号的方法

    这篇文章主要介绍了隐藏Nginx或Apache以及PHP的版本号的方法,主要用来防止针对性的漏洞攻击,需要的朋友可以参考下...2016-01-05
  • apache下设置缓存方法详细介绍

    默认情况下,apache安装完以后,是不允许被cache的。如果外接了cache或squid服务器要求进行web加速的话,就需要在htttpd.conf里进行设置,当然前提是在安装apache的时候要激活mod_c...2016-01-28
  • Lua的table库函数insert、remove、concat、sort详细介绍

    这篇文章主要介绍了Lua的table库函数insert、remove、concat、sort详细介绍,本文分别给出了这几个函数的使用实例,需要的朋友可以参考下...2020-06-30