Advertisement
Guest User

apache.conf

a guest
Oct 9th, 2011
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.43 KB | None | 0 0
  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.  
  32. ### Section 1: Global Environment
  33. #
  34. # The directives in this section affect the overall operation of Apache,
  35. # such as the number of concurrent requests it can handle or where it
  36. # can find its configuration files.
  37. #
  38.  
  39. #
  40. # ServerRoot: The top of the directory tree under which the server's
  41. # configuration, error, and log files are kept.
  42. #
  43. # NOTE! If you intend to place this on an NFS (or otherwise network)
  44. # mounted filesystem then please read the LockFile documentation (available
  45. # at <URL:http://httpd.apache.org/docs-2.1/mod/mpm_common.html#lockfile>);
  46. # you will save yourself a lot of trouble.
  47. #
  48. # Do NOT add a slash at the end of the directory path.
  49. #
  50. ServerRoot "/etc/apache2"
  51.  
  52. #
  53. # The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
  54. #
  55. #<IfModule !mpm_winnt.c>
  56. #<IfModule !mpm_netware.c>
  57. LockFile /var/lock/apache2/accept.lock
  58. #</IfModule>
  59. #</IfModule>
  60.  
  61. #
  62. # PidFile: The file in which the server should record its process
  63. # identification number when it starts.
  64. # This needs to be set in /etc/apache2/envvars
  65. #
  66. PidFile ${APACHE_PID_FILE}
  67.  
  68. #
  69. # Timeout: The number of seconds before receives and sends time out.
  70. #
  71. Timeout 30
  72.  
  73. #
  74. # KeepAlive: Whether or not to allow persistent connections (more than
  75. # one request per connection). Set to "Off" to deactivate.
  76. #
  77. KeepAlive On
  78.  
  79. #
  80. # MaxKeepAliveRequests: The maximum number of requests to allow
  81. # during a persistent connection. Set to 0 to allow an unlimited amount.
  82. # We recommend you leave this number high, for maximum performance.
  83. #
  84. MaxKeepAliveRequests 500
  85.  
  86. #
  87. # KeepAliveTimeout: Number of seconds to wait for the next request from the
  88. # same client on the same connection.
  89. #
  90. KeepAliveTimeout 2
  91.  
  92. ##
  93. ## Server-Pool Size Regulation (MPM specific)
  94. ##
  95.  
  96. # prefork MPM
  97. # StartServers: number of server processes to start
  98. # MinSpareServers: minimum number of server processes which are kept spare
  99. # MaxSpareServers: maximum number of server processes which are kept spare
  100. # MaxClients: maximum number of server processes allowed to start
  101. # MaxRequestsPerChild: maximum number of requests a server process serves
  102. <IfModule mpm_prefork_module>
  103. # Original Setup
  104. # StartServers 5
  105. # MinSpareServers 5
  106. # MaxSpareServers 10
  107. # MaxClients 27
  108. # MaxRequestsPerChild 0
  109.  
  110. #per Linode
  111. #StartServers 1
  112. #MinSpareServers 3
  113. #MaxSpareServers 6
  114. #ServerLimit 24
  115. #MaxClients 24
  116. #MaxRequestsPerChild 3000
  117.  
  118. #Rick Custom
  119. StartServers 4
  120. MinSpareServers 12
  121. MaxSpareServers 24
  122. ServerLimit 96
  123. MaxClients 96
  124. MaxRequestsPerChild 12000
  125. </IfModule>
  126.  
  127. # worker MPM
  128. # StartServers: initial number of server processes to start
  129. # MaxClients: maximum number of simultaneous client connections
  130. # MinSpareThreads: minimum number of worker threads which are kept spare
  131. # MaxSpareThreads: maximum number of worker threads which are kept spare
  132. # ThreadsPerChild: constant number of worker threads in each server process
  133. # MaxRequestsPerChild: maximum number of requests a server process serves
  134. <IfModule mpm_worker_module>
  135. StartServers 2
  136. MinSpareThreads 25
  137. MaxSpareThreads 75
  138. ThreadLimit 64
  139. ThreadsPerChild 25
  140. MaxClients 150
  141. MaxRequestsPerChild 0
  142. </IfModule>
  143.  
  144. # event MPM
  145. # StartServers: initial number of server processes to start
  146. # MaxClients: maximum number of simultaneous client connections
  147. # MinSpareThreads: minimum number of worker threads which are kept spare
  148. # MaxSpareThreads: maximum number of worker threads which are kept spare
  149. # ThreadsPerChild: constant number of worker threads in each server process
  150. # MaxRequestsPerChild: maximum number of requests a server process serves
  151. <IfModule mpm_event_module>
  152. StartServers 2
  153. MaxClients 150
  154. MinSpareThreads 25
  155. MaxSpareThreads 75
  156. ThreadLimit 64
  157. ThreadsPerChild 25
  158. MaxRequestsPerChild 0
  159. </IfModule>
  160.  
  161. # These need to be set in /etc/apache2/envvars
  162. User ${APACHE_RUN_USER}
  163. Group ${APACHE_RUN_GROUP}
  164.  
  165. #
  166. # AccessFileName: The name of the file to look for in each directory
  167. # for additional configuration directives. See also the AllowOverride
  168. # directive.
  169. #
  170.  
  171. AccessFileName .htaccess
  172.  
  173. #
  174. # The following lines prevent .htaccess and .htpasswd files from being
  175. # viewed by Web clients.
  176. #
  177. <Files ~ "^\.ht">
  178. Order allow,deny
  179. Deny from all
  180. Satisfy all
  181. </Files>
  182.  
  183. #
  184. # DefaultType is the default MIME type the server will use for a document
  185. # if it cannot otherwise determine one, such as from filename extensions.
  186. # If your server contains mostly text or HTML documents, "text/plain" is
  187. # a good value. If most of your content is binary, such as applications
  188. # or images, you may want to use "application/octet-stream" instead to
  189. # keep browsers from trying to display binary files as though they are
  190. # text.
  191. #
  192. DefaultType text/plain
  193.  
  194.  
  195. #
  196. # HostnameLookups: Log the names of clients or just their IP addresses
  197. # e.g., www.apache.org (on) or 204.62.129.132 (off).
  198. # The default is off because it'd be overall better for the net if people
  199. # had to knowingly turn this feature on, since enabling it means that
  200. # each client request will result in AT LEAST one lookup request to the
  201. # nameserver.
  202. #
  203. HostnameLookups Off
  204.  
  205. # ErrorLog: The location of the error log file.
  206. # If you do not specify an ErrorLog directive within a <VirtualHost>
  207. # container, error messages relating to that virtual host will be
  208. # logged here. If you *do* define an error logfile for a <VirtualHost>
  209. # container, that host's errors will be logged there and not here.
  210. #
  211. ErrorLog /var/log/apache2/error.log
  212.  
  213. #
  214. # LogLevel: Control the number of messages logged to the error_log.
  215. # Possible values include: debug, info, notice, warn, error, crit,
  216. # alert, emerg.
  217. #
  218. LogLevel warn
  219.  
  220. # Include module configuration:
  221. Include /etc/apache2/mods-enabled/*.load
  222. Include /etc/apache2/mods-enabled/*.conf
  223.  
  224. # Include all the user configurations:
  225. Include /etc/apache2/httpd.conf
  226.  
  227. # Include ports listing
  228. Include /etc/apache2/ports.conf
  229.  
  230. #
  231. # The following directives define some format nicknames for use with
  232. # a CustomLog directive (see below).
  233. # If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i
  234. #
  235. LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
  236. LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
  237. LogFormat "%h %l %u %t \"%r\" %>s %O" common
  238. LogFormat "%{Referer}i -> %U" referer
  239. LogFormat "%{User-agent}i" agent
  240.  
  241. #
  242. # Define an access log for VirtualHosts that don't define their own logfile
  243. CustomLog /var/log/apache2/other_vhosts_access.log vhost_combined
  244.  
  245.  
  246. # Include of directories ignores editors' and dpkg's backup files,
  247. # see README.Debian for details.
  248.  
  249. # Include generic snippets of statements
  250. Include /etc/apache2/conf.d/
  251.  
  252. # Include the virtual host configurations:
  253. Include /etc/apache2/sites-enabled/
  254.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement