Advertisement
sergioRodr

httpd conf

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