Advertisement
Guest User

Untitled

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