httpd.conf 12 KB

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