Advertisement
Guest User

Untitled

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