Apache Reference Manual (8)

 更新时间:2016年11月25日 15:17  点击:1890
MaxRequestsPerChild directive
Syntax: MaxRequestsPerChild number
Default: MaxRequestsPerChild 0
Context: server config
Status: core
The MaxRequestsPerChild directive sets the limit on the number of requests that an individual child server process will handle. After MaxRequestsPerChild requests, the child process will die. If MaxRequestsPerChild is 0, then the process will never expire.
Setting MaxRequestsPerChild to a non-zero limit has two beneficial effects:
it limits the amount of memory that process can consume by (accidental) memory leakage;
by giving processes a finite lifetime, it helps reduce the number of processes when the server load reduces.
This directive has no effect on Win32.
NOTE: For KeepAlive requests, only the first request is counted towards this limit. In effect, it changes the behavior to limit the number of connections per child.
--------------------------------------------------------------------------------
MaxSpareServers directive
Syntax: MaxSpareServers number
Default: MaxSpareServers 10
Context: server config
Status: core
The MaxSpareServers directive sets the desired maximum number of idle child server processes. An idle process is one which is not handling a request. If there are more than MaxSpareServers idle, then the parent process will kill off the excess processes.
Tuning of this parameter should only be necessary on very busy sites. Setting this parameter to a large number is almost always a bad idea.
This directive has no effect when used with the Apache Web server on a Microsoft Windows platform.
See also MinSpareServers and StartServers.
--------------------------------------------------------------------------------
MinSpareServers directive
Syntax: MinSpareServers number
Default: MinSpareServers 5
Context: server config
Status: core
The MinSpareServers directive sets the desired minimum number of idle child server processes. An idle process is one which is not handling a request. If there are fewer than MinSpareServers idle, then the parent process creates new children at a maximum rate of 1 per second.
<FilesMatch>
Syntax: <FilesMatch regex> ... </FilesMatch>
Context: server config, virtual host, .htaccess
Status: core
Compatibility: only available in Apache 1.3 and above.
The <FilesMatch> directive provides for access control by filename, just as the <Files> directive does. However, it accepts a regular expression. For example:
     <FilesMatch ".(gif|jpe?g|png)$">
would match most common Internet graphics formats.
See also: How Directory, Location and Files sections work for an explanation of how these different sections are combined when a request is received
--------------------------------------------------------------------------------
Group directive
Syntax: Group unix-group
Default: Group #-1
Context: server config, virtual host
Status: core
The Group directive sets the group under which the server will answer requests. In order to use this directive, the stand-alone server must be run initially as root. Unix-group is one of:
A group name
Refers to the given group by name.
# followed by a group number.
Refers to a group by its number.
It is recommended that you set up a new group specifically for running the server. Some admins use user nobody, but this is not always possible or desirable.
Note: if you start the server as a non-root user, it will fail to change to the specified group, and will instead continue to run as the group of the original user.
Special note: Use of this directive in <VirtualHost> requires a properly configured suEXEC wrapper. When used inside a <VirtualHost> in this manner, only the group that CGIs are run as is affected. Non-CGI requests are still processed as the group specified in the main Group directive.
SECURITY: See User for a discussion of the security considerations.
--------------------------------------------------------------------------------
php: PHP Version 5.0.0b4
apache: Apache/2.0.49 (Win32)
1,做为cgi来运行
2,做为module来运行
1,做为apache2的cgi运行
ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php-cgi.exe"
上面的代码添加到httpd.conf
2,做为apache的模块运行
LoadModule php5_module "c:/php/sapi/php5apache2.dll"
AddType application/x-httpd-php .php
上面的代码添加到httpd.conf
有时候,我们需要在WINDOWS服务器中安装多个不同版本的PHP环境,或采用不同的php.ini配置,例如在使用中国E商务网的IONCUBE系统对PHP程序进行加密后,要在php.ini中设置加载选项目,但这个选项和zend加密程序解释器不能同时存在,如果在服务器中有另外程序采用ZEND加密的话,就非常可惜。
    如果能在WINDOWS服务器中装多套PHP,使用不同的PHP.INI就可以解决这样的问题。但是如果采用正规的方法要重新编译PHP,比较麻烦。我们最近已经研究成功,采用另一种方式来安装多个PHP:
    首先安装一套PHP,采用默认方式,装在c:php ,安装后,php.ini一般自动复制到c:winnt下。
    将winnt下的php.ini用Ctrl+c和 Ctrl+V方式复制到c:php下,这时候你可以用PHPINFO()查看php.ini的路径,已经自动变成c:/php/php.ini 了。
    接着,就可以安装第二套PHP,最好换个磁盘,安装在d:php,安装时,PHP又会把php.ini拷贝在c:winnt下,只要如法炮制将其拷贝到d:php下就可以了。
    然后,在IIS -> 主目录->配置中,可以为不同站点指定不同的PHP运行文件就可以了。
     采用此方法安装两套PHP后,对系统资源并没有特别的影响,经测试,系统运行正常。

运行PHP软件包的安装程序,在弹出的欢迎窗口中单击“Next”按钮,接着在“许可协议”窗口中单击“I Agree”按钮,然后在安装类型(Installation Type)窗口中选择“标准(Standard)”安装,点击“Next”按钮后,指定PHP的安装目录,建议使用默认安装目录。接着“Mail configuration”窗口中设置邮件地址和指定SMTP服务器,在“服务类型(Server Type)”窗口中选择你使用的Web服务器的类型(如图2),因为我们使用Windows XP系统自带的IIS5.1,选择“Microsoft iis4 or higher”单选项,点击“下一步”后开始安装,最后在“IIS Scriptmap Node selection”窗口中选中所有的站点(如图3),点击“OK”按钮,就完成了PHP的安装和配置。
图3选中所有站点
    检查PHP调试环境配置
  进入到“控制面板→管理工具”,运行Internet信息服务程序,右键点击“默认网站”在弹出的菜单中选择“属性”,接着在弹出的属性对话框中切换到“主目录”标签页,点击应用程序设置栏中的“配置”按钮,弹出“应用程序配置”对话框,在“映射”标签页中,查看应用程序映射列表框中是否有扩展名为“.php”的选项(如图4),如果存在则表示PHP安装配置成功。
图4查看程序映射
    如果没有找到该选项,也可以手工添加。在应用程序配置对话框中点击“添加”按钮,弹出“添加/编辑应用程序扩展名映射”对话框(如图5),在“可执行文件”栏中输入“php.exe”程序路径,“扩展名”中输入“.PHP”,其它选项使用默认设置,最后点击“确定”按钮即可。
图5手工添加映射
    这样就完成了PHP调试环境的配置,以后就可以在IIS中调试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