httpd.conf 12 KB

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