Ajtak

httpd.conf

Feb 17th, 2018
608
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #
  2. # This is the main Apache HTTP server configuration file.  It contains the
  3. # configuration directives that give the server its instructions.
  4. # See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
  5. # In particular, see
  6. # <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
  7. # for a discussion of each configuration directive.
  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. # Configuration and logfile names: If the filenames you specify for many
  14. # of the server's control files begin with "/" (or "drive:/" for Win32), the
  15. # server will use that explicit path.  If the filenames do *not* begin
  16. # with "/", the value of ServerRoot is prepended -- so 'log/access_log'
  17. # with ServerRoot set to '/www' will be interpreted by the
  18. # server as '/www/log/access_log', where as '/log/access_log' will be
  19. # interpreted as '/log/access_log'.
  20.  
  21. #
  22. # ServerRoot: The top of the directory tree under which the server's
  23. # configuration, error, and log files are kept.
  24. #
  25. # Do not add a slash at the end of the directory path.  If you point
  26. # ServerRoot at a non-local disk, be sure to specify a local disk on the
  27. # Mutex directive, if file-based mutexes are used.  If you wish to share the
  28. # same ServerRoot for multiple httpd daemons, you will need to change at
  29. # least PidFile.
  30. #
  31. ServerRoot "/etc/httpd"
  32.  
  33. #
  34. # Listen: Allows you to bind Apache to specific IP addresses and/or
  35. # ports, instead of the default. See also the <VirtualHost>
  36. # directive.
  37. #
  38. # Change this to Listen on specific IP addresses as shown below to
  39. # prevent Apache from glomming onto all bound IP addresses.
  40. #
  41. #Listen 12.34.56.78:80
  42. Listen 80
  43.  
  44. #
  45. # Dynamic Shared Object (DSO) Support
  46. #
  47. # To be able to use the functionality of a module which was built as a DSO you
  48. # have to place corresponding `LoadModule' lines at this location so the
  49. # directives contained in it are actually available _before_ they are used.
  50. # Statically compiled modules (those listed by `httpd -l') do not need
  51. # to be loaded here.
  52. #
  53. # Example:
  54. # LoadModule foo_module modules/mod_foo.so
  55. #
  56.  
  57. LoadModule ssl_module /usr/lib64/httpd/modules/mod_ssl.so
  58. LoadModule proxy_module /usr/lib64/httpd/modules/mod_proxy.so
  59. LoadModule proxy_fcgi_module /usr/lib64/httpd/modules/mod_proxy_fcgi.so
  60. Include conf.modules.d/*.conf
  61.  
  62. #
  63. # If you wish httpd to run as a different user or group, you must run
  64. # httpd as root initially and it will switch.  
  65. #
  66. # User/Group: The name (or #number) of the user/group to run httpd as.
  67. # It is usually good practice to create a dedicated user and group for
  68. # running httpd, as with most system services.
  69. #
  70. User apache
  71. Group apache
  72.  
  73. # 'Main' server configuration
  74. #
  75. # The directives in this section set up the values used by the 'main'
  76. # server, which responds to any requests that aren't handled by a
  77. # <VirtualHost> definition.  These values also provide defaults for
  78. # any <VirtualHost> containers you may define later in the file.
  79. #
  80. # All of these directives may appear inside <VirtualHost> containers,
  81. # in which case these default settings will be overridden for the
  82. # virtual host being defined.
  83. #
  84.  
  85. #
  86. # ServerAdmin: Your address, where problems with the server should be
  87. # e-mailed.  This address appears on some server-generated pages, such
  88. # as error documents.  e.g. admin@your-domain.com
  89. #
  90. ServerAdmin root@localhost
  91.  
  92. #
  93. # ServerName gives the name and port that the server uses to identify itself.
  94. # This can often be determined automatically, but we recommend you specify
  95. # it explicitly to prevent problems during startup.
  96. #
  97. # If your host doesn't have a registered DNS name, enter its IP address here.
  98. #
  99. #ServerName www.example.com:80
  100.  
  101. #
  102. # Deny access to the entirety of your server's filesystem. You must
  103. # explicitly permit access to web content directories in other
  104. # <Directory> blocks below.
  105. #
  106. <Directory />
  107.     AllowOverride none
  108.     Require all denied
  109. </Directory>
  110.  
  111. #
  112. # Note that from this point forward you must specifically allow
  113. # particular features to be enabled - so if something's not working as
  114. # you might expect, make sure that you have specifically enabled it
  115. # below.
  116. #
  117.  
  118. #
  119. # DocumentRoot: The directory out of which you will serve your
  120. # documents. By default, all requests are taken from this directory, but
  121. # symbolic links and aliases may be used to point to other locations.
  122. #
  123. DocumentRoot "/var/www/html"
  124.  
  125. #
  126. # Relax access to content within /var/www.
  127. #
  128. <Directory "/var/www">
  129.     AllowOverride None
  130.     # Allow open access:
  131.     Require all granted
  132. </Directory>
  133. <Directory /data/webs>
  134.     AllowOverride All
  135.     Require all granted
  136. </Directory>
  137. # Further relax access to the default document root:
  138. <Directory "/var/www/html">
  139.     #
  140.     # Possible values for the Options directive are "None", "All",
  141.     # or any combination of:
  142.     #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
  143.     #
  144.     # Note that "MultiViews" must be named *explicitly* --- "Options All"
  145.     # doesn't give it to you.
  146.     #
  147.     # The Options directive is both complicated and important.  Please see
  148.     # http://httpd.apache.org/docs/2.4/mod/core.html#options
  149.     # for more information.
  150.     #
  151.     Options Indexes FollowSymLinks
  152.  
  153.     #
  154.     # AllowOverride controls what directives may be placed in .htaccess files.
  155.     # It can be "All", "None", or any combination of the keywords:
  156.     #   Options FileInfo AuthConfig Limit
  157.     #
  158.     AllowOverride None
  159.  
  160.     #
  161.     # Controls who can get stuff from this server.
  162.     #
  163.     Require all granted
  164. </Directory>
  165.  
  166. #
  167. # DirectoryIndex: sets the file that Apache will serve if a directory
  168. # is requested.
  169. #
  170. <IfModule dir_module>
  171.     DirectoryIndex index.php index.html
  172. </IfModule>
  173.  
  174. #
  175. # The following lines prevent .htaccess and .htpasswd files from being
  176. # viewed by Web clients.
  177. #
  178. <Files ".ht*">
  179.     Require all denied
  180. </Files>
  181.  
  182. #
  183. # ErrorLog: The location of the error log file.
  184. # If you do not specify an ErrorLog directive within a <VirtualHost>
  185. # container, error messages relating to that virtual host will be
  186. # logged here.  If you *do* define an error logfile for a <VirtualHost>
  187. # container, that host's errors will be logged there and not here.
  188. #
  189. ErrorLog "logs/error_log"
  190.  
  191. #
  192. # LogLevel: Control the number of messages logged to the error_log.
  193. # Possible values include: debug, info, notice, warn, error, crit,
  194. # alert, emerg.
  195. #
  196. LogLevel warn
  197.  
  198. <IfModule log_config_module>
  199.     #
  200.     # The following directives define some format nicknames for use with
  201.     # a CustomLog directive (see below).
  202.     #
  203.     LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
  204.     LogFormat "%h %l %u %t \"%r\" %>s %b" common
  205.  
  206.     <IfModule logio_module>
  207.       # You need to enable mod_logio.c to use %I and %O
  208.       LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
  209.     </IfModule>
  210.  
  211.     #
  212.     # The location and format of the access logfile (Common Logfile Format).
  213.     # If you do not define any access logfiles within a <VirtualHost>
  214.     # container, they will be logged here.  Contrariwise, if you *do*
  215.     # define per-<VirtualHost> access logfiles, transactions will be
  216.     # logged therein and *not* in this file.
  217.     #
  218.     #CustomLog "logs/access_log" common
  219.  
  220.     #
  221.     # If you prefer a logfile with access, agent, and referer information
  222.     # (Combined Logfile Format) you can use the following directive.
  223.     #
  224.     CustomLog "logs/access_log" combined
  225. </IfModule>
  226.  
  227. <IfModule alias_module>
  228.     #
  229.     # Redirect: Allows you to tell clients about documents that used to
  230.     # exist in your server's namespace, but do not anymore. The client
  231.     # will make a new request for the document at its new location.
  232.     # Example:
  233.     # Redirect permanent /foo http://www.example.com/bar
  234.  
  235.     #
  236.     # Alias: Maps web paths into filesystem paths and is used to
  237.     # access content that does not live under the DocumentRoot.
  238.     # Example:
  239.     # Alias /webpath /full/filesystem/path
  240.     #
  241.     # If you include a trailing / on /webpath then the server will
  242.     # require it to be present in the URL.  You will also likely
  243.     # need to provide a <Directory> section to allow access to
  244.     # the filesystem path.
  245.  
  246.     #
  247.     # ScriptAlias: This controls which directories contain server scripts.
  248.     # ScriptAliases are essentially the same as Aliases, except that
  249.     # documents in the target directory are treated as applications and
  250.     # run by the server when requested rather than as documents sent to the
  251.     # client.  The same rules about trailing "/" apply to ScriptAlias
  252.     # directives as to Alias.
  253.     #
  254.     ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
  255.  
  256. </IfModule>
  257.  
  258. #
  259. # "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
  260. # CGI directory exists, if you have that configured.
  261. #
  262. <Directory "/var/www/cgi-bin">
  263.     AllowOverride None
  264.     Options None
  265.     Require all granted
  266. </Directory>
  267.  
  268. <IfModule mime_module>
  269.     #
  270.     # TypesConfig points to the file containing the list of mappings from
  271.     # filename extension to MIME-type.
  272.     #
  273.     TypesConfig /etc/mime.types
  274.  
  275.     #
  276.     # AddType allows you to add to or override the MIME configuration
  277.     # file specified in TypesConfig for specific file types.
  278.     #
  279.     #AddType application/x-gzip .tgz
  280.     #
  281.     # AddEncoding allows you to have certain browsers uncompress
  282.     # information on the fly. Note: Not all browsers support this.
  283.     #
  284.     #AddEncoding x-compress .Z
  285.     #AddEncoding x-gzip .gz .tgz
  286.     #
  287.     # If the AddEncoding directives above are commented-out, then you
  288.     # probably should define those extensions to indicate media types:
  289.     #
  290.     AddType application/x-compress .Z
  291.     AddType application/x-gzip .gz .tgz
  292.  
  293.     #
  294.     # AddHandler allows you to map certain file extensions to "handlers":
  295.     # actions unrelated to filetype. These can be either built into the server
  296.     # or added with the Action directive (see below)
  297.     #
  298.     # To use CGI scripts outside of ScriptAliased directories:
  299.     # (You will also need to add "ExecCGI" to the "Options" directive.)
  300.     #
  301.     #AddHandler cgi-script .cgi
  302.  
  303.     # For type maps (negotiated resources):
  304.     #AddHandler type-map var
  305.  
  306.     #
  307.     # Filters allow you to process content before it is sent to the client.
  308.     #
  309.     # To parse .shtml files for server-side includes (SSI):
  310.     # (You will also need to add "Includes" to the "Options" directive.)
  311.     #
  312.     AddType text/html .shtml
  313.     AddOutputFilter INCLUDES .shtml
  314. </IfModule>
  315.  
  316. #
  317. # Specify a default charset for all content served; this enables
  318. # interpretation of all content as UTF-8 by default.  To use the
  319. # default browser choice (ISO-8859-1), or to allow the META tags
  320. # in HTML content to override this choice, comment out this
  321. # directive:
  322. #
  323. AddDefaultCharset UTF-8
  324.  
  325. <IfModule mime_magic_module>
  326.     #
  327.     # The mod_mime_magic module allows the server to use various hints from the
  328.     # contents of the file itself to determine its type.  The MIMEMagicFile
  329.     # directive tells the module where the hint definitions are located.
  330.     #
  331.     MIMEMagicFile conf/magic
  332. </IfModule>
  333.  
  334. #
  335. # Customizable error responses come in three flavors:
  336. # 1) plain text 2) local redirects 3) external redirects
  337. #
  338. # Some examples:
  339. #ErrorDocument 500 "The server made a boo boo."
  340. #ErrorDocument 404 /missing.html
  341. #ErrorDocument 404 "/cgi-bin/missing_handler.pl"
  342. #ErrorDocument 402 http://www.example.com/subscription_info.html
  343. #
  344.  
  345. #
  346. # EnableMMAP and EnableSendfile: On systems that support it,
  347. # memory-mapping or the sendfile syscall may be used to deliver
  348. # files.  This usually improves server performance, but must
  349. # be turned off when serving from networked-mounted
  350. # filesystems or if support for these functions is otherwise
  351. # broken on your system.
  352. # Defaults if commented: EnableMMAP On, EnableSendfile Off
  353. #
  354. #EnableMMAP off
  355. EnableSendfile on
  356.  
  357. # Supplemental configuration
  358. #
  359. # Load config files in the "/etc/httpd/conf.d" directory, if any.
  360. IncludeOptional conf.d/*.conf
  361. Include sites/*.vhost
RAW Paste Data