httpd.conf 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990
  1. #
  2. # This is the main Apache server configuration file. It contains the
  3. # configuration directives that give the server its instructions.
  4. # See <URL:http://httpd.apache.org/docs/2.2/> for detailed information.
  5. # In particular, see
  6. # <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
  7. # for a discussion of each configuration directive.
  8. #
  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. # The configuration directives are grouped into three basic sections:
  15. # 1. Directives that control the operation of the Apache server process as a
  16. # whole (the 'global environment').
  17. # 2. Directives that define the parameters of the 'main' or 'default' server,
  18. # which responds to requests that aren't handled by a virtual host.
  19. # These directives also provide default values for the settings
  20. # of all virtual hosts.
  21. # 3. Settings for virtual hosts, which allow Web requests to be sent to
  22. # different IP addresses or hostnames and have them handled by the
  23. # same Apache server process.
  24. #
  25. # Configuration and logfile names: If the filenames you specify for many
  26. # of the server's control files begin with "/" (or "drive:/" for Win32), the
  27. # server will use that explicit path. If the filenames do *not* begin
  28. # with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
  29. # with ServerRoot set to "/etc/httpd" will be interpreted by the
  30. # server as "/etc/httpd/logs/foo.log".
  31. #
  32. ### Section 1: Global Environment
  33. #
  34. # The directives in this section affect the overall operation of Apache,
  35. # such as the number of concurrent requests it can handle or where it
  36. # can find its configuration files.
  37. #
  38. #
  39. # Don't give away too much information about all the subcomponents
  40. # we are running. Comment out this line if you don't mind remote sites
  41. # finding out what major optional modules you are running
  42. ServerTokens OS
  43. #
  44. # ServerRoot: The top of the directory tree under which the server's
  45. # configuration, error, and log files are kept.
  46. #
  47. # NOTE! If you intend to place this on an NFS (or otherwise network)
  48. # mounted filesystem then please read the LockFile documentation
  49. # (available at <URL:http://httpd.apache.org/docs/2.2/mod/mpm_common.html#lockfile>);
  50. # you will save yourself a lot of trouble.
  51. #
  52. # Do NOT add a slash at the end of the directory path.
  53. #
  54. ServerRoot "/etc/apache2"
  55. #
  56. # PidFile: The file in which the server should record its process
  57. # identification number when it starts.
  58. #
  59. PidFile run/apache2.pid
  60. #
  61. # Timeout: The number of seconds before receives and sends time out.
  62. #
  63. Timeout 120
  64. #
  65. # KeepAlive: Whether or not to allow persistent connections (more than
  66. # one request per connection). Set to "Off" to deactivate.
  67. #
  68. KeepAlive Off
  69. #
  70. # MaxKeepAliveRequests: The maximum number of requests to allow
  71. # during a persistent connection. Set to 0 to allow an unlimited amount.
  72. # We recommend you leave this number high, for maximum performance.
  73. #
  74. MaxKeepAliveRequests 100
  75. #
  76. # KeepAliveTimeout: Number of seconds to wait for the next request from the
  77. # same client on the same connection.
  78. #
  79. KeepAliveTimeout 15
  80. ##
  81. ## Server-Pool Size Regulation (MPM specific)
  82. ##
  83. # prefork MPM
  84. # StartServers: number of server processes to start
  85. # MinSpareServers: minimum number of server processes which are kept spare
  86. # MaxSpareServers: maximum number of server processes which are kept spare
  87. # ServerLimit: maximum value for MaxClients for the lifetime of the server
  88. # MaxClients: maximum number of server processes allowed to start
  89. # MaxRequestsPerChild: maximum number of requests a server process serves
  90. <IfModule prefork.c>
  91. StartServers 8
  92. MinSpareServers 5
  93. MaxSpareServers 20
  94. ServerLimit 256
  95. MaxClients 256
  96. MaxRequestsPerChild 4000
  97. </IfModule>
  98. # worker MPM
  99. # StartServers: initial number of server processes to start
  100. # MaxClients: maximum number of simultaneous client connections
  101. # MinSpareThreads: minimum number of worker threads which are kept spare
  102. # MaxSpareThreads: maximum number of worker threads which are kept spare
  103. # ThreadsPerChild: constant number of worker threads in each server process
  104. # MaxRequestsPerChild: maximum number of requests a server process serves
  105. <IfModule worker.c>
  106. StartServers 2
  107. MaxClients 150
  108. MinSpareThreads 25
  109. MaxSpareThreads 75
  110. ThreadsPerChild 25
  111. MaxRequestsPerChild 0
  112. </IfModule>
  113. #
  114. # Listen: Allows you to bind Apache to specific IP addresses and/or
  115. # ports, in addition to the default. See also the <VirtualHost>
  116. # directive.
  117. #
  118. # Change this to Listen on specific IP addresses as shown below to
  119. # prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
  120. #
  121. #Listen 12.34.56.78:80
  122. Listen 80
  123. #
  124. # Dynamic Shared Object (DSO) Support
  125. #
  126. # To be able to use the functionality of a module which was built as a DSO you
  127. # have to place corresponding `LoadModule' lines at this location so the
  128. # directives contained in it are actually available _before_ they are used.
  129. # Statically compiled modules (those listed by `httpd -l') do not need
  130. # to be loaded here.
  131. #
  132. # Example:
  133. # LoadModule foo_module modules/mod_foo.so
  134. #
  135. LoadModule auth_basic_module modules/mod_auth_basic.so
  136. LoadModule auth_digest_module modules/mod_auth_digest.so
  137. LoadModule authn_file_module modules/mod_authn_file.so
  138. LoadModule authn_alias_module modules/mod_authn_alias.so
  139. LoadModule authn_anon_module modules/mod_authn_anon.so
  140. LoadModule authn_dbm_module modules/mod_authn_dbm.so
  141. LoadModule authn_default_module modules/mod_authn_default.so
  142. LoadModule authz_host_module modules/mod_authz_host.so
  143. LoadModule authz_user_module modules/mod_authz_user.so
  144. LoadModule authz_owner_module modules/mod_authz_owner.so
  145. LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
  146. LoadModule authz_dbm_module modules/mod_authz_dbm.so
  147. LoadModule authz_default_module modules/mod_authz_default.so
  148. LoadModule ldap_module modules/mod_ldap.so
  149. #LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
  150. LoadModule include_module modules/mod_include.so
  151. LoadModule log_config_module modules/mod_log_config.so
  152. LoadModule logio_module modules/mod_logio.so
  153. LoadModule env_module modules/mod_env.so
  154. LoadModule ext_filter_module modules/mod_ext_filter.so
  155. LoadModule mime_magic_module modules/mod_mime_magic.so
  156. LoadModule expires_module modules/mod_expires.so
  157. LoadModule deflate_module modules/mod_deflate.so
  158. LoadModule headers_module modules/mod_headers.so
  159. LoadModule usertrack_module modules/mod_usertrack.so
  160. LoadModule setenvif_module modules/mod_setenvif.so
  161. LoadModule mime_module modules/mod_mime.so
  162. LoadModule dav_module modules/mod_dav.so
  163. LoadModule status_module modules/mod_status.so
  164. LoadModule autoindex_module modules/mod_autoindex.so
  165. LoadModule info_module modules/mod_info.so
  166. LoadModule dav_fs_module modules/mod_dav_fs.so
  167. LoadModule vhost_alias_module modules/mod_vhost_alias.so
  168. LoadModule negotiation_module modules/mod_negotiation.so
  169. LoadModule dir_module modules/mod_dir.so
  170. LoadModule actions_module modules/mod_actions.so
  171. LoadModule speling_module modules/mod_speling.so
  172. LoadModule userdir_module modules/mod_userdir.so
  173. LoadModule alias_module modules/mod_alias.so
  174. LoadModule rewrite_module modules/mod_rewrite.so
  175. LoadModule proxy_module modules/mod_proxy.so
  176. LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
  177. LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
  178. LoadModule proxy_http_module modules/mod_proxy_http.so
  179. LoadModule proxy_connect_module modules/mod_proxy_connect.so
  180. LoadModule cache_module modules/mod_cache.so
  181. LoadModule suexec_module modules/mod_suexec.so
  182. LoadModule disk_cache_module modules/mod_disk_cache.so
  183. LoadModule file_cache_module modules/mod_file_cache.so
  184. LoadModule mem_cache_module modules/mod_mem_cache.so
  185. LoadModule cgi_module modules/mod_cgi.so
  186. #
  187. # The following modules are not loaded by default:
  188. #
  189. #LoadModule cern_meta_module modules/mod_cern_meta.so
  190. #LoadModule asis_module modules/mod_asis.so
  191. #
  192. # Load config files from the config directory "/etc/apache2/conf.d".
  193. #
  194. Include conf.d/*.conf
  195. #
  196. # ExtendedStatus controls whether Apache will generate "full" status
  197. # information (ExtendedStatus On) or just basic information (ExtendedStatus
  198. # Off) when the "server-status" handler is called. The default is Off.
  199. #
  200. #ExtendedStatus On
  201. #
  202. # If you wish httpd to run as a different user or group, you must run
  203. # httpd as root initially and it will switch.
  204. #
  205. # User/Group: The name (or #number) of the user/group to run httpd as.
  206. # . On SCO (ODT 3) use "User nouser" and "Group nogroup".
  207. # . On HPUX you may not be able to use shared memory as nobody, and the
  208. # suggested workaround is to create a user www and use that user.
  209. # NOTE that some kernels refuse to setgid(Group) or semctl(IPC_SET)
  210. # when the value of (unsigned)Group is above 60000;
  211. # don't use Group #-1 on these systems!
  212. #
  213. User apache
  214. Group apache
  215. ### Section 2: 'Main' server configuration
  216. #
  217. # The directives in this section set up the values used by the 'main'
  218. # server, which responds to any requests that aren't handled by a
  219. # <VirtualHost> definition. These values also provide defaults for
  220. # any <VirtualHost> containers you may define later in the file.
  221. #
  222. # All of these directives may appear inside <VirtualHost> containers,
  223. # in which case these default settings will be overridden for the
  224. # virtual host being defined.
  225. #
  226. #
  227. # ServerAdmin: Your address, where problems with the server should be
  228. # e-mailed. This address appears on some server-generated pages, such
  229. # as error documents. e.g. admin@your-domain.com
  230. #
  231. ServerAdmin root@localhost
  232. #
  233. # ServerName gives the name and port that the server uses to identify itself.
  234. # This can often be determined automatically, but we recommend you specify
  235. # it explicitly to prevent problems during startup.
  236. #
  237. # If this is not set to valid DNS name for your host, server-generated
  238. # redirections will not work. See also the UseCanonicalName directive.
  239. #
  240. # If your host doesn't have a registered DNS name, enter its IP address here.
  241. # You will have to access it by its address anyway, and this will make
  242. # redirections work in a sensible way.
  243. #
  244. #ServerName www.example.com:80
  245. #
  246. # UseCanonicalName: Determines how Apache constructs self-referencing
  247. # URLs and the SERVER_NAME and SERVER_PORT variables.
  248. # When set "Off", Apache will use the Hostname and Port supplied
  249. # by the client. When set "On", Apache will use the value of the
  250. # ServerName directive.
  251. #
  252. UseCanonicalName Off
  253. #
  254. # DocumentRoot: The directory out of which you will serve your
  255. # documents. By default, all requests are taken from this directory, but
  256. # symbolic links and aliases may be used to point to other locations.
  257. #
  258. DocumentRoot "/var/www/html"
  259. #
  260. # Each directory to which Apache has access can be configured with respect
  261. # to which services and features are allowed and/or disabled in that
  262. # directory (and its subdirectories).
  263. #
  264. # First, we configure the "default" to be a very restrictive set of
  265. # features.
  266. #
  267. <Directory />
  268. Options FollowSymLinks
  269. AllowOverride None
  270. </Directory>
  271. #
  272. # Note that from this point forward you must specifically allow
  273. # particular features to be enabled - so if something's not working as
  274. # you might expect, make sure that you have specifically enabled it
  275. # below.
  276. #
  277. #
  278. # This should be changed to whatever you set DocumentRoot to.
  279. #
  280. <Directory "/var/www/html">
  281. #
  282. # Possible values for the Options directive are "None", "All",
  283. # or any combination of:
  284. # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
  285. #
  286. # Note that "MultiViews" must be named *explicitly* --- "Options All"
  287. # doesn't give it to you.
  288. #
  289. # The Options directive is both complicated and important. Please see
  290. # http://httpd.apache.org/docs/2.2/mod/core.html#options
  291. # for more information.
  292. #
  293. Options Indexes FollowSymLinks
  294. #
  295. # AllowOverride controls what directives may be placed in .htaccess files.
  296. # It can be "All", "None", or any combination of the keywords:
  297. # Options FileInfo AuthConfig Limit
  298. #
  299. AllowOverride None
  300. #
  301. # Controls who can get stuff from this server.
  302. #
  303. Order allow,deny
  304. Allow from all
  305. </Directory>
  306. #
  307. # UserDir: The name of the directory that is appended onto a user's home
  308. # directory if a ~user request is received.
  309. #
  310. # The path to the end user account 'public_html' directory must be
  311. # accessible to the webserver userid. This usually means that ~userid
  312. # must have permissions of 711, ~userid/public_html must have permissions
  313. # of 755, and documents contained therein must be world-readable.
  314. # Otherwise, the client will only receive a "403 Forbidden" message.
  315. #
  316. # See also: http://httpd.apache.org/docs/misc/FAQ.html#forbidden
  317. #
  318. <IfModule mod_userdir.c>
  319. #
  320. # UserDir is disabled by default since it can confirm the presence
  321. # of a username on the system (depending on home directory
  322. # permissions).
  323. #
  324. UserDir disable
  325. #
  326. # To enable requests to /~user/ to serve the user's public_html
  327. # directory, remove the "UserDir disable" line above, and uncomment
  328. # the following line instead:
  329. #
  330. #UserDir public_html
  331. </IfModule>
  332. #
  333. # Control access to UserDir directories. The following is an example
  334. # for a site where these directories are restricted to read-only.
  335. #
  336. #<Directory /home/*/public_html>
  337. # AllowOverride FileInfo AuthConfig Limit
  338. # Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
  339. # <Limit GET POST OPTIONS>
  340. # Order allow,deny
  341. # Allow from all
  342. # </Limit>
  343. # <LimitExcept GET POST OPTIONS>
  344. # Order deny,allow
  345. # Deny from all
  346. # </LimitExcept>
  347. #</Directory>
  348. #
  349. # DirectoryIndex: sets the file that Apache will serve if a directory
  350. # is requested.
  351. #
  352. # The index.html.var file (a type-map) is used to deliver content-
  353. # negotiated documents. The MultiViews Option can be used for the
  354. # same purpose, but it is much slower.
  355. #
  356. DirectoryIndex index.html index.html.var
  357. #
  358. # AccessFileName: The name of the file to look for in each directory
  359. # for additional configuration directives. See also the AllowOverride
  360. # directive.
  361. #
  362. AccessFileName .htaccess
  363. #
  364. # The following lines prevent .htaccess and .htpasswd files from being
  365. # viewed by Web clients.
  366. #
  367. <Files ~ "^\.ht">
  368. Order allow,deny
  369. Deny from all
  370. </Files>
  371. #
  372. # TypesConfig describes where the mime.types file (or equivalent) is
  373. # to be found.
  374. #
  375. TypesConfig /etc/mime.types
  376. #
  377. # DefaultType is the default MIME type the server will use for a document
  378. # if it cannot otherwise determine one, such as from filename extensions.
  379. # If your server contains mostly text or HTML documents, "text/plain" is
  380. # a good value. If most of your content is binary, such as applications
  381. # or images, you may want to use "application/octet-stream" instead to
  382. # keep browsers from trying to display binary files as though they are
  383. # text.
  384. #
  385. DefaultType text/plain
  386. #
  387. # The mod_mime_magic module allows the server to use various hints from the
  388. # contents of the file itself to determine its type. The MIMEMagicFile
  389. # directive tells the module where the hint definitions are located.
  390. #
  391. <IfModule mod_mime_magic.c>
  392. # MIMEMagicFile /usr/share/magic.mime
  393. MIMEMagicFile conf/magic
  394. </IfModule>
  395. #
  396. # HostnameLookups: Log the names of clients or just their IP addresses
  397. # e.g., www.apache.org (on) or 204.62.129.132 (off).
  398. # The default is off because it'd be overall better for the net if people
  399. # had to knowingly turn this feature on, since enabling it means that
  400. # each client request will result in AT LEAST one lookup request to the
  401. # nameserver.
  402. #
  403. HostnameLookups Off
  404. #
  405. # EnableMMAP: Control whether memory-mapping is used to deliver
  406. # files (assuming that the underlying OS supports it).
  407. # The default is on; turn this off if you serve from NFS-mounted
  408. # filesystems. On some systems, turning it off (regardless of
  409. # filesystem) can improve performance; for details, please see
  410. # http://httpd.apache.org/docs/2.2/mod/core.html#enablemmap
  411. #
  412. #EnableMMAP off
  413. #
  414. # EnableSendfile: Control whether the sendfile kernel support is
  415. # used to deliver files (assuming that the OS supports it).
  416. # The default is on; turn this off if you serve from NFS-mounted
  417. # filesystems. Please see
  418. # http://httpd.apache.org/docs/2.2/mod/core.html#enablesendfile
  419. #
  420. #EnableSendfile off
  421. #
  422. # ErrorLog: The location of the error log file.
  423. # If you do not specify an ErrorLog directive within a <VirtualHost>
  424. # container, error messages relating to that virtual host will be
  425. # logged here. If you *do* define an error logfile for a <VirtualHost>
  426. # container, that host's errors will be logged there and not here.
  427. #
  428. ErrorLog logs/error_log
  429. #
  430. # LogLevel: Control the number of messages logged to the error_log.
  431. # Possible values include: debug, info, notice, warn, error, crit,
  432. # alert, emerg.
  433. #
  434. LogLevel warn
  435. #
  436. # The following directives define some format nicknames for use with
  437. # a CustomLog directive (see below).
  438. #
  439. LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
  440. LogFormat "%h %l %u %t \"%r\" %>s %b" common
  441. LogFormat "%{Referer}i -> %U" referer
  442. LogFormat "%{User-agent}i" agent
  443. # "combinedio" includes actual counts of actual bytes received (%I) and sent (%O); this
  444. # requires the mod_logio module to be loaded.
  445. #LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
  446. #
  447. # The location and format of the access logfile (Common Logfile Format).
  448. # If you do not define any access logfiles within a <VirtualHost>
  449. # container, they will be logged here. Contrariwise, if you *do*
  450. # define per-<VirtualHost> access logfiles, transactions will be
  451. # logged therein and *not* in this file.
  452. #
  453. #CustomLog logs/access_log common
  454. #
  455. # If you would like to have separate agent and referer logfiles, uncomment
  456. # the following directives.
  457. #
  458. #CustomLog logs/referer_log referer
  459. #CustomLog logs/agent_log agent
  460. #
  461. # For a single logfile with access, agent, and referer information
  462. # (Combined Logfile Format), use the following directive:
  463. #
  464. CustomLog logs/access_log combined
  465. #
  466. # Optionally add a line containing the server version and virtual host
  467. # name to server-generated pages (internal error documents, FTP directory
  468. # listings, mod_status and mod_info output etc., but not CGI generated
  469. # documents or custom error documents).
  470. # Set to "EMail" to also include a mailto: link to the ServerAdmin.
  471. # Set to one of: On | Off | EMail
  472. #
  473. ServerSignature On
  474. #
  475. # Aliases: Add here as many aliases as you need (with no limit). The format is
  476. # Alias fakename realname
  477. #
  478. # Note that if you include a trailing / on fakename then the server will
  479. # require it to be present in the URL. So "/icons" isn't aliased in this
  480. # example, only "/icons/". If the fakename is slash-terminated, then the
  481. # realname must also be slash terminated, and if the fakename omits the
  482. # trailing slash, the realname must also omit it.
  483. #
  484. # We include the /icons/ alias for FancyIndexed directory listings. If you
  485. # do not use FancyIndexing, you may comment this out.
  486. #
  487. Alias /icons/ "/var/www/icons/"
  488. <Directory "/var/www/icons">
  489. Options Indexes MultiViews
  490. AllowOverride None
  491. Order allow,deny
  492. Allow from all
  493. </Directory>
  494. #
  495. # WebDAV module configuration section.
  496. #
  497. <IfModule mod_dav_fs.c>
  498. # Location of the WebDAV lock database.
  499. DAVLockDB /var/lib/dav/lockdb
  500. </IfModule>
  501. #
  502. # ScriptAlias: This controls which directories contain server scripts.
  503. # ScriptAliases are essentially the same as Aliases, except that
  504. # documents in the realname directory are treated as applications and
  505. # run by the server when requested rather than as documents sent to the client.
  506. # The same rules about trailing "/" apply to ScriptAlias directives as to
  507. # Alias.
  508. #
  509. ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
  510. #
  511. # "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
  512. # CGI directory exists, if you have that configured.
  513. #
  514. <Directory "/var/www/cgi-bin">
  515. AllowOverride None
  516. Options None
  517. Order allow,deny
  518. Allow from all
  519. </Directory>
  520. #
  521. # Redirect allows you to tell clients about documents which used to exist in
  522. # your server's namespace, but do not anymore. This allows you to tell the
  523. # clients where to look for the relocated document.
  524. # Example:
  525. # Redirect permanent /foo http://www.example.com/bar
  526. #
  527. # Directives controlling the display of server-generated directory listings.
  528. #
  529. #
  530. # IndexOptions: Controls the appearance of server-generated directory
  531. # listings.
  532. #
  533. IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable
  534. #
  535. # AddIcon* directives tell the server which icon to show for different
  536. # files or filename extensions. These are only displayed for
  537. # FancyIndexed directories.
  538. #
  539. AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
  540. AddIconByType (TXT,/icons/text.gif) text/*
  541. AddIconByType (IMG,/icons/image2.gif) image/*
  542. AddIconByType (SND,/icons/sound2.gif) audio/*
  543. AddIconByType (VID,/icons/movie.gif) video/*
  544. AddIcon /icons/binary.gif .bin .exe
  545. AddIcon /icons/binhex.gif .hqx
  546. AddIcon /icons/tar.gif .tar
  547. AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
  548. AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
  549. AddIcon /icons/a.gif .ps .ai .eps
  550. AddIcon /icons/layout.gif .html .shtml .htm .pdf
  551. AddIcon /icons/text.gif .txt
  552. AddIcon /icons/c.gif .c
  553. AddIcon /icons/p.gif .pl .py
  554. AddIcon /icons/f.gif .for
  555. AddIcon /icons/dvi.gif .dvi
  556. AddIcon /icons/uuencoded.gif .uu
  557. AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
  558. AddIcon /icons/tex.gif .tex
  559. AddIcon /icons/bomb.gif core
  560. AddIcon /icons/back.gif ..
  561. AddIcon /icons/hand.right.gif README
  562. AddIcon /icons/folder.gif ^^DIRECTORY^^
  563. AddIcon /icons/blank.gif ^^BLANKICON^^
  564. #
  565. # DefaultIcon is which icon to show for files which do not have an icon
  566. # explicitly set.
  567. #
  568. DefaultIcon /icons/unknown.gif
  569. #
  570. # AddDescription allows you to place a short description after a file in
  571. # server-generated indexes. These are only displayed for FancyIndexed
  572. # directories.
  573. # Format: AddDescription "description" filename
  574. #
  575. #AddDescription "GZIP compressed document" .gz
  576. #AddDescription "tar archive" .tar
  577. #AddDescription "GZIP compressed tar archive" .tgz
  578. #
  579. # ReadmeName is the name of the README file the server will look for by
  580. # default, and append to directory listings.
  581. #
  582. # HeaderName is the name of a file which should be prepended to
  583. # directory indexes.
  584. ReadmeName README.html
  585. HeaderName HEADER.html
  586. #
  587. # IndexIgnore is a set of filenames which directory indexing should ignore
  588. # and not include in the listing. Shell-style wildcarding is permitted.
  589. #
  590. IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
  591. #
  592. # DefaultLanguage and AddLanguage allows you to specify the language of
  593. # a document. You can then use content negotiation to give a browser a
  594. # file in a language the user can understand.
  595. #
  596. # Specify a default language. This means that all data
  597. # going out without a specific language tag (see below) will
  598. # be marked with this one. You probably do NOT want to set
  599. # this unless you are sure it is correct for all cases.
  600. #
  601. # * It is generally better to not mark a page as
  602. # * being a certain language than marking it with the wrong
  603. # * language!
  604. #
  605. # DefaultLanguage nl
  606. #
  607. # Note 1: The suffix does not have to be the same as the language
  608. # keyword --- those with documents in Polish (whose net-standard
  609. # language code is pl) may wish to use "AddLanguage pl .po" to
  610. # avoid the ambiguity with the common suffix for perl scripts.
  611. #
  612. # Note 2: The example entries below illustrate that in some cases
  613. # the two character 'Language' abbreviation is not identical to
  614. # the two character 'Country' code for its country,
  615. # E.g. 'Danmark/dk' versus 'Danish/da'.
  616. #
  617. # Note 3: In the case of 'ltz' we violate the RFC by using a three char
  618. # specifier. There is 'work in progress' to fix this and get
  619. # the reference data for rfc1766 cleaned up.
  620. #
  621. # Catalan (ca) - Croatian (hr) - Czech (cs) - Danish (da) - Dutch (nl)
  622. # English (en) - Esperanto (eo) - Estonian (et) - French (fr) - German (de)
  623. # Greek-Modern (el) - Hebrew (he) - Italian (it) - Japanese (ja)
  624. # Korean (ko) - Luxembourgeois* (ltz) - Norwegian Nynorsk (nn)
  625. # Norwegian (no) - Polish (pl) - Portugese (pt)
  626. # Brazilian Portuguese (pt-BR) - Russian (ru) - Swedish (sv)
  627. # Simplified Chinese (zh-CN) - Spanish (es) - Traditional Chinese (zh-TW)
  628. #
  629. AddLanguage ca .ca
  630. AddLanguage cs .cz .cs
  631. AddLanguage da .dk
  632. AddLanguage de .de
  633. AddLanguage el .el
  634. AddLanguage en .en
  635. AddLanguage eo .eo
  636. AddLanguage es .es
  637. AddLanguage et .et
  638. AddLanguage fr .fr
  639. AddLanguage he .he
  640. AddLanguage hr .hr
  641. AddLanguage it .it
  642. AddLanguage ja .ja
  643. AddLanguage ko .ko
  644. AddLanguage ltz .ltz
  645. AddLanguage nl .nl
  646. AddLanguage nn .nn
  647. AddLanguage no .no
  648. AddLanguage pl .po
  649. AddLanguage pt .pt
  650. AddLanguage pt-BR .pt-br
  651. AddLanguage ru .ru
  652. AddLanguage sv .sv
  653. AddLanguage zh-CN .zh-cn
  654. AddLanguage zh-TW .zh-tw
  655. #
  656. # LanguagePriority allows you to give precedence to some languages
  657. # in case of a tie during content negotiation.
  658. #
  659. # Just list the languages in decreasing order of preference. We have
  660. # more or less alphabetized them here. You probably want to change this.
  661. #
  662. LanguagePriority en ja ca cs da de el eo es et fr he hr it ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW
  663. #
  664. # ForceLanguagePriority allows you to serve a result page rather than
  665. # MULTIPLE CHOICES (Prefer) [in case of a tie] or NOT ACCEPTABLE (Fallback)
  666. # [in case no accepted languages matched the available variants]
  667. #
  668. ForceLanguagePriority Prefer Fallback
  669. #
  670. # Specify a default charset for all content served; this enables
  671. # interpretation of all content as UTF-8 by default. To use the
  672. # default browser choice (ISO-8859-1), or to allow the META tags
  673. # in HTML content to override this choice, comment out this
  674. # directive:
  675. #
  676. #AddDefaultCharset UTF-8
  677. #
  678. # AddType allows you to add to or override the MIME configuration
  679. # file mime.types for specific file types.
  680. #
  681. #AddType application/x-tar .tgz
  682. #
  683. # AddEncoding allows you to have certain browsers uncompress
  684. # information on the fly. Note: Not all browsers support this.
  685. # Despite the name similarity, the following Add* directives have nothing
  686. # to do with the FancyIndexing customization directives above.
  687. #
  688. #AddEncoding x-compress .Z
  689. #AddEncoding x-gzip .gz .tgz
  690. # If the AddEncoding directives above are commented-out, then you
  691. # probably should define those extensions to indicate media types:
  692. #
  693. AddType application/x-compress .Z
  694. AddType application/x-gzip .gz .tgz
  695. #
  696. # AddHandler allows you to map certain file extensions to "handlers":
  697. # actions unrelated to filetype. These can be either built into the server
  698. # or added with the Action directive (see below)
  699. #
  700. # To use CGI scripts outside of ScriptAliased directories:
  701. # (You will also need to add "ExecCGI" to the "Options" directive.)
  702. #
  703. #AddHandler cgi-script .cgi
  704. #
  705. # For files that include their own HTTP headers:
  706. #
  707. #AddHandler send-as-is asis
  708. #
  709. # For type maps (negotiated resources):
  710. # (This is enabled by default to allow the Apache "It Worked" page
  711. # to be distributed in multiple languages.)
  712. #
  713. AddHandler type-map var
  714. #
  715. # Filters allow you to process content before it is sent to the client.
  716. #
  717. # To parse .shtml files for server-side includes (SSI):
  718. # (You will also need to add "Includes" to the "Options" directive.)
  719. #
  720. AddType text/html .shtml
  721. AddOutputFilter INCLUDES .shtml
  722. #
  723. # Action lets you define media types that will execute a script whenever
  724. # a matching file is called. This eliminates the need for repeated URL
  725. # pathnames for oft-used CGI file processors.
  726. # Format: Action media/type /cgi-script/location
  727. # Format: Action handler-name /cgi-script/location
  728. #
  729. #
  730. # Customizable error responses come in three flavors:
  731. # 1) plain text 2) local redirects 3) external redirects
  732. #
  733. # Some examples:
  734. #ErrorDocument 500 "The server made a boo boo."
  735. #ErrorDocument 404 /missing.html
  736. #ErrorDocument 404 "/cgi-bin/missing_handler.pl"
  737. #ErrorDocument 402 http://www.example.com/subscription_info.html
  738. #
  739. #
  740. # Putting this all together, we can internationalize error responses.
  741. #
  742. # We use Alias to redirect any /error/HTTP_<error>.html.var response to
  743. # our collection of by-error message multi-language collections. We use
  744. # includes to substitute the appropriate text.
  745. #
  746. # You can modify the messages' appearance without changing any of the
  747. # default HTTP_<error>.html.var files by adding the line:
  748. #
  749. # Alias /error/include/ "/your/include/path/"
  750. #
  751. # which allows you to create your own set of files by starting with the
  752. # /var/www/error/include/ files and
  753. # copying them to /your/include/path/, even on a per-VirtualHost basis.
  754. #
  755. Alias /error/ "/var/www/error/"
  756. <IfModule mod_negotiation.c>
  757. <IfModule mod_include.c>
  758. <Directory "/var/www/error">
  759. AllowOverride None
  760. Options IncludesNoExec
  761. AddOutputFilter Includes html
  762. AddHandler type-map var
  763. Order allow,deny
  764. Allow from all
  765. LanguagePriority en es de fr
  766. ForceLanguagePriority Prefer Fallback
  767. </Directory>
  768. # ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
  769. # ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
  770. # ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
  771. # ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
  772. # ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
  773. # ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
  774. # ErrorDocument 410 /error/HTTP_GONE.html.var
  775. # ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
  776. # ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
  777. # ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
  778. # ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
  779. # ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
  780. # ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
  781. # ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
  782. # ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
  783. # ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
  784. # ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var
  785. </IfModule>
  786. </IfModule>
  787. #
  788. # The following directives modify normal HTTP response behavior to
  789. # handle known problems with browser implementations.
  790. #
  791. BrowserMatch "Mozilla/2" nokeepalive
  792. BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
  793. BrowserMatch "RealPlayer 4\.0" force-response-1.0
  794. BrowserMatch "Java/1\.0" force-response-1.0
  795. BrowserMatch "JDK/1\.0" force-response-1.0
  796. #
  797. # The following directive disables redirects on non-GET requests for
  798. # a directory that does not include the trailing slash. This fixes a
  799. # problem with Microsoft WebFolders which does not appropriately handle
  800. # redirects for folders with DAV methods.
  801. # Same deal with Apple's DAV filesystem and Gnome VFS support for DAV.
  802. #
  803. BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
  804. BrowserMatch "MS FrontPage" redirect-carefully
  805. BrowserMatch "^WebDrive" redirect-carefully
  806. BrowserMatch "^WebDAVFS/1.[0123]" redirect-carefully
  807. BrowserMatch "^gnome-vfs/1.0" redirect-carefully
  808. BrowserMatch "^XML Spy" redirect-carefully
  809. BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully
  810. #
  811. # Allow server status reports generated by mod_status,
  812. # with the URL of http://servername/server-status
  813. # Change the ".example.com" to match your domain to enable.
  814. #
  815. #<Location /server-status>
  816. # SetHandler server-status
  817. # Order deny,allow
  818. # Deny from all
  819. # Allow from .example.com
  820. #</Location>
  821. #
  822. # Allow remote server configuration reports, with the URL of
  823. # http://servername/server-info (requires that mod_info.c be loaded).
  824. # Change the ".example.com" to match your domain to enable.
  825. #
  826. #<Location /server-info>
  827. # SetHandler server-info
  828. # Order deny,allow
  829. # Deny from all
  830. # Allow from .example.com
  831. #</Location>
  832. #
  833. # Proxy Server directives. Uncomment the following lines to
  834. # enable the proxy server:
  835. #
  836. #<IfModule mod_proxy.c>
  837. #ProxyRequests On
  838. #
  839. #<Proxy *>
  840. # Order deny,allow
  841. # Deny from all
  842. # Allow from .example.com
  843. #</Proxy>
  844. #
  845. # Enable/disable the handling of HTTP/1.1 "Via:" headers.
  846. # ("Full" adds the server version; "Block" removes all outgoing Via: headers)
  847. # Set to one of: Off | On | Full | Block
  848. #
  849. #ProxyVia On
  850. #
  851. # To enable a cache of proxied content, uncomment the following lines.
  852. # See http://httpd.apache.org/docs/2.2/mod/mod_cache.html for more details.
  853. #
  854. #<IfModule mod_disk_cache.c>
  855. # CacheEnable disk /
  856. # CacheRoot "/var/cache/mod_proxy"
  857. #</IfModule>
  858. #
  859. #</IfModule>
  860. # End of proxy directives.
  861. ### Section 3: Virtual Hosts
  862. #
  863. # VirtualHost: If you want to maintain multiple domains/hostnames on your
  864. # machine you can setup VirtualHost containers for them. Most configurations
  865. # use only name-based virtual hosts so the server doesn't need to worry about
  866. # IP addresses. This is indicated by the asterisks in the directives below.
  867. #
  868. # Please see the documentation at
  869. # <URL:http://httpd.apache.org/docs/2.2/vhosts/>
  870. # for further details before you try to setup virtual hosts.
  871. #
  872. # You may use the command line option '-S' to verify your virtual host
  873. # configuration.
  874. #
  875. # Use name-based virtual hosting.
  876. #
  877. #NameVirtualHost *:80
  878. #
  879. # NOTE: NameVirtualHost cannot be used without a port specifier
  880. # (e.g. :80) if mod_ssl is being used, due to the nature of the
  881. # SSL protocol.
  882. #
  883. #
  884. # VirtualHost example:
  885. # Almost any Apache directive may go into a VirtualHost container.
  886. # The first VirtualHost section is used for requests without a known
  887. # server name.
  888. #
  889. #<VirtualHost *:80>
  890. # ServerAdmin webmaster@dummy-host.example.com
  891. # DocumentRoot /www/docs/dummy-host.example.com
  892. # ServerName dummy-host.example.com
  893. # ErrorLog logs/dummy-host.example.com-error_log
  894. # CustomLog logs/dummy-host.example.com-access_log common
  895. #</VirtualHost>