Menu
AWS OpsWorks
User Guide (API Version 2013-02-18)

apache2 Attributes

Note

These attributes are available only on Linux stacks.

The apache2 attributes specify the Apache HTTP server configuration. For more information, see Apache Core Features. For more information on how to override built-in attributes to specify custom values, see Overriding Attributes.

binary

The location of the Apache binary (string). The default value is '/usr/sbin/httpd'.

Copy
node[:apache][:binary]
contact

An e-mail contact (string). The default value is a dummy address, 'ops@example.com'.

Copy
node[:apache][:contact]
deflate_types

Directs mod_deflate to enable compression for the specified Mime types, if they are supported by the browser (list of string). The default value is as follows:

Copy
['application/javascript', 'application/json', 'application/x-javascript', 'application/xhtml+xml', 'application/xml', 'application/xml+rss', 'text/css', 'text/html', 'text/javascript', 'text/plain', 'text/xml']

Warning

Compression can introduce security risks. To completely disable compression, set this attribute as follows:

Copy
node[:apache][:deflate_types] = []
Copy
node[:apache][:deflate_types]
dir

The server's root directory (string). The default values are as follows:

  • Amazon Linux and Red Hat Enterprise Linux (RHEL): '/etc/httpd'

  • Ubuntu: '/etc/apache2'

Copy
node[:apache][:dir]
document_root

The document root (string). The default values are as follows:

  • Amazon Linux and RHEL: '/var/www/html'

  • Ubuntu: '/var/www'

Copy
node[:apache][:document_root]
group

The group name (string). The default values are as follows:

  • Amazon Linux and RHEL: 'apache'

  • Ubuntu: 'www-data'

Copy
node[:apache][:group]
hide_info_headers

Whether to omit version and module information from HTTP headers ('true'/'false') (string). The default value is 'true'.

Copy
node[:apache][:hide_info_headers]
icondir

The icon directory (string). The defaults value are as follows:

  • Amazon Linux and RHEL: '/var/www/icons/'

  • Ubuntu: '/usr/share/apache2/icons'

Copy
node[:apache][:icondir]
init_script

The initialization script (string). The default values are as follows:

  • Amazon Linux and RHEL: '/etc/init.d/httpd'

  • Ubuntu: '/etc/init.d/apache2'

Copy
node[:apache][:init_script]
keepalive

Whether to enable keep-alive connections (string). The possible values are 'On' and 'Off' (string). The default value is 'Off'.

Copy
node[:apache][:keepalive]
keepaliverequests

The maximum number of keep-alive requests that Apache will handle at the same time (number). The default value is 100.

Copy
node[:apache][:keepaliverequests]
keepalivetimeout

The time that Apache waits for a request before closing the connection (number). The default value is 3.

Copy
node[:apache][:keepalivetimeout]
lib_dir

The directory that contains the object code libraries (string). The default values are as follows:

  • Amazon Linux (x86): '/usr/lib/httpd'

  • Amazon Linux (x64) and RHEL: '/usr/lib64/httpd'

  • Ubuntu: '/usr/lib/apache2'

Copy
node[:apache][:lib_dir]
libexecdir

The directory that contains the program executables (string). The default values are as follows:

  • Amazon Linux (x86): '/usr/lib/httpd/modules'

  • Amazon Linux (x64) and RHEL: '/usr/lib64/httpd/modules'

  • Ubuntu: '/usr/lib/apache2/modules'

Copy
node[:apache][:libexecdir]
listen_ports

A list of ports that the server listens to (list of string). The default value is [ '80','443' ].

Copy
node[:apache][:listen_ports]
log_dir

The log directory (string). The default values are as follows:

  • Amazon Linux and RHEL: '/var/log/httpd'

  • Ubuntu: '/var/log/apache2'

Copy
node[:apache][:log_dir]
logrotate Attributes

These attributes specify how to rotate the log files.

delaycompress

Whether to delay compressing a closed log file until the start of the next rotation cycle ('true'/'false') (string). The default value is 'true'.

Copy
node[:apache][:logrotate][:delaycompress]
group

The log files' group (string). The default value is 'adm'.

Copy
node[:apache][:logrotate][:group]
mode

The log files' mode (string). The default value is '640'.

Copy
node[:apache][:logrotate][:mode]
owner

The log files' owner (string). The default value is 'root'.

Copy
node[:apache][:logrotate][:owner]
rotate

The number of rotation cycles before a closed log file is removed (string). The default value is '30'.

Copy
node[:apache][:logrotate][:rotate]
schedule

The rotation schedule (string). Possible values are as follows:

  • 'daily'

  • 'weekly'

  • 'monthly'

The default value is 'daily'.

Copy
node[:apache][:logrotate][:schedule]
pid_file

The file that contains the daemon's process ID (string). The default values are as follows:

  • Amazon Linux and RHEL: '/var/run/httpd/httpd.pid'

  • Ubuntu: '/var/run/apache2.pid'

Copy
node[:apache][:pid_file]
prefork Attributes

These attributes specify the pre-forking configuration.

maxclients

The maximum number of simultaneous requests that will be served (number). The default value is 400.

Note

Use this attribute only for instances that are running Amazon Linux, RHEL, or Ubuntu 12.04 LTS. If your instances are running Ubuntu 14.04 LTS, use maxrequestworkers.

Copy
node[:apache][:prefork][:maxclients]
maxrequestsperchild

The maximum number of requests that a child server process will handle (number). The default value is 10000.

Copy
node[:apache][:prefork][:maxrequestsperchild]
maxrequestworkers

The maximum number of simultaneous requests that will be served (number). The default value is 400.

Note

Use this attribute only for instances that are running Ubuntu 14.04 LTS. If your instances are running Amazon Linux, RHEL, or Ubuntu 12.04 LTS, use maxclients .

Copy
node[:apache][:prefork][:maxrequestworkers]
maxspareservers

The maximum number of idle child server processes (number). The default value is 32.

Copy
node[:apache][:prefork][:maxspareservers]
minspareservers

The minimum number of idle child server processes (number). The default value is 16.

Copy
node[:apache][:prefork][:minspareservers]
serverlimit

The maximum number of processes that can be configured (number). The default value is 400.

Copy
node[:apache][:prefork][:serverlimit]
startservers

The number of child server processes to be created at startup (number). The default value is 16.

Copy
node[:apache][:prefork][:startservers]
serversignature

Specifies whether and how to configure a trailing footer for server-generated documents (string). The possible values are 'On', 'Off', and 'Email'). The default value is 'Off'.

Copy
node[:apache][:serversignature]
servertokens

Specifies what type of server version information is included in the response header (string):

  • 'Full': Full information. For example, Server: Apache/2.4.2 (Unix) PHP/4.2.2 MyMod/1.2

  • 'Prod': Product name. For example, Server: Apache

  • 'Major': Major version. For example, Server: Apache/2

  • 'Minor': Major and minor version. For example, Server: Apache/2.4

  • 'Min': Minimal version. For example, Server: Apache/2.4.2

  • 'OS': Version with operating system. For example, Server: Apache/2.4.2 (Unix)

The default value is 'Prod'.

Copy
node[:apache][:servertokens]
timeout

The amount of time that Apache waits for I/O (number). The default value is 120.

Copy
node[:apache][:timeout]
traceenable

Whether to enable TRACE requests (string). The possible values are 'On' and 'Off'. The default value is 'Off'.

Copy
node[:apache][:traceenable]
user

The user name (string). The default values are as follows:

  • Amazon Linux and RHEL: 'apache'

  • Ubuntu: 'www-data'

Copy
node[:apache][:user]
version

The Apache version (string). The default values are as follows:

  • Amazon Linux: 2.2

  • Ubuntu 12.04 LTS: 2.2

  • Ubuntu 14.04 LTS: 2.4

  • RHEL: 2.4

Copy
node[:apache][:version]
worker Attributes

These attributes specify the worker process configuration.

startservers

The number of child server processes to be created at startup (number). The default value is 4.

Copy
node[:apache][:worker][:startservers]
maxclients

The maximum number of simultaneous requests that will be served (number). The default value is 1024.

Copy
node[:apache][:worker][:maxclients]
maxsparethreads

The maximum number of idle threads (number). The default value is 192.

Copy
node[:apache][:worker][:maxsparethreads]
minsparethreads

The minimum number of idle threads (number). The default value is 64.

Copy
node[:apache][:worker][:minsparethreads]
threadsperchild

The number of threads per child process (number). The default value is 64.

Copy
node[:apache][:worker][:threadsperchild]
maxrequestsperchild

The maximum number of requests that a child server process will handle (number). The default value is 10000.

Copy
node[:apache][:worker][:maxrequestsperchild]