Apache has five directives dealing with CGI scripts.
ScriptAlias |
ScriptAlias URLpath CGIpath Server config, virtual host
ScriptAlias /bin /usr/local/apache/cgi-bin
ScriptAliasMatch |
ScriptAliasMatch regex directory Server config, virtual host
ScriptAliasMatch /cgi-bin/(.*) /usr/local/apache/cgi-bin/$1
ScriptLog |
ScriptLog filename Default: no logging Resource config
Since debugging CGI scripts can be rather opaque, this directive allows you to choose a log file that shows what is happening with CGIs. However, once the scripts are working, disable logging, since it slows Apache down and offers the Bad Guys some tempting crannies.
ScriptLogLength |
ScriptLogLength number_of_bytes Default number_of_bytes: 10385760[60] Resource config
This directive specifies the maximum length of the debug log. Once this value is exceeded, logging stops (after the last complete message).
[60] This curious number is almost certainly a typo in the source: 10 MB is 10485760 bytes.
ScriptLogBuffer |
ScriptLogBuffer number_of_bytes Default number_of_bytes: 1024 Resource config
This directive specifies the maximum size in bytes for recording a POST request.
Scripts can go wild and monopolize system resources: this unhappy outcome can be controlled by three directives.
RLimitCPU
RLimitCPU # | 'max' [# | 'max'] Default: OS defaults Server config, virtual host
RLimitCPU takes one or two parameters. Each parameter may be a number or the word max,which invokes the system maximum, in seconds per process. The first parameter sets the soft resource limit; the second the hard limit.[61]
[61]The soft limit can be increased again by the child process, but the hard limit cannot. This allows you to set a default that is lower than the highest you are prepared to allow. See man rlimit for more detail.
RLimitMEM
RLimitMEM # | 'max' [# | 'max'] Default: OS defaults Server config, virtual host
RLimitMEM takes one or two parameters. Each parameter may be a number or the word max,which invokes the system maximum, in bytes of memory used per process. The first parameter sets the soft resource limit; the second the hard limit.
RLimitNPROC
RLimitNPROC # | 'max' [# | 'max'] Default: OS defaults Server config, virtual host
RLimitNPROC takes one or two parameters. Each parameter may be a number or the word max, which invokes the system maximum, in processes per user. The first parameter sets the soft resource limit; the second the hard limit.
Copyright © 2003 O'Reilly & Associates. All rights reserved.