Advertisement
Guest User

httpd.conf

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