php resource id 9,Apache Reference Manual (9)-PHP教程,系统相关

pidfile directive

syntax: pidfile filename

default: pidfile logs/httpd.pid

context: server config

status: core

the pidfile directive sets the file to which the server records the process id of the daemon. if the filename does not begin with a slash (/) then it is assumed to be relative to the serverroot. the pidfile is only used in standalone mode.

it is often useful to be able to send the server a signal, so that it closes and then reopens its errorlog and transferlog, and re-reads its configuration files. this is done by sending a sighup (kill -1) signal to the process id listed in the pidfile.

the pidfile is subject to the same warnings about log file placement and security.

——————————————————————————–

port directive

syntax: port number

default: port 80

context: server config

status: core

number is a number from 0 to 65535; some port numbers (especially below 1024) are reserved for particular protocols. see /etc/services for a list of some defined ports; the standard port for the http protocol is 80.

the port directive has two behaviors, the first of which is necessary for ncsa backwards compatibility (and which is confusing in the context of apache).

in the absence of any listen or bindaddress directives specifying a port number, a port directive given in the "main server" (i.e., outside any section) sets the network port on which the server listens. if there are any listen or bindaddress directives specifying :number then port has no effect on what address the server listens at.

the port directive sets the server_port environment variable (for cgi and ssi), and is used when the server must generate a url that refers to itself (for example when creating an external redirect to itself). this behaviour is modified by usecanonicalname.

in no event does a port setting affect what ports a virtualhost responds on, the virtualhost directive itself is used for that.

the primary behaviour of port should be considered to be similar to that of the servername directive. the servername and port together specify what you consider to be the canonical address of the server. (see also usecanonicalname.)

port 80 is one of unixs special ports. all ports numbered below 1024 are reserved for system use, i.e., regular (non-root) users cannot make use of them; instead they can only use higher port numbers. to use port 80, you must start the server from the root account. after binding to the port and before accepting requests, apache will change to a low privileged user as set by the user directive.

if you cannot use port 80, choose any other unused port. non-root users will have to choose a port number higher than 1023, such as 8000.

security: if you do start the server as root, be sure not to set user to root. if you run the server as root whilst handling connections, your site may be open to a major security attack.

——————————————————————————–

require directive

syntax: require entity-name entity entity…

context: directory, .htaccess

override: authconfig

status: core

this directive selects which authenticated users can access a directory. the allowed syntaxes are:

require user userid userid …

only the named users can access the directory.

require group group-name group-name …

only users in the named groups can access the directory.

require valid-user

all valid users can access the directory.

require must be accompanied by authname and authtype directives, and directives such as authuserfile and authgroupfile (to define users and groups) in order to work correctly. example:

authtype basic

authname "restricted directory"

authuserfile /web/users

authgroupfile /web/groups

require group admin

access controls which are applied in this way are effective for all methods. this is what is normally desired. if you wish to apply access controls only to specific methods, while leaving other methods unprotected, then place the require statement into a section

see also satisfy and mod_access.

——————————————————————————–

resourceconfig directive

syntax: resourceconfig filename

default: resourceconfig conf/srm.conf

context: server config, virtual host

status: core

the server will read this file for more directives after reading the httpd.conf file. filename is relative to the serverroot. this feature can be disabled using:

resourceconfig /dev/null

historically, this file contained most directives except for server configuration directives and sections; in fact it can now contain any server directive allowed in the server config context.

see also accessconfig.

——————————————————————————–

rlimitcpu directive

syntax: rlimitcpu # or max [# or max]

default: unset; uses operating system defaults

context: server config, virtual host

status: core

compatibility: rlimitcpu is only available in apache 1.2 and later

takes 1 or 2 parameters. the first parameter sets the soft resource limit for all processes and the second parameter sets the maximum resource limit. either parameter can be a number, or max to indicate to the server that the limit should be set to the maximum allowed by the operating system configuration. raising the maximum resource limit requires that the server is running as root, or in the initial startup phase.

this applies to processes forked off from apache children servicing requests, not the apache children themselves. this includes cgi scripts and ssi exec commands, but not any processes forked off from the apache parent such as piped logs.

cpu resource limits are expressed in seconds per process.

see also rlimitmem or rlimitnproc.

——————————————————————————–

rlimitmem directive

syntax: rlimitmem # or max [# or max]

default: unset; uses operating system defaults

context: server config, virtual host

status: core

compatibility: rlimitmem is only available in apache 1.2 and later

takes 1 or 2 parameters. the first parameter sets the soft resource limit for all processes and the second parameter sets the maximum resource limit. either parameter can be a number, or max to indicate to the server that the limit should be set to the maximum allowed by the operating system configuration. raising the maximum resource limit requires that the server is running as root, or in the initial startup phase.

this applies to processes forked off from apache children servicing requests, not the apache children themselves. this includes cgi scripts and ssi exec commands, but not any processes forked off from the apache parent such as piped logs.

memory resource limits are expressed in bytes per process.

see also rlimitcpu or rlimitnproc.

——————————————————————————–

rlimitnproc directive

syntax: rlimitnproc # or max [# or max]

default: unset; uses operating system defaults

context: server config, virtual host

status: core

compatibility: rlimitnproc is only available in apache 1.2 and later

takes 1 or 2 parameters. the first parameter sets the soft resource limit for all processes and the second parameter sets the maximum resource limit. either parameter can be a number, or max to indicate to the server that the limit should be set to the maximum allowed by the operating system configuration. raising the maximum resource limit requires that the server is running as root, or in the initial startup phase.

this applies to processes forked off from apache children servicing requests, not the apache children themselves. this includes cgi scripts and ssi exec commands, but not any processes forked off from the apache parent such as piped logs.

process limits control the number of processes per user.

note: if cgi processes are not running under userids other than the web server userid, this directive will limit the number of processes that the server itself can create. evidence of this situation will be indicated by cannot fork messages in the error_log.

see also rlimitmem or rlimitcpu.

————————————————————–

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值