General Apache configuration 2

Source: Internet
Author: User

 

 

#

# Control access to userdir directories. The following is an example

# For a site where these directories are restricted to read-only.

#

# <Directory/home/*/public_html>

# AllowOverride fileinfo authconfig limit

# Options Multiviews indexes symlinksifownermatch IncludesNOEXEC

# <Limit get post Options>

# Order allow, deny

# Allow from all

# </Limit>

# <Limitaskt get post Options>

# Order deny, allow

# Deny from all

# </Limit10000t>

# </Directory>

 

#

# Directoryindex: sets the file that Apache will serve if a directory

# Is requested.

#

# The index.html. var file (a type-map) is used to deliver content-

# Negotiated documents. The Multiviews option can be used for

# Same purpose, but it is much slower.

#

Directoryindex index.html index.shtml index. php

 

#

# Accessfilename: the name of the file to look for in each directory

# For Additional configuration directives. See also the AllowOverride

# Directive.

#

Accessfilename. htaccess

 

#

# The following lines prevent. htaccess and. htpasswd files from being

# Viewed by web clients.

#

<Files ~ "^/. Ht">

Order allow, deny

Deny from all

</Files>

 

#

# Typesconfig describes where the mime. types file (or equivalent) is

# To be found.

#

Typesconfig/etc/mime. Types

 

#

# Defaulttype is the default MIME type the server will use for a document

# If it cannot otherwise determine one, such as from filename extensions.

# If your server contains mostly text or HTML documents, "text/plain" is

# A good value. If most of your content is binary, such as applications

# Or images, you may want to use "application/octet-stream" instead

# Keep browsers from trying to display binary files as though they are

# Text.

#

Defaulttype text/plain

 

#

# The mod_mime_magic module allows the server to use varous hints from

# Contents of the file itself to determine its type. The mimemagicfile

# Directive tells the module where the hint definitions are located.

#

<Ifmodule mod_mime_magic.c>

# Mimemagicfile/usr/share/magic. Mime

Mimemagicfile CONF/magic

</Ifmodule>

 

#

# Hostnamelookups: log the names of clients or just their IP addresses

# E.g., www.apache.org (on) or 204.62.129.132 (off ).

# The default is off because it 'd be overall better for the net if people

# Had To knowinugly turn this feature on, since enabling it means that

# Each client request will result in at least one lookup request to

# Nameserver.

#

Hostnamelookups off

 

#

# Enablemmap: control whether memory-mapping is used to deliver

# Files (assuming that the underlying OS supports it ).

# The default is on; turn this off if you serve from nfs-mounted

# Filesystems. On some systems, turning it off (regardless

# Filesystem) can improve performance; For details, please see

# Http://httpd.apache.org/docs/2.2/mod/core.html#enablemmap

#

# Enablemmap off

 

#

# Enablesendfile: control whether the sendfile Kernel support is

# Used to deliver files (assuming that the OS supports it ).

# The default is on; turn this off if you serve from nfs-mounted

# Filesystems. Please see

# Http://httpd.apache.org/docs/2.2/mod/core.html#enablesendfile

#

# Enablesendfile off

 

#

# Errorlog: the location of the error log file.

# If you do not specify an errorlog directive within a <virtualhost>

# Container, error messages relating to that virtual host will be

# Logged here. If you * do * define an error logfile for a <virtualhost>

# Container, that host's errors will be logged there and not here.

#

Errorlog logs/error_log

 

#

# Loglevel: control the number of messages logged to the error_log.

# Possible values include: Debug, info, notice, warn, error, crit,

# Alert, emerg.

#

Loglevel warn

 

#

# The following Directives define some format nicknames for use

# A customlog Directive (see below ).

#

Logformat "% H % L % u % t/" % R/"%> S % B/" % {Referer} I/"/" % {User-Agent} I/ "" combined

Logformat "% H % L % u % t/" % R/"%> S % B" common

Logformat "% {Referer} I-> % u" Referer

Logformat "% {User-Agent} I" Agent

 

# "Combinedio" events des actual counts of actual bytes encoded ed (% I) and sent (% O); this

# Requires the mod_logio module to be loaded.

# Logformat "% H % L % u % t/" % R/"%> S % B/" % {Referer} I/"/" % {User-Agent} I /"% I % O" combinedio

 

#

# The location and format of the access logfile (Common logfile format ).

# If you do not define any access logfiles within a <virtualhost>

# Container, they will be logged here. Contrariwise, if you * do *

# Define per-<virtualhost> access logfiles, transactions will be

# Logged therein and * not * in this file.

#

# Customlog logs/access_log common

 

#

# If you wowould like to have separate agent and Referer logfiles, uncomment

# The following directives.

#

# Customlog logs/referer_log Referer

# Customlog logs/agent_log agent

 

#

# For a single logfile with access, agent, and referer information

# (Combined logfile format), use the following Directive:

#

Customlog logs/access_log combined

 

#

# Optionally add a line containing the server version and virtual host

# Name to server-generated pages (internal error documents, FTP directory

# Listings, mod_status and mod_info output etc., but not CGI generated

# Documents or custom error documents ).

# Set to "email" to also include a mailto: Link to the serveradmin.

# Set to one of: On | off | email

#

Serversignature off

 

#

# Aliases: add here as your aliases as you need (with no limit). The format is

# Alias fakename realname

#

# Note that if you include a trailing/on fakename then the server will

# Require it to be present in the URL. So "/icons" isn' t aliased in this

# Example, only "/icons/". If the fakename is Slash-terminated, then

# Realname must also be slash terminated, and if the fakename omits

# Trailing slash, The realname must also omit it.

#

# We include the/icons/alias for fancyindexed directory listings. If you

# Do not use fancyindexing, you may comment this out.

#

Alias/icons/"/var/www/icons /"

 

<Directory "/var/www/icons">

Options indexes Multiviews

AllowOverride none

Order allow, deny

Allow from all

</Directory>

 

#

# WebDAV module configuration section.

#

<Ifmodule mod_dav_fs.c>

# Location of the WebDAV lock database.

Davlockdb/var/lib/Dav/lockdb

</Ifmodule>

 

#

# ScriptAlias: This controls which directories contain server scripts.

# Scriptaliases are essential the same as aliases, doesn't that

# Events in the realname directory are treated as applications and

# Run by the server when requested rather than as your ents sent to the client.

# The same rules about trailing "/" apply to ScriptAlias directives as

# Alias.

#

ScriptAlias/cgi-bin/"/var/www/cgi-bin /"

 

#

# "/Var/www/cgi-bin" shocould be changed to whatever your scriptaliased

# CGI directory exists, if you have that configured.

#

<Directory "/var/www/cgi-bin">

AllowOverride none

Options none

Order allow, deny

Allow from all

</Directory>

 

#

# Redirect allows you to tell clients about documents which used to exist in

# Your server's namespace, but do not anymore. This allows you to tell

# Clients where to look for the relocated document.

# Example:

# Redirect permanent/Foo http://www.example.com/bar

 

#

# Directives controlling the display of server-generated directory listings.

#

 

#

# Indexoptions: controls the appearance of server-generated directory

# Listings.

#

Indexoptions fancyindexing versionsort namewidth = * htmltable

 

#

# Addicon * directives tell the server which icon to show for different

# Files or filename extensions. These are only displayed

# Fancyindexed directories.

#

Addiconbyencoding (CMP,/icons/compressed.gif) x-compress X-Gzip

 

Addiconbytype (txt,/icons/text.gif) text /*

Addiconbytype (IMG,/icons/image2.gif) image /*

Addiconbytype (SND,/icons/sound2.gif) Audio /*

Addiconbytype (VID,/icons/movie.gif) Video /*

 

Addicon/icons/binary.gif. bin. exe

Addicon/icons/binhex.gif. hqx

Addicon/icons/tar.gif. Tar

Addicon/icons/world2.gif. WRL .wrl.gz. Fig. VRM. iv

Addicon/icons/compressed.gif. Z. Z. tgz. GZ. Zip

Addicon/icons/a.gif. PS. AI. EPS

Addicon/icons/layout.gif. html. shtml. htm. PDF

Addicon/icons/text.gif. txt

Addicon/icons/c.gif. c

Addicon/icons/p.gif. pl. py

Addicon/icons/f.gif.

Addicon/icons/dvi.gif. DVI

Addicon/icons/uuencoded.gif. uu

Addicon/icons/script.gif. conf. Sh. Shar. CSH. Ksh. TCL

Addicon/icons/tex.gif. Tex

Addicon/icons/bomb.gif Core

 

Addicon/icons/back.gif ..

Addicon/icons/hand.right.gif readme

Addicon/icons/folder.gif ^ directory ^

Addicon/icons/blank.gif ^ blankicon ^

 

#

# Defaulticon is which icon to show for files which do not have an icon

# Explicitly set.

#

Defaulticon/icons/unknown.gif

 

#

# Adddescription allows you to place a short description after a file in

# Server-generated indexes. These are only displayed for fancyindexed

# Directories.

# Format: adddescription "Description" filename

#

# Adddescription "gzip compressed document". GZ

# Adddescription "TAR archive". Tar

# Adddescription "gzip compressed tar archive". tgz

 

#

# Readmename is the name of the README file the server will look for

# Default, and append to directory listings.

#

# Headername is the name of a file which shocould be prepended

# Directory indexes.

Readmename readme.html

Headername header.html

 

#

# Indexignore is a set of filenames which Directory Indexing shoshould ignore

# And not include in the listing. Shell-style wildcarding is permitted.

#

Indexignore .?? **~ * # Header * readme * rcs cvs *, V *, T

 

#

# Defaultlanguage and addlanguage allows you to specify the language

# A document. You can then use content negotiation to give a browser

# File in a language the user can understand.

#

# Specify a default language. This means that all data

# Going out without a specific language tag (see below) will

# Be marked with this one. You probably do not want to set

# This unless you are sure it is correct for all cases.

#

# * It is generally better to not mark a page

# * Being a certain language than marking it with the wrong

# * Language!

#

# Defaultlanguage NL

#

# Note 1: The suffix does not have to be the same as the language

# Keyword --- those with documents in Polish (whose net-Standard

# Language code is PL) may wish to use "addlanguage pl. Po"

# Avoid the ambiguity with the common suffix for Perl scripts.

#

# Note 2: The Example entries below created strate that in some cases

# The two character 'language' abbreviation is not identical

# The two character 'country' code for its country,

# E. g. 'danmark/DK 'versus' Danish/da '.

#

# Note 3: in the case of 'ltz' we violate the RFC by using a three char

# Specifier. There is 'work in SS ss' to fix this and get

# The reference data for rfc1766 cleaned up.

#

# Catalan (CA)-Croatian (HR)-Czech (CS)-Danish (DA)-Dutch (NL)

# English (en)-Esperanto (EO)-Estonian (ET)-French (FR)-German (de)

# Greek-modern (EL)-Hebrew (HE)-Italian (IT)-Japan (JA)

# Korean (KO)-Luxembourgeois * (LTZ)-Norwegian nynorsk (NN)

# Norwegian (NO)-Polish (PL)-Portugese (PT)

# Using Ilian Portuguese (Pt-Br)-Russian (Ru)-Swedish (SV)

# Simplified Chinese (zh-CN)-Spanish (ES)-Traditional Chinese (zh-tw)

#

Addlanguage ca. ca

Addlanguage CS. cz. CS

Addlanguage da. dk

Addlanguage de. de

Addlanguage El. El

Addlanguage en. En

Addlanguage eo. EO

Addlanguage es. es

Addlanguage et. et

Addlanguage Fr. fr

Addlanguage he. He

Addlanguage HR. hr

Addlanguage it. it

Addlanguage Ja. Ja

Addlanguage KO. Ko

Addlanguage LTZ. LTZ

Addlanguage NL. nl

Addlanguage NN. nn

Addlanguage No. No

Addlanguage pl. Po

Addlanguage pt. PT

Addlanguage Pt-Br. Pt-Br

Addlanguage Ru. ru

Addlanguage Sv. sv

Addlanguage ZH-CN. ZH-CN

Addlanguage ZH-TW. ZH-TW

 

#

# Define agepriority allows you to give precedence to some ages

# In case of a tie during content negotiation.

#

# Just list the versions in decreasing order of preference. We have

# More or less alphabetized them here. You probably want to change this.

#

Languagepriority en ca CS da de El EO es et Fr he hr it Ja ko ltz nn no PL Pt-Br Ru sv zh-cn zh-TW

 

#

# Forcelanguagepriority allows you to serve a result page rather

# Multiple choices (prefer) [in case of a tie] or not acceptable (fallback)

# [In case no accepted versions ages matched the available variants]

#

Forcelanguagepriority prefer fallback

 

#

# Specify a default charset for all content served; this enables

# Interpretation of all content as UTF-8 by default. To use

# Default browser choice (ISO-8859-1), or to allow the meta tags

# In HTML content to override this choice, comment out this

# Directive:

#

# Adddefacharset UTF-8

 

#

# Addtype allows you to add to or override the mime Configuration

# File mime. types for specific file types.

#

# Addtype application/X-tar. tgz

Addtype application/X-httpd-PHP. php

 

#

# Addencoding allows you to have certain browsers uncompress

# Information on the fly. Note: not all browsers support this.

# Despite the name similarity, the following add * directives have nothing

# To Do With the fancyindexing customization directives above.

#

# Addencoding X-compress. Z

# Addencoding X-gzip. GZ. tgz

 

# If the addencoding directives abve are commented-out, then you

# Probably shoshould define those extensions to indicate media types:

#

Addtype application/X-compress. Z

Addtype application/X-gzip. GZ. tgz

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.