Advertisement
Guest User

Untitled

a guest
May 24th, 2016
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.59 KB | None | 0 0
  1. # This is the main Apache server configuration file. It contains the
  2. # configuration directives that give the server its instructions.
  3. # See http://httpd.apache.org/docs/2.2/ for detailed information about
  4. # the directives and /usr/share/doc/apache2-common/README.Debian.gz about
  5. # Debian specific hints.
  6. #
  7. #
  8. # Summary of how the Apache 2 configuration works in Debian:
  9. # The Apache 2 web server configuration in Debian is quite different to
  10. # upstream's suggested way to configure the web server. This is because Debian's
  11. # default Apache2 installation attempts to make adding and removing modules,
  12. # virtual hosts, and extra configuration directives as flexible as possible, in
  13. # order to make automating the changes and administering the server as easy as
  14. # possible.
  15.  
  16. # It is split into several files forming the configuration hierarchy outlined
  17. # below, all located in the /etc/apache2/ directory:
  18. #
  19. # /etc/apache2/
  20. # |-- apache2.conf
  21. # | `-- ports.conf
  22. # |-- mods-enabled
  23. # | |-- *.load
  24. # | `-- *.conf
  25. # |-- conf.d
  26. # | `-- *
  27. # `-- sites-enabled
  28. # `-- *
  29. #
  30. #
  31. # * apache2.conf is the main configuration file (this file). It puts the pieces
  32. # together by including all remaining configuration files when starting up the
  33. # web server.
  34. #
  35. # In order to avoid conflicts with backup files, the Include directive is
  36. # adapted to ignore files that:
  37. # - do not begin with a letter or number
  38. # - contain a character that is neither letter nor number nor _-:.
  39. # - contain .dpkg
  40. #
  41. # Yet we strongly suggest that all configuration files either end with a
  42. # .conf or .load suffix in the file name. The next Debian release will
  43. # ignore files not ending with .conf (or .load for mods-enabled).
  44. #
  45. # * ports.conf is always included from the main configuration file. It is
  46. # supposed to determine listening ports for incoming connections, and which
  47. # of these ports are used for name based virtual hosts.
  48. #
  49. # * Configuration files in the mods-enabled/ and sites-enabled/ directories
  50. # contain particular configuration snippets which manage modules or virtual
  51. # host configurations, respectively.
  52. #
  53. # They are activated by symlinking available configuration files from their
  54. # respective *-available/ counterparts. These should be managed by using our
  55. # helpers a2enmod/a2dismod, a2ensite/a2dissite. See
  56. # their respective man pages for detailed information.
  57. #
  58. # * Configuration files in the conf.d directory are either provided by other
  59. # packages or may be added by the local administrator. Local additions
  60. # should start with local- or end with .local.conf to avoid name clashes. All
  61. # files in conf.d are considered (excluding the exceptions noted above) by
  62. # the Apache 2 web server.
  63. #
  64. # * The binary is called apache2. Due to the use of environment variables, in
  65. # the default configuration, apache2 needs to be started/stopped with
  66. # /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not
  67. # work with the default configuration.
  68.  
  69.  
  70. # Global configuration
  71. #
  72.  
  73. #
  74. # ServerRoot: The top of the directory tree under which the server's
  75. # configuration, error, and log files are kept.
  76. #
  77. # NOTE! If you intend to place this on an NFS (or otherwise network)
  78. # mounted filesystem then please read the LockFile documentation (available
  79. # at <URL:http://httpd.apache.org/docs/2.2/mod/mpm_common.html#lockfile>);
  80. # you will save yourself a lot of trouble.
  81. #
  82. # Do NOT add a slash at the end of the directory path.
  83. #
  84. #ServerRoot "/etc/apache2"
  85.  
  86. #
  87. # The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
  88. #
  89. LockFile ${APACHE_LOCK_DIR}/accept.lock
  90.  
  91. #
  92. # PidFile: The file in which the server should record its process
  93. # identification number when it starts.
  94. # This needs to be set in /etc/apache2/envvars
  95. #
  96. PidFile ${APACHE_PID_FILE}
  97.  
  98. #
  99. # Timeout: The number of seconds before receives and sends time out.
  100. #
  101. Timeout 300
  102.  
  103. #
  104. # KeepAlive: Whether or not to allow persistent connections (more than
  105. # one request per connection). Set to "Off" to deactivate.
  106. #
  107. KeepAlive On
  108.  
  109. #
  110. # MaxKeepAliveRequests: The maximum number of requests to allow
  111. # during a persistent connection. Set to 0 to allow an unlimited amount.
  112. # We recommend you leave this number high, for maximum performance.
  113. #
  114. MaxKeepAliveRequests 100
  115.  
  116. #
  117. # KeepAliveTimeout: Number of seconds to wait for the next request from the
  118. # same client on the same connection.
  119. #
  120. KeepAliveTimeout 5
  121.  
  122. ##
  123. ## Server-Pool Size Regulation (MPM specific)
  124. ##
  125.  
  126. # prefork MPM
  127. # StartServers: number of server processes to start
  128. # MinSpareServers: minimum number of server processes which are kept spare
  129. # MaxSpareServers: maximum number of server processes which are kept spare
  130. # MaxClients: maximum number of server processes allowed to start
  131. # MaxRequestsPerChild: maximum number of requests a server process serves
  132. <IfModule mpm_prefork_module>
  133. StartServers 1
  134. MinSpareServers 1
  135. MaxSpareServers 5
  136. MaxClients 30
  137. MaxRequestsPerChild 3000
  138. </IfModule>
  139.  
  140. # worker MPM
  141. # StartServers: initial number of server processes to start
  142. # MinSpareThreads: minimum number of worker threads which are kept spare
  143. # MaxSpareThreads: maximum number of worker threads which are kept spare
  144. # ThreadLimit: ThreadsPerChild can be changed to this maximum value during a
  145. # graceful restart. ThreadLimit can only be changed by stopping
  146. # and starting Apache.
  147. # ThreadsPerChild: constant number of worker threads in each server process
  148. # MaxClients: maximum number of simultaneous client connections
  149. # MaxRequestsPerChild: maximum number of requests a server process serves
  150. <IfModule mpm_worker_module>
  151. StartServers 1
  152. MinSpareThreads 1
  153. MaxSpareThreads 4
  154. ThreadLimit 64
  155. ThreadsPerChild 25
  156. MaxClients 10
  157. MaxRequestsPerChild 0
  158. </IfModule>
  159.  
  160. # event MPM
  161. # StartServers: initial number of server processes to start
  162. # MinSpareThreads: minimum number of worker threads which are kept spare
  163. # MaxSpareThreads: maximum number of worker threads which are kept spare
  164. # ThreadsPerChild: constant number of worker threads in each server process
  165. # MaxClients: maximum number of simultaneous client connections
  166. # MaxRequestsPerChild: maximum number of requests a server process serves
  167. <IfModule mpm_event_module>
  168. StartServers 1
  169. MinSpareThreads 1
  170. MaxSpareThreads 4
  171. ThreadLimit 64
  172. ThreadsPerChild 25
  173. MaxClients 10
  174. MaxRequestsPerChild 0
  175. </IfModule>
  176.  
  177. # These need to be set in /etc/apache2/envvars
  178. User ${APACHE_RUN_USER}
  179. Group ${APACHE_RUN_GROUP}
  180.  
  181. #
  182. # AccessFileName: The name of the file to look for in each directory
  183. # for additional configuration directives. See also the AllowOverride
  184. # directive.
  185. #
  186.  
  187. AccessFileName .htaccess
  188.  
  189. #
  190. # The following lines prevent .htaccess and .htpasswd files from being
  191. # viewed by Web clients.
  192. #
  193. <Files ~ "^\.ht">
  194. Order allow,deny
  195. Deny from all
  196. Satisfy all
  197. </Files>
  198.  
  199. #
  200. # DefaultType is the default MIME type the server will use for a document
  201. # if it cannot otherwise determine one, such as from filename extensions.
  202. # If your server contains mostly text or HTML documents, "text/plain" is
  203. # a good value. If most of your content is binary, such as applications
  204. # or images, you may want to use "application/octet-stream" instead to
  205. # keep browsers from trying to display binary files as though they are
  206. # text.
  207. #
  208. # It is also possible to omit any default MIME type and let the
  209. # client's browser guess an appropriate action instead. Typically the
  210. # browser will decide based on the file's extension then. In cases
  211. # where no good assumption can be made, letting the default MIME type
  212. # unset is suggested instead of forcing the browser to accept
  213. # incorrect metadata.
  214. #
  215. DefaultType None
  216.  
  217.  
  218. #
  219. # HostnameLookups: Log the names of clients or just their IP addresses
  220. # e.g., www.apache.org (on) or 204.62.129.132 (off).
  221. # The default is off because it'd be overall better for the net if people
  222. # had to knowingly turn this feature on, since enabling it means that
  223. # each client request will result in AT LEAST one lookup request to the
  224. # nameserver.
  225. #
  226. HostnameLookups Off
  227.  
  228. # ErrorLog: The location of the error log file.
  229. # If you do not specify an ErrorLog directive within a <VirtualHost>
  230. # container, error messages relating to that virtual host will be
  231. # logged here. If you *do* define an error logfile for a <VirtualHost>
  232. # container, that host's errors will be logged there and not here.
  233. #
  234. ErrorLog ${APACHE_LOG_DIR}/error.log
  235.  
  236. #
  237. # LogLevel: Control the number of messages logged to the error_log.
  238. # Possible values include: debug, info, notice, warn, error, crit,
  239. # alert, emerg.
  240. #
  241. LogLevel warn
  242.  
  243. # Include module configuration:
  244. Include mods-enabled/*.load
  245. Include mods-enabled/*.conf
  246.  
  247. # Include list of ports to listen on and which to use for name based vhosts
  248. Include ports.conf
  249.  
  250. #
  251. # The following directives define some format nicknames for use with
  252. # a CustomLog directive (see below).
  253. # If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i
  254. #
  255. LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
  256. LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
  257. LogFormat "%h %l %u %t \"%r\" %>s %O" common
  258. LogFormat "%{Referer}i -> %U" referer
  259. LogFormat "%{User-agent}i" agent
  260.  
  261. # Include of directories ignores editors' and dpkg's backup files,
  262. # see the comments above for details.
  263.  
  264. # Include generic snippets of statements
  265. Include conf.d/
  266.  
  267. # Include the virtual host configurations:
  268. Include sites-enabled/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement