Advertisement
Guest User

apache2.conf

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