Advertisement
Luke_R

apache2 configs (/etc/apache2/apache2.conf)

Nov 6th, 2016
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 7.24 KB | None | 0 0
  1. refreshed
  2. /etc/apache2/apache2.conf
  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.4/ for detailed information about
  7. # the directives and /usr/share/doc/apache2/README.Debian about Debian specific
  8. # hints.
  9. #
  10. #
  11. # Summary of how the Apache 2 configuration works in Debian:
  12. # The Apache 2 web server configuration in Debian is quite different to
  13. # upstream's suggested way to configure the web server. This is because Debian's
  14. # default Apache2 installation attempts to make adding and removing modules,
  15. # virtual hosts, and extra configuration directives as flexible as possible, in
  16. # order to make automating the changes and administering the server as easy as
  17. # possible.
  18.  
  19. # It is split into several files forming the configuration hierarchy outlined
  20. # below, all located in the /etc/apache2/ directory:
  21. #
  22. #   /etc/apache2/
  23. #   |-- apache2.conf
  24. #   |   `--  ports.conf
  25. #   |-- mods-enabled
  26. #   |   |-- *.load
  27. #   |   `-- *.conf
  28. #   |-- conf-enabled
  29. #   |   `-- *.conf
  30. #   `-- sites-enabled
  31. #       `-- *.conf
  32. #
  33. #
  34. # * apache2.conf is the main configuration file (this file). It puts the pieces
  35. #   together by including all remaining configuration files when starting up the
  36. #   web server.
  37. #
  38. # * ports.conf is always included from the main configuration file. It is
  39. #   supposed to determine listening ports for incoming connections which can be
  40. #   customized anytime.
  41. #
  42. # * Configuration files in the mods-enabled/, conf-enabled/ and sites-enabled/
  43. #   directories contain particular configuration snippets which manage modules,
  44. #   global configuration fragments, or virtual host configurations,
  45. #   respectively.
  46. #
  47. #   They are activated by symlinking available configuration files from their
  48. #   respective *-available/ counterparts. These should be managed by using our
  49. #   helpers a2enmod/a2dismod, a2ensite/a2dissite and a2enconf/a2disconf. See
  50. #   their respective man pages for detailed information.
  51. #
  52. # * The binary is called apache2. Due to the use of environment variables, in
  53. #   the default configuration, apache2 needs to be started/stopped with
  54. #   /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not
  55. #   work with the default configuration.
  56.  
  57.  
  58. # Global configuration
  59. #
  60.  
  61. #
  62. # ServerRoot: The top of the directory tree under which the server's
  63. # configuration, error, and log files are kept.
  64. #
  65. # NOTE!  If you intend to place this on an NFS (or otherwise network)
  66. # mounted filesystem then please read the Mutex documentation (available
  67. # at <URL:http://httpd.apache.org/docs/2.4/mod/core.html#mutex>);
  68. # you will save yourself a lot of trouble.
  69. #
  70. # Do NOT add a slash at the end of the directory path.
  71. #
  72. #ServerRoot "/etc/apache2"
  73.  
  74. #
  75. # The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
  76. #
  77. Mutex file:${APACHE_LOCK_DIR} default
  78.  
  79. #
  80. # PidFile: The file in which the server should record its process
  81. # identification number when it starts.
  82. # This needs to be set in /etc/apache2/envvars
  83. #
  84. PidFile ${APACHE_PID_FILE}
  85.  
  86. #
  87. # Timeout: The number of seconds before receives and sends time out.
  88. #
  89. Timeout 300
  90.  
  91. #
  92. # KeepAlive: Whether or not to allow persistent connections (more than
  93. # one request per connection). Set to "Off" to deactivate.
  94. #
  95. KeepAlive On
  96.  
  97. #
  98. # MaxKeepAliveRequests: The maximum number of requests to allow
  99. # during a persistent connection. Set to 0 to allow an unlimited amount.
  100. # We recommend you leave this number high, for maximum performance.
  101. #
  102. MaxKeepAliveRequests 100
  103.  
  104. #
  105. # KeepAliveTimeout: Number of seconds to wait for the next request from the
  106. # same client on the same connection.
  107. #
  108. KeepAliveTimeout 5
  109.  
  110.  
  111. # These need to be set in /etc/apache2/envvars
  112. User ${APACHE_RUN_USER}
  113. Group ${APACHE_RUN_GROUP}
  114.  
  115. #
  116. # HostnameLookups: Log the names of clients or just their IP addresses
  117. # e.g., www.apache.org (on) or 204.62.129.132 (off).
  118. # The default is off because it'd be overall better for the net if people
  119. # had to knowingly turn this feature on, since enabling it means that
  120. # each client request will result in AT LEAST one lookup request to the
  121. # nameserver.
  122. #
  123. HostnameLookups Off
  124.  
  125. # ErrorLog: The location of the error log file.
  126. # If you do not specify an ErrorLog directive within a <VirtualHost>
  127. # container, error messages relating to that virtual host will be
  128. # logged here.  If you *do* define an error logfile for a <VirtualHost>
  129. # container, that host's errors will be logged there and not here.
  130. #
  131. ErrorLog ${APACHE_LOG_DIR}/error.log
  132.  
  133. #
  134. # LogLevel: Control the severity of messages logged to the error_log.
  135. # Available values: trace8, ..., trace1, debug, info, notice, warn,
  136. # error, crit, alert, emerg.
  137. # It is also possible to configure the log level for particular modules, e.g.
  138. # "LogLevel info ssl:warn"
  139. #
  140. LogLevel warn
  141.  
  142. # Include module configuration:
  143. IncludeOptional mods-enabled/*.load
  144. IncludeOptional mods-enabled/*.conf
  145.  
  146. # Include list of ports to listen on
  147. Include ports.conf
  148.  
  149.  
  150. # Sets the default security model of the Apache2 HTTPD server. It does
  151. # not allow access to the root filesystem outside of /usr/share and /var/www.
  152. # The former is used by web applications packaged in Debian,
  153. # the latter may be used for local directories served by the web server. If
  154. # your system is serving content from a sub-directory in /srv you must allow
  155. # access here, or in any related virtual host.
  156. <Directory />
  157.     Options FollowSymLinks
  158.     AllowOverride None
  159.     Require all denied
  160. </Directory>
  161.  
  162. <Directory /usr/share>
  163.     AllowOverride None
  164.     Require all granted
  165. </Directory>
  166.  
  167. <Directory /var/www/>
  168.     Options Indexes FollowSymLinks
  169.     AllowOverride None
  170.     Require all granted
  171. </Directory>
  172.  
  173. #<Directory /srv/>
  174. #   Options Indexes FollowSymLinks
  175. #   AllowOverride None
  176. #   Require all granted
  177. #</Directory>
  178.  
  179.  
  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. AccessFileName .htaccess
  187.  
  188. #
  189. # The following lines prevent .htaccess and .htpasswd files from being
  190. # viewed by Web clients.
  191. #
  192. <FilesMatch "^\.ht">
  193.     Require all denied
  194. </FilesMatch>
  195.  
  196.  
  197. #
  198. # The following directives define some format nicknames for use with
  199. # a CustomLog directive.
  200. #
  201. # These deviate from the Common Log Format definitions in that they use %O
  202. # (the actual bytes sent including headers) instead of %b (the size of the
  203. # requested file), because the latter makes it impossible to detect partial
  204. # requests.
  205. #
  206. # Note that the use of %{X-Forwarded-For}i instead of %h is not recommended.
  207. # Use mod_remoteip instead.
  208. #
  209. LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
  210. LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
  211. LogFormat "%h %l %u %t \"%r\" %>s %O" common
  212. LogFormat "%{Referer}i -> %U" referer
  213. LogFormat "%{User-agent}i" agent
  214.  
  215. # Include of directories ignores editors' and dpkg's backup files,
  216. # see README.Debian for details.
  217.  
  218. # Include generic snippets of statements
  219. IncludeOptional conf-enabled/*.conf
  220.  
  221. # Include the virtual host configurations:
  222. IncludeOptional sites-enabled/*.conf
  223.  
  224. # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
  225. Include /etc/phpmyadmin/apache.conf
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement