Advertisement
Guest User

conf httpd.conf

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