apache2.conf 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. #
  2. # Based upon the NCSA server configuration files originally by Rob McCool.
  3. #
  4. # This is the main Apache server configuration file. It contains the
  5. # configuration directives that give the server its instructions.
  6. # See http://httpd.apache.org/docs/2.2/ for detailed information about
  7. # the directives.
  8. #
  9. # Do NOT simply read the instructions in here without understanding
  10. # what they do. They're here only as hints or reminders. If you are unsure
  11. # consult the online docs. You have been warned.
  12. #
  13. # The configuration directives are grouped into three basic sections:
  14. # 1. Directives that control the operation of the Apache server process as a
  15. # whole (the 'global environment').
  16. # 2. Directives that define the parameters of the 'main' or 'default' server,
  17. # which responds to requests that aren't handled by a virtual host.
  18. # These directives also provide default values for the settings
  19. # of all virtual hosts.
  20. # 3. Settings for virtual hosts, which allow Web requests to be sent to
  21. # different IP addresses or hostnames and have them handled by the
  22. # same Apache server process.
  23. #
  24. # Configuration and logfile names: If the filenames you specify for many
  25. # of the server's control files begin with "/" (or "drive:/" for Win32), the
  26. # server will use that explicit path. If the filenames do *not* begin
  27. # with "/", the value of ServerRoot is prepended -- so "/var/log/apache2/foo.log"
  28. # with ServerRoot set to "" will be interpreted by the
  29. # server as "//var/log/apache2/foo.log".
  30. #
  31. ### Section 1: Global Environment
  32. #
  33. # The directives in this section affect the overall operation of Apache,
  34. # such as the number of concurrent requests it can handle or where it
  35. # can find its configuration files.
  36. #
  37. #
  38. # ServerRoot: The top of the directory tree under which the server's
  39. # configuration, error, and log files are kept.
  40. #
  41. # NOTE! If you intend to place this on an NFS (or otherwise network)
  42. # mounted filesystem then please read the LockFile documentation (available
  43. # at <URL:http://httpd.apache.org/docs-2.1/mod/mpm_common.html#lockfile>);
  44. # you will save yourself a lot of trouble.
  45. #
  46. # Do NOT add a slash at the end of the directory path.
  47. #
  48. ServerRoot "/var/www"
  49. ServerName localhost
  50. #
  51. # The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
  52. #
  53. #<IfModule !mpm_winnt.c>
  54. #<IfModule !mpm_netware.c>
  55. #LockFile /var/lock/apache2/accept.lock
  56. #</IfModule>
  57. #</IfModule>
  58. #
  59. # PidFile: The file in which the server should record its process
  60. # identification number when it starts.
  61. # This needs to be set in /etc/apache2/envvars
  62. #
  63. PidFile ${APACHE_PID_FILE}
  64. #
  65. # Timeout: The number of seconds before receives and sends time out.
  66. #
  67. Timeout 300
  68. #
  69. # KeepAlive: Whether or not to allow persistent connections (more than
  70. # one request per connection). Set to "Off" to deactivate.
  71. #
  72. KeepAlive On
  73. #
  74. # MaxKeepAliveRequests: The maximum number of requests to allow
  75. # during a persistent connection. Set to 0 to allow an unlimited amount.
  76. # We recommend you leave this number high, for maximum performance.
  77. #
  78. MaxKeepAliveRequests 100
  79. #
  80. # KeepAliveTimeout: Number of seconds to wait for the next request from the
  81. # same client on the same connection.
  82. #
  83. KeepAliveTimeout 15
  84. ##
  85. ## Server-Pool Size Regulation (MPM specific)
  86. ##
  87. # prefork MPM
  88. # StartServers: number of server processes to start
  89. # MinSpareServers: minimum number of server processes which are kept spare
  90. # MaxSpareServers: maximum number of server processes which are kept spare
  91. # MaxClients: maximum number of server processes allowed to start
  92. # MaxRequestsPerChild: maximum number of requests a server process serves
  93. <IfModule mpm_prefork_module>
  94. StartServers 5
  95. MinSpareServers 5
  96. MaxSpareServers 10
  97. MaxClients 150
  98. MaxRequestsPerChild 0
  99. </IfModule>
  100. # worker MPM
  101. # StartServers: initial number of server processes to start
  102. # MaxClients: maximum number of simultaneous client connections
  103. # MinSpareThreads: minimum number of worker threads which are kept spare
  104. # MaxSpareThreads: maximum number of worker threads which are kept spare
  105. # ThreadsPerChild: constant number of worker threads in each server process
  106. # MaxRequestsPerChild: maximum number of requests a server process serves
  107. <IfModule mpm_worker_module>
  108. StartServers 2
  109. MinSpareThreads 25
  110. MaxSpareThreads 75
  111. ThreadLimit 64
  112. ThreadsPerChild 25
  113. MaxClients 150
  114. MaxRequestsPerChild 0
  115. </IfModule>
  116. # event MPM
  117. # StartServers: initial number of server processes to start
  118. # MaxClients: maximum number of simultaneous client connections
  119. # MinSpareThreads: minimum number of worker threads which are kept spare
  120. # MaxSpareThreads: maximum number of worker threads which are kept spare
  121. # ThreadsPerChild: constant number of worker threads in each server process
  122. # MaxRequestsPerChild: maximum number of requests a server process serves
  123. <IfModule mpm_event_module>
  124. StartServers 2
  125. MaxClients 150
  126. MinSpareThreads 25
  127. MaxSpareThreads 75
  128. ThreadLimit 64
  129. ThreadsPerChild 25
  130. MaxRequestsPerChild 0
  131. </IfModule>
  132. # These need to be set in /etc/apache2/envvars
  133. User ${APACHE_RUN_USER}
  134. Group ${APACHE_RUN_GROUP}
  135. #
  136. # AccessFileName: The name of the file to look for in each directory
  137. # for additional configuration directives. See also the AllowOverride
  138. # directive.
  139. #
  140. AccessFileName .htaccess
  141. #
  142. # The following lines prevent .htaccess and .htpasswd files from being
  143. # viewed by Web clients.
  144. #
  145. <Files ~ "^\.ht">
  146. Order allow,deny
  147. Deny from all
  148. Satisfy all
  149. </Files>
  150. #
  151. # DefaultType is the default MIME type the server will use for a document
  152. # if it cannot otherwise determine one, such as from filename extensions.
  153. # If your server contains mostly text or HTML documents, "text/plain" is
  154. # a good value. If most of your content is binary, such as applications
  155. # or images, you may want to use "application/octet-stream" instead to
  156. # keep browsers from trying to display binary files as though they are
  157. # text.
  158. #
  159. #DefaultType text/plain
  160. #
  161. # HostnameLookups: Log the names of clients or just their IP addresses
  162. # e.g., www.apache.org (on) or 204.62.129.132 (off).
  163. # The default is off because it'd be overall better for the net if people
  164. # had to knowingly turn this feature on, since enabling it means that
  165. # each client request will result in AT LEAST one lookup request to the
  166. # nameserver.
  167. #
  168. HostnameLookups Off
  169. # ErrorLog: The location of the error log file.
  170. # If you do not specify an ErrorLog directive within a <VirtualHost>
  171. # container, error messages relating to that virtual host will be
  172. # logged here. If you *do* define an error logfile for a <VirtualHost>
  173. # container, that host's errors will be logged there and not here.
  174. #
  175. ErrorLog /var/log/apache2/error.log
  176. #
  177. # LogLevel: Control the number of messages logged to the error_log.
  178. # Possible values include: debug, info, notice, warn, error, crit,
  179. # alert, emerg.
  180. #
  181. LogLevel warn
  182. # Include module configuration:
  183. Include /etc/apache2/mods-enabled/*.load
  184. Include /etc/apache2/mods-enabled/*.conf
  185. # Include all the user configurations:
  186. #Include /etc/apache2/httpd.conf
  187. # Include ports listing
  188. Include /etc/apache2/ports.conf
  189. #
  190. # The following directives define some format nicknames for use with
  191. # a CustomLog directive (see below).
  192. # If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i
  193. #
  194. LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
  195. LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
  196. LogFormat "%h %l %u %t \"%r\" %>s %O" common
  197. LogFormat "%{Referer}i -> %U" referer
  198. LogFormat "%{User-agent}i" agent
  199. #
  200. # Define an access log for VirtualHosts that don't define their own logfile
  201. CustomLog /var/log/apache2/other_vhosts_access.log vhost_combined
  202. # Include of directories ignores editors' and dpkg's backup files,
  203. # see README.Debian for details.
  204. # Include generic snippets of statements
  205. #Include /etc/apache2/conf.d/
  206. # Include the virtual host configurations:
  207. Include /etc/apache2/sites-enabled/