Home  >  Article  >  php教程  >  Detailed explanation of the Chinese version of the Apache2 httpd.conf configuration file

Detailed explanation of the Chinese version of the Apache2 httpd.conf configuration file

WBOY
WBOYOriginal
2016-10-12 09:50:11987browse

This article is reprinted at http://www.cnblogs.com/xkxk/p/5501821.html

Apache2 httpd.conf configuration file Chinese version detailed explanation
#
# Configuration file based on NCSA service.
#
#This is the main configuration file of the Apache server.
#It contains the configuration directives of the server that affect the operation of the server.
#See for detailed information about these commands
#
#Don't simply read the command information without understanding it.
#Here are just simple instructions, if you do not refer to the online documentation, you will be warned.
#
#These configuration directives are divided into the following three parts:
#1. The part that controls the behavior of the entire Apache server (i.e. global environment variables)
#2. The directives that define the main or default service parameters, also for all virtual hosts Provide default setting parameters
#3. Virtual host setting parameters
#
#Configuration and log file name: If the file name you specify starts with "/" ("dirver:/" under win32),
#The server will Use an absolute path. If the file name does not start with "/", then it will append the value of ServerRoot
# in front of the file name. For example, for "logs/foo.log", if the value of ServerRoot
# is " /usr/local/apache2", then the file should be "/usr/local/apache2/logs/foo.log"
#
##The first area: global environment parameters
#
#The parameters set here will affect the entire The behavior of the Apache server;
#For example, the number of concurrent requests that Apache can handle, etc.
#
#ServerRoot: Indicates the root directory where the server saves its configuration, errors, log files, etc.
#
#Attention! If you want to specify it as a location on NFS or other network,
# please be sure to read the documentation related to LockFile (probably in
#).
#This will enable you to solve many problems yourself.
#
#Do not add a slash at the end of the path.
#
ServerRoot "/usr/loacl/apache2"
#
#The lock file for serial access must be saved on the local disk
#


#LockFile logs/accept.lock


#ScoreBoardFile: used to save internal A file containing service process information.
# If not specified (default), the scoreboard will be saved in an anonymous shared memory segment,
# and it cannot be used by third-party software.
#If specified, make sure that two Apaches cannot use the same scoreboard file.
#This scoreboard file must be saved on the local disk.
#


#ScoreBoardFile logs/apache_runtime_status


#
#PidFile: A file that records the server startup process number.
#

PidFile logs/httpd.pid

#
#Timeout: Timeout seconds before receiving and sending
#
Timeout 300
#
#KeepAlive: Whether to allow robust connections (multiple requests per connection),
#Set to "Off" to disable it.
#
KeepAlive On
#
#MaxKeepAliveRequests: The maximum number of requests allowed during a stable connection,
# is set to 0 to indicate unlimited access.
#We recommend that you set it to a larger value to improve performance
MaxKeepAliveRequests 100
#
#KeepAliveTimeout: The number of seconds to receive requests from the same client on the same connection
#
KeepAliveTimeout 15
##
##Server-Pool size setting (for MPM)
##
# prefork MPM
# StartServers: The number of processes started by the server at startup
# MinSpareServers: The minimum number of spare processes maintained
# MaxSpareServers: The spares retained The maximum number of processes
# MaxClients: The maximum number of processes allowed to be started by the server
# MaxRequestsPerChild: The maximum number of requests allowed by a service process

StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestPerChild 0

# worker MPM
# StartServers: The number of service processes when the server starts
# MaxClients: The maximum number of users allowed to connect at the same time
# MinSpareThreads: The minimum number of worker threads to maintain
# MaxSpareThreads: The maximum number of worker threads to maintain
# ThreadsPerChild: In each service process Worker thread constant
# MaxRequestsPerChild: The maximum number of requests allowed in the service process

StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0

# perchild MPM
# NumServers: Number of service processes
# StartThreads :The number of starting threads in each service process
# MinSpareThreads: The minimum number of threads maintained
# MaxSpareThreads: The maximum number of threads maintained
# MaxThreadsPerChild: The maximum number of threads allowed per service process
# MaxRequestsPerChild: Each service process Maximum number of connections allowed

NumServers 5
StartThreads 5
MinSpareThreads 5
MaxSpareThreads 10
MaxThreadsPerChild 20
MaxRequestsPerChild 0

# WinNT MPM
# ThreadsPerChild: Worker thread constant in service process
# MaxRequest sPerChild: The maximum number of requests allowed by the service process

ThreadsPerChild 250
MaxRequestsPerChild 0

# BeOS MPM
# StartThreads: Number of threads started when the server starts
# MaxClients: The maximum number of threads that can be started (one thread equals one user)
# MaxRequestsPerThread: The maximum number of requests allowed per thread

StartThreads 10
MaxClients 50
MaxRequestsPerThread 10000

# NetWare MPM
# ThreadStachSize: For each The stack size allocated by the worker thread
# StartThreads: The number of threads started when the server starts
# MinSpareThreads: The number of idle threads used to process real requests
# MaxSpareThreads: The maximum number of idle threads
# MaxThreads: The maximum number of active threads at the same time Number of threads
# MaxRequestPerChild: The maximum number of service requests for a thread,
# It is recommended to set it to 0 to achieve unlimited access

ThreadStackSize 65536
StartThreads 250
MinSpareThreads 25
MaxSpareThreads 250
MaxThreads 1000
MaxRequestPerChi ld 0

# OS/2 MPM
# StartServers: The number of service processes started
# MinSpareThreads: The minimum idle threads allowed for each process
# MaxSpareThreads: The maximum idle threads allowed for each process
# MaxRequestsPerChild: The maximum number of idle threads allowed for each service process Number of connections

StartServers 2
MinSpareThreads 5
MaxSpareThreads 10
MaxRequestsPerChild 0

#
# Listen: Allows you to bind the Apache service to the specified IP address and port to replace the default value
# See instructions
# Use the following command Makes Apache only listen on the specified IP address,
# to prevent it from listening on IP address 0.0.0.0
#
# Listen 12.34.56.78:80
Listen 80
#
# Dynamic Sharing Support (DSO)
#
# In order to be able to use functions from modules compiled in DSO mode, you must have the corresponding "LoadModule" line,
# Therefore, these instructions are included here so that they can be activated before using it.
# Those statically compiled modules do not need to be listed here (i.e. modules listed with "httpd -l")
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#
#
# ExtendedStatus: When When calling "server-status", controls whether Apache generates "full" status
# information (ExtendedStatus On) or basic information (ExtendedStatus Off).
# The default is off
#
# ExtendedStatus On
### Second area: "Main" service configuration
#
# This area establishes the command values ​​used by the "main" server in response to those that are not defined by
# Any requests processed.
# These values ​​also provide default values ​​for containers defined later.
# If there is a definition in, then the command value defined here will be overwritten by the definition in
#.
#


#
# If you want httpd to run as another user or group, you must start it as root at the beginning
# and then switch it to the user or group you want to use.
#
# User/Group: User and group running httpd
# Use "User nouser" and "Group nogroup" on SCO (ODT3)
# On HPUX, you may not be able to use shared memory as nobody, it is recommended to create A www user.
# Note that some kernels reject setgid(Group) or semctl
(IPC_SET) when the group ID is greater than 60000. Section
# Do not use "Group #-1" on these systems.
#
User nobody
Group #-1


#
# ServerAdmin: Your email address, Apache will send you an email when a problem occurs.
# As an error document, this address is displayed on the server-generated page,
# For example: admin@your-domain.com
#
ServerAdmin kreny@sina.com
#
# ServerName specifies the name that Apache uses to identify itself and port number.
# Usually this value is assigned automatically, but we recommend that you specify it explicitly to prevent startup errors
#
# If you specify an invalid DNS name for your host, server-generated redirection will not work .
# See the UseCanonicalName directive
#
# If your host does not have a registered DNS name, type its IP address here
# Anyway, you must use its IP address to provide services,
# Here use an easy-to-understand one Way redirect service
ServerName www.dalouis.com:80
#
# UseCanonicalName: Directive that determines how Apache constructs URLS and SERVER_NAME and
SERVER_PORT.
# When set to "Off", Apache will use the host name and port number provided by the client.
# When set to "On", Apache will use the value of the ServerName directive.
#
UseCanonicalName Off
#
# DocumentRoot: The root directory of your document. By default, all requests are answered from this directory.
# But you can use symbolic links and aliases to point to other locations.
#
DocumentRoot "/home/redhat/public_html"
#
# Access permissions can be configured for each directory that Apache can access (including its subdirectories).
#
# First, we configure a high-limit feature.
# This will disable access to the directory where the file system resides and add the directory block you wish to allow access to.
# As shown below

Order Deny,Allow
Deny from all

#
# Note that from here on you must explicitly allow which special features can be used.
# - So, if Apache is not working as you expect,
# please check that you have explicitly specified that it is available below.
#
#
# This will change to the DocumentRoot you set
#

#
# Options: The value of this command can Is "None", "All", or any combination of the following options:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be explicitly specified, "Options All" does not provide you with this feature .
#
# This directive is complex and important, please see
# "http://httpd.apache.org/docs-2.0/mod/core.html#optioins" for more information.
#
Options FollowSymLinks
#
# AllowOverride controls directives placed in .htaccess files.
# It can be "All", "None", or a combination of the following directives:
# Options FileInfo AuthConfig Limit
#
AllowOverride None
#
# Controls who can get the service.
#
Order allow, deny
Allow from all

#
# UserDir: Specifies the directory name that will be added to the user's home directory when a ~user request is received.
#
UserDir public_html
# In order to prevent vulnerabilities in the UserDir command, it is very useful to set
# like "./" for the root user.
# If you are using Apache 1.3 or above, we strongly recommend that you
# include the following line in your server configuration file
UserDir disabled root
#
# Here is a way to use the UserDir directive to make a site's directory read-only Examples of properties:
#
#
# AllowOverride FileInfo AuthConfig Limit Indexes
# Options MultiViews Indexes SymLinksIfOwnerMatch IncludeNoExec
#
# Order allow,deny
# Allow from all
#
#
# Order deny,allow
# Deny from all
#
#
#
# DirectoryIndex: Defines the file name that Apache provides services to users when the request is a directory
#
# The index.html.var file (a type image file) is used to provide a document processing list.
# For the same purpose, you can also use the MultiViews option, but it will be very slow.
#
DirectoryIndex index.php index.html index.html.var
#
# AccessFileName: Query in each directory the file name of the file that provides additional configuration instructions for the directory.
# See AllowOverride directive.
#
AccessFileName .htaccess
#
# The following lines prevent .htaccess and .htpasswd files from being viewed by web clients.
#

Order allow,deny
Deny from all

#
# Typeconfig: Define where to query mime.types files.
#
TypeConfig conf/mime.types
#
# DefaultType: Defines the default MIME type provided by the server when the MIME type cannot be determined.
# If your service mainly contains text or HTML documents, "text/plain" is a good choice;
# If it mostly contains binary documents, such as software or images, you should use
# "application/octer-stream" Prevents the browser from displaying binary files as text.
#
DefaultType text/plain
#
# mod_mime_magic allows the server to use different clues
(hints) from files that define their own type,
# This MIMEMagicFile directive defines the file where hints are defined.
#

MIMEMagicFile conf/magic

#
# HostnameLookups: Specify to record the name or IP address of the client. For example, when this command is on,
# records the host name, such as www.apache.org; when it is off, record the IP address. , 204.62.129.132.
# The default value is off, which is much better than setting it to on, because if set to on, each client request will
# cause at least one query to the nameserver.
#
HostnameLookups Off
#
# EnableMMAP: Control whether to perform memory dump (if supported by the operating system).
# The default is on, if your server is installed on a network file system (NFS), please turn it off.
# On some systems, turning it off will improve system performance (regardless of the file system type);
# Please see http://httpd.apache.org/docs-2.0/mod/core.html#enablemmap
# for details.
# EnableMMAP off
#
# EnableSendfile: Control whether to use sendfile kernel support to send files
# (if the operating system supports it). The default is on. If your server is installed on the Network File System
# (NFS), please turn it off.
# See http://httpd.apache.org/docs-2.0/mod/core.html#enablesendfile
#
# EnableSendfile off
#
# ErrorLog: Error log file location.
# If you do not define the ErrorLog directive inside, the error information of this virtual host
# will be recorded here. If you define ErrorLog there, these error messages will be logged in the file you
# define, not the file defined here.
#
ErrorLog logs/error_log
#
# LogLevel: Controls the amount of log information recorded in the error log file.
# Possible values ​​include: debug, info, notice, warn, error, crit, alert, emerg.
#
LogLevel warn
#
# The following directive defines the format alias for the CustomLog directive.
#
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
# You need to install mod_logio.c Only modules can use %I and %O.
# LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i" %I %O"
combinedio
#
# Specify Access log file location and format (general log format).
# If you do not define this command inside, the transfer information will be recorded here.
# If you define this command, it will be recorded at the location you specify, not the location defined here.
#
CustomLog logs/access_log common
#
# If you want to record agent and referer information, you can use the following command
#
# CustomLog logs/referer_log referer
# CustomLog logs/agent_log agent
#
# If you want To use a file to record access, agent and referer information,
# You can define this directive as follows:
#
# CustomLog logs/access_log combined
#
# ServerTokens
# This directive defines the type of information included in the HTTP response header. The default is "Full",
# This means that the operating system type and compilation information in the module will be included in the response header.
# can be set to one of the values ​​in the column:
# Full | OS | Minor | Minimal | Major | Prod
# Full conveys the most information, and Prod the least.
#
ServerTokens Full
#
# Optionally add a line containing the server version and virtual host name to the server-generated output page
# (internal error documentation, FTP directory listing, mod_status and mod_info output, etc., except CGI errors
# or a custom error document).
# Set to "EMail" will contain a mailto: connection pointing to ServerAdmin.
# can be the following values: On | Off | EMail
#
ServerSignature On
#
# Aliases: Add the alias you need at this time, the format is as follows:
# Alias ​​Alias ​​real name
#
# Note, if you are If the end of the alias contains "/", then the URL also needs to contain "/".
# Therefore, "/icons" is not an alias in this example.
# If the alias ends with "/", then the real name must also end with "/",
# If the ending "/" is omitted from the alias, then the real name must also be omitted.
#
# We use the alias "/icons/" to represent the FancyIndexed directory listing. If you don't use,
# FancyIndexing, you can comment it out.
#
# Alias ​​/icons/ "/usr/local/apache2/icons/"
#
# Options Indexes MultiViews
# AllowOverride None
# Order allow,deny
## Allow from all
#
#
# This will change ServerRoot/manual. This alias provides the location of the man page,
# even if you change your DocumentRoot. If you don't care about having a man page,
# you can comment it out.
#
Alias ​​/manual "/usr/loacl/apache2/manual"

Options Indexes FollowSymLinks MultiViews IncludesNoExec
AddOutputFilter Includes html
Order allow,deny
Allow from all

#
# ScriptAlias: Specify the directory containing the service script.
# ScriptAliases are essentially the same as Aliases, except that the document here is processed as a program when requested.
# The trailing "/" rule is the same as Alias
#
ScriptAlias ​​/cgi-bin/ "/usr/loacl/apache2/cgi-bin/"
# Here is the instruction to add PHP 4 support
AddType application/x-httpd -php .php
LoadModule php4_module modules/libphp4.so

#
# Add mod_cgid.c settings, mod_cgid provides the
# script interface path for UNIX sockets that use cgid for communication.
#
# Scriptsock logs/cgisock

#
# Change "/usr/local/apache2/cgi-bin" to the CGI directory specified by your ScriptAliased,
# if you configured it.
#

AllowOverride None
Options None
Order allow,deny
Allow from all

#
# Redirect allows you to tell the client to use documents that exist in the server's namespace,
# instead of the current one, which helps clients locate documents that have changed location.
# For example:
# Redirect permanent /foo http://www.example.com/bar
#
# Commands to control the display of server-generated directory lists
#
#
# IndexOptions: Control the display characteristics of server-generated directory lists .
#
IndexOptions FancyIndexing VersionSort
#
# AddIcon* command tells the server how to display image files with different extensions.
# Only applicable to FancyIndexed command
#
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 . vrml .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 .for
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 provides handling for files that do not have an explicitly defined icon
#
DefaultIcon /icons/unknown.gif
#
# AddDescription allows you to place a short description after the server-generated index.
# Only valid for FancyIndexed directive.
# Format: AddDescription "Description" File name
#
# AddDescription "GZIP compressed document" .gz
# AddDescription "tar archive" .tar
# AddDescription "GZIP compressed tar archive" .tgz
#
# ReadmeName specifies the server default Find the name of the README file and add it to the directory list
#
# HeaderName specifies the file name of the directory list prefix file
ReadmeName README.html
HeaderName HEADER.html
#
# IndexIgnore specifies the directory index to ignore and not be included in the list A collection of file names in ,
# supports shell-type wildcards.
#
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
#
# AddEncoding allows you to use (Mosaic/X 2.1+) to decompress messages during message transmission,
# NOTE : Not all browsers support this option.
# Although the names are similar, the following commands are different from the FancyIndexing custom command above.
#
AddEncoding x-compress Z
AddEncoding x-gzip gz tgz
#
# DefaultLanguage and AddLanguage allow you to specify the language of the document.
# This allows you to let users navigate the document in easy-to-understand language.
#
# Specifies the default language, which means that all packages that do not specify a language will use this language.
# In most cases, you probably don't want to set this unless you're sure it's the right thing to do.
# Usually, it is better not to use certain language than to use the wrong language.
#
# DefaultLanguage nl
#
# Note 1: The affixes used as language keywords are undoubtedly not the same - documents in Polish
# (the Internet standard language code is pl) will want to use "AddLanguage pl. po"
# to avoid ambiguity with the general affixes of perl scripts.
#
# Note 2: The following example illustrates some examples where the two-character abbreviation of a language is different from the two-character abbreviation of its country
#, such as the comparison of "Danmark/dk" and "Danmark/da".
#
# Note 3: In the case of "ltz" we use a three-character affix, which violates the provisions of RFC.
# It will be fixed during operation and the reference data will be obtained using the RFC1766 standard.
#
# Danish (da) - Dutch (nl) - English (en) - Estonian (et)
# French (fr) - German (de) - Greek-Modern (el)
# Italian (it) - Norwegian ( no) - Norwegian Nynorsk (nn) - Korean (ko)
# Portugese (pt) - Luxembourgeois* (ltz)
# Spanish (es) - Swedish (sv) - Catalan (ca) - Czech(cz)
# Polish ( pl) - Brazilian Portuguese (pt-br) - Japanese (ja)
# Russian (ru) - Croatian (hr)
#
AddLanguage da .dk
AddLanguage nl .nl
AddLanguage en .en
AddLanguage et .et
AddLanguage fr .fr
AddLanguage de .de
AddLanguage he .he
AddLanguage el .el
AddLanguage it .it
AddLanguage ja .ja
AddLanguage pl .po
AddLanguage ko .ko
AddLanguage pt .pt
AddLanguage nn .nn
AddLanguage no .no
AddLanguage pt-br .pt-br
AddLanguage ltz .ltz
AddLanguage ca .ca
AddLanguage es .es
AddLanguage sv .sv
AddLanguage cz .cz
AddLanguage ru .ru
AddLang uage tw .tw
AddLanguage zh -tw .tw
AddLanguage hr .hr
# LanguagePriority allows you to give priority to some languages ​​during the conversation.
#
# List them in descending order of priority. We arrange them in more or less alphabetical order
#. Maybe you want to change the order.
LanguagePriority en da nl et fr de el it ja ko no pl pt pt-br ltz ca es sv tw
#
# ForceLanguagePriority allows you to provide a results page for MULTIPLE CHOICES(Prefer)[in the case of communication]
# or NOT ACCEPTABLE(Fallback)[in the case of no acceptable language match].
#
ForceLanguagePriority Prefer Fallback
#
# It's always a good idea to specify a default character set for all pages sent out, and opens the door to the internationalization of your
# web site, which is what you've ever wanted Do you want it? Likewise, there is some minor harm in specifying a
# default character set for a page that uses the iso-8859-1 (latin1) standard command
# unless otherwise specified such as if you simply declare it explicitly.
# There are also browser security reasons
# related to javascript and URL syntax that always encourage you to use the default character set.
#
#AddDefaultCharset ISO-8859-1
AddDefaultCharse GB2312
#
# Character sets are generally used in the form of file extensions. Maybe you want to avoid
# collisions with language extensions unless you do a good job of testing after every change.
# See http://www.iana.org/assignments/character-sets for a list of character set
# names and their respective RFCs.
#
AddCharset ISO-8859-1 .iso8859-1 .latin1
AddCharset ISO-8859-2 .iso8859-2 .latin2 .cen
AddCharset ISO-8859-3 .iso8859-3 .latin3
AddCharset ISO-8859-4 .iso8859-4 .latin4
AddCharset ISO-8859-5 .iso8859-5 .latin5 .cyr .iso-ru
AddCharset ISO-8859-6 .iso8859-6 .latin6 .arb
AddCharset ISO-8859-7 .iso8859- 7 .latin7 .grk
AddCharset ISO-8859-8 .iso8859-8 .latin8 .heb
AddCharset ISO-8859-9 .iso8859-9 .latin9 .trk
AddCharset ISO-2022-JP .iso2022-jp .jis
AddCharset ISO-2022-KR .iso2022-kr .kis
AddCharset ISO-2022-CN .iso2022-cn .cis
AddCharset Big5 .Big5 .big5
# For Russian, multiple character sets are used (how to use mainly depends on the client) :
AddCharset WINDOWS-1251 .cp-1251 .win-1251
AddCharset CP866 .cp866
AddCharset KOI8-r .koi8-r .koi8-ru
AddCharset KOI8-ru .koi8-uk .ua
AddCharset ISO-10646- UCS -2 .ucs2
AddCharset ISO-10646-UCS-4 .ucs4
AddCharset UTF-8 .utf8
# The following character sets are not mapped to a specific standard (iso), but they are widely used in browsers
# support. Notice those capital letters.
# (It shouldn't, but it is done for compatibility with some browsers)
#
# See http://www.iana.org/assianments/character-sets for a list of
# them. But browser support is less.
#
AddCharset GB2312 .gb2312 .gb
AddCharset utf-7 .utf7
AddCharset utf-8 .utf8
AddCharset big5 .big5 .b5
AddCharset EUC-TW .euc-tw
AddCharset EUC-JP .euc-j p
AddCharset EUC-KR .euc-kr
AddCharset shift_jis .sjis
#
# AddType allows you to add or override the MIME configured in the mime.types file for a specified file type
#
AddType application/x-tar .tgz
AddType image/ x-icon .ico
#
# AddHandler allows you to map certain file extensions to "handlers":
# File type-independent behavior. This can either be compiled into the server or added to the Action directive
# (see below).
# To use CGI scripts other than those specified by the ScriptAliased directive:
# (To make it available, you also need to add "ExecCGI" in Options.
#
# AddHandler cgi-script .cgi
#
# For those that include them File of own HTTP header
#
# AddHandler send-as-is asis
#
# For server-parsed imagemap file:
#
# AddHandler imap-file map
#
# agemap file:
#
#AddHandler imap - File images
#
# for type image transfer resources)
# (this is the default setting to allow Apache's "It Worked" page to be distributed in multiple languages).
#
AddHandler type-map var
#
# Filter allows you to process it before sending it to the client.
#
# To analyze .shtml documents containing (SSI) on the server side:
# (To execute this command, you also need to add "Includes" to the Options directive.)
#
# AddType text/html .shtml
# AddOutputFilter INCLUDES .shtml
#
# Action lets you define a script that will be executed when a matching media file is called. This will reduce
# duplicate entry of URL pathnames for frequently used CGI scripts.
# Format: Action media/type /cgi-script/location
# Format: Action handler-name /cgi-script/location
#
#
# The configurable error response has three styles:
# 1) plain text 2 )local redirects 3) external redirects
#
# Some examples:
# ErrorDocument 500 "The server made a boo boo."
# ErrorDocument 404 /missing.html
# ErrorDocument 404 "/cgi-bin/missing_handler.pl"
# ErrorDocument 402 http://www.example.com/subscription_info.html
#
#
# By combining these instructions, we can create an internationalized error response.
#
# We use Alias ​​to redirect any /error/HTTP_.html.var response to
# Our collection of multilingual error messages. Replace it with the correct text.
#
# By adding the following lines, you can change the display of these messages without having to change the
# HTTP_.html.var file.
#
# Alias ​​/error/include/ "/your/include/path/"
#
# to copy the files under /usr/local/apache2/error/include/ to /your/include/path/
# To start, you can create your own collection of files, even for each virtual host.
# Regardless of how your ServerSignature is set, the default include file will display your
# Aapche version number and your ServerAdmin email address
#
# Internationalized error documentation requires three
# modules: mod_alias, mod_include and mod_negotiation. To activate them, uncomment the following 30 lines
# Alias ​​/error/ "/usr/local/apache2/error/"
#
#
# AllowOverride None
# Options IncludesNoExec
# AddOutputFilter Includes html
# AddHandler type-map var
# Order allow,deny
# Allow from all
# LanguagePriority en de es fr it nl sv
# ForceLanguagePriority Prefer Fallback
#
#
# ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
# ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
ErrorDocument 403 /error.php
# ErrorDocument 404 /error/HTTP_N OT_FOUND.html. var
# ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
# ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
# ErrorDocument 410 /error/HTTP_GONE.html.var
# ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED .html.var
# ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
# ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
# ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
# ErrorDocument 415 /error/HT TP_SERVICE_UNAVAILABLE.html.var
# ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
# ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
# ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
# ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
#ErrorDocument 506/ error/HTTP_VARIANT_ALSO_VARIES.html.var
#
# The following command changes the standard HTTP response behavior to handle known browser issues. O#
Browsermatch "Mozilla/2" Nokeepalive
browsermatch "msie 4.0b2;" Nokeepalive downngrade -0 Force-Response-30
Browser 4.0 " Force-Response -.0
Browsermatch "Java/1.0" Force-Response -0.0
BrowserMatch "JDK/1.0" force-response-1.0
#
# The following commands turn off the redirection of non-GET requests for directories without a trailing "/",
# These commands fix the problem that Microsoft's DAV method cannot be processed correctly Problem with redirected WEB folder.
# The DAV file system under Apple and VFS under Gnome also support DAV in this way
#.
#
BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
BrowserMatch "^WebDrive" redirect-carefully
BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully
BrowserMatch "^gnome-vfs" redirect-carefully
#
# Allows you to generate and report server status information via mod_status using the URL: http://servername/server-status. Change .example.com to your own domain name.
#
#
# SetHandler server-status
# Order deny,allow
# Deny from all
# Allow from .example.com
#
#
# Allow remote access using URL: http://servername/server-info Report server configuration information
# (requires mod_info.c support). Change ".example.com" to your own domain name.
#
#
# SetHandler server-info
# Order deny,allow
# Deny from all
# Allow from .example.com
#
#
# Proxy server command, remove the following to make the proxy service available.
#
#
# ProxyRequests On
#
# Order deny,allow
# Deny from all
# Allow from .example.com
#
#
# Install or turn off HTTP/1.1 "channel" header processing.
# ("Full" adds server version information, "Block" removes all output "channel" header information.
# Can be set to one of the following options: Off | On | Full | Block
#
# ProxyVia On
# It is best to install a cache for the proxy service and remove the comment symbols in the following lines:
# (no buffering without CacheRoot)
#
# CacheRoot "/usr/local/apache2/proxy"
# CacheSize 5
# CacheGcInterval 4
# CacheMaxExpire 24
# CacheLastModifiedFactor 01
# CacheDefaultExpire 1
# NoCache a-domain.com another-domain.edu joes.garage-sale.com
#
# End of proxy command.
#
# Additional module-specific configuration
#

Include conf/ssl.conf

## Area 3: Virtual Host
#
# VirtualHost: You can maintain multiple
on your host by setting up a virtual host container# Domain name/host name. Most configuration information only uses name-based virtual hosts, so the server
# does not have to worry about IP addresses. The following command replaces the virtual host name with an *.
#
# Before you try to configure your virtual host, please see
# URL: http://httpd.apache.org/docs-2.0/vhosts/> for more information.
#
# You can use the command line option "-S" to verify your virtual host configuration.
#
# Use name-based virtual hosting.
#
# NameVirtualHost *
#
# Virtual host example:
# Almost all Apache commands can be used in the virtual host container.
# The first virtual host area is the configuration used to respond to requests with unknown service names.
#
#
# ServerAdmin webmaster@dummy-host.example.com
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host. example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log commom
#

Apache2 httpd.conf配置文件中文版详解

Apache2 httpd.conf configuration file Chinese version detailed explanation
#
# Configuration file based on NCSA service.
#
#This is the main configuration file of the Apache server.
#It contains the configuration directives of the server that affect the operation of the server.
#See for detailed information about these commands
#
#Don't simply read the command information without understanding it.
#Here are just simple instructions, if you do not refer to the online documentation, you will be warned.
#
#These configuration directives are divided into the following three parts:
#1. The part that controls the behavior of the entire Apache server (i.e. global environment variables)
#2. The directives that define the main or default service parameters, also for all virtual hosts Provide default setting parameters
#3. Virtual host setting parameters
#
#Configuration and log file name: If the file name you specify starts with "/" ("dirver:/" under win32),
#The server will Use an absolute path. If the file name does not start with "/", then it will append the value of ServerRoot
# in front of the file name. For example, for "logs/foo.log", if the value of ServerRoot
# is " /usr/local/apache2", then the file should be "/usr/local/apache2/logs/foo.log"
#
##The first area: global environment parameters
#
#The parameters set here will affect the entire The behavior of the Apache server;
#For example, the number of concurrent requests that Apache can handle, etc.
#
#ServerRoot: Indicates the root directory where the server saves its configuration, errors, log files, etc.
#
#Attention! If you want to specify it as a location on NFS or other network,
# please be sure to read the documentation related to LockFile (probably in
#).
#This will enable you to solve many problems yourself.
#
#Do not add a slash at the end of the path.
#
ServerRoot "/usr/loacl/apache2"
#
#The lock file for serial access must be saved on the local disk
#


#LockFile logs/accept.lock


#ScoreBoardFile: used to save internal A file containing service process information.
# If not specified (default), the scoreboard will be saved in an anonymous shared memory segment,
# and it cannot be used by third-party software.
#If specified, make sure that two Apaches cannot use the same scoreboard file.
#This scoreboard file must be saved on the local disk.
#


#ScoreBoardFile logs/apache_runtime_status


#
#PidFile: A file that records the server startup process number.
#

PidFile logs/httpd.pid

#
#Timeout: Timeout seconds before receiving and sending
#
Timeout 300
#
#KeepAlive: Whether to allow robust connections (multiple requests per connection),
#Set to "Off" to disable it.
#
KeepAlive On
#
#MaxKeepAliveRequests: The maximum number of requests allowed during a stable connection,
# is set to 0 to indicate unlimited access.
#We recommend that you set it to a larger value to improve performance
MaxKeepAliveRequests 100
#
#KeepAliveTimeout: The number of seconds to receive requests from the same client on the same connection
#
KeepAliveTimeout 15
##
##Server-Pool size setting (for MPM)
##
# prefork MPM
# StartServers: The number of processes started by the server at startup
# MinSpareServers: The minimum number of spare processes maintained
# MaxSpareServers: The spares retained The maximum number of processes
# MaxClients: The maximum number of processes allowed to be started by the server
# MaxRequestsPerChild: The maximum number of requests allowed by a service process

StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestPerChild 0

# worker MPM
# StartServers: The number of service processes when the server starts
# MaxClients: The maximum number of users allowed to connect at the same time
# MinSpareThreads: The minimum number of worker threads to maintain
# MaxSpareThreads: The maximum number of worker threads to maintain
# ThreadsPerChild: In each service process Worker thread constant
# MaxRequestsPerChild: The maximum number of requests allowed in the service process

StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0

# perchild MPM
# NumServers: Number of service processes
# StartThreads :The number of starting threads in each service process
# MinSpareThreads: The minimum number of threads maintained
# MaxSpareThreads: The maximum number of threads maintained
# MaxThreadsPerChild: The maximum number of threads allowed per service process
# MaxRequestsPerChild: Each service process Maximum number of connections allowed

NumServers 5
StartThreads 5
MinSpareThreads 5
MaxSpareThreads 10
MaxThreadsPerChild 20
MaxRequestsPerChild 0

# WinNT MPM
# ThreadsPerChild: Worker thread constant in service process
# MaxRequest sPerChild: The maximum number of requests allowed by the service process

ThreadsPerChild 250
MaxRequestsPerChild 0

# BeOS MPM
# StartThreads: Number of threads started when the server starts
# MaxClients: The maximum number of threads that can be started (one thread equals one user)
# MaxRequestsPerThread: The maximum number of requests allowed per thread

StartThreads 10
MaxClients 50
MaxRequestsPerThread 10000

# NetWare MPM
# ThreadStachSize: For each The stack size allocated by the worker thread
# StartThreads: The number of threads started when the server starts
# MinSpareThreads: The number of idle threads used to process real requests
# MaxSpareThreads: The maximum number of idle threads
# MaxThreads: The maximum number of active threads at the same time Number of threads
# MaxRequestPerChild: The maximum number of service requests for a thread,
# It is recommended to set it to 0 to achieve unlimited access

ThreadStackSize 65536
StartThreads 250
MinSpareThreads 25
MaxSpareThreads 250
MaxThreads 1000
MaxRequestPerChi ld 0

# OS/2 MPM
# StartServers: The number of service processes started
# MinSpareThreads: The minimum idle threads allowed for each process
# MaxSpareThreads: The maximum idle threads allowed for each process
# MaxRequestsPerChild: The maximum number of idle threads allowed for each service process Number of connections

StartServers 2
MinSpareThreads 5
MaxSpareThreads 10
MaxRequestsPerChild 0

#
# Listen: Allows you to bind the Apache service to the specified IP address and port to replace the default value
# See instructions
# Use the following command Makes Apache only listen on the specified IP address,
# to prevent it from listening on IP address 0.0.0.0
#
# Listen 12.34.56.78:80
Listen 80
#
# Dynamic Sharing Support (DSO)
#
# In order to be able to use functions from modules compiled in DSO mode, you must have the corresponding "LoadModule" line,
# Therefore, these instructions are included here so that they can be activated before using it.
# Those statically compiled modules do not need to be listed here (i.e. modules listed with "httpd -l")
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#
#
# ExtendedStatus: When When calling "server-status", controls whether Apache generates "full" status
# information (ExtendedStatus On) or basic information (ExtendedStatus Off).
# The default is off
#
# ExtendedStatus On
### Second area: "Main" service configuration
#
# This area establishes the command values ​​used by the "main" server in response to those that are not defined by
# Any requests processed.
# These values ​​also provide default values ​​for containers defined later.
# If there is a definition in, then the command value defined here will be overwritten by the definition in
#.
#


#
# If you want httpd to run as another user or group, you must start it as root at the beginning
# and then switch it to the user or group you want to use.
#
# User/Group: User and group running httpd
# Use "User nouser" and "Group nogroup" on SCO (ODT3)
# On HPUX, you may not be able to use shared memory as nobody, it is recommended to create A www user.
# Note that some kernels reject setgid(Group) or semctl
(IPC_SET) when the group ID is greater than 60000. Section
# Do not use "Group #-1" on these systems.
#
User nobody
Group #-1


#
# ServerAdmin: Your email address, Apache will send you an email when a problem occurs.
# As an error document, this address is displayed on the server-generated page,
# For example: admin@your-domain.com
#
ServerAdmin kreny@sina.com
#
# ServerName specifies the name that Apache uses to identify itself and port number.
# Usually this value is assigned automatically, but we recommend that you specify it explicitly to prevent startup errors
#
# If you specify an invalid DNS name for your host, server-generated redirection will not work .
# See the UseCanonicalName directive
#
# If your host does not have a registered DNS name, type its IP address here
# Anyway, you must use its IP address to provide services,
# Here use an easy-to-understand one Way redirect service
ServerName www.dalouis.com:80
#
# UseCanonicalName: Directive that determines how Apache constructs URLS and SERVER_NAME and
SERVER_PORT.
# When set to "Off", Apache will use the host name and port number provided by the client.
# When set to "On", Apache will use the value of the ServerName directive.
#
UseCanonicalName Off
#
# DocumentRoot: The root directory of your document. By default, all requests are answered from this directory.
# But you can use symbolic links and aliases to point to other locations.
#
DocumentRoot "/home/redhat/public_html"
#
# Access permissions can be configured for each directory that Apache can access (including its subdirectories).
#
# First, we configure a high-limit feature.
# This will disable access to the directory where the file system resides and add the directory block you wish to allow access to.
# As shown below

Order Deny,Allow
Deny from all

#
# Note that from here on you must explicitly allow which special features can be used.
# - So, if Apache is not working as you expect,
# please check that you have explicitly specified that it is available below.
#
#
# This will change to the DocumentRoot you set
#

#
# Options: The value of this command can Is "None", "All", or any combination of the following options:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be explicitly specified, "Options All" does not provide you with this feature .
#
# This directive is complex and important, please see
# "http://httpd.apache.org/docs-2.0/mod/core.html#optioins" for more information.
#
Options FollowSymLinks
#
# AllowOverride controls directives placed in .htaccess files.
# It can be "All", "None", or a combination of the following directives:
# Options FileInfo AuthConfig Limit
#
AllowOverride None
#
# Controls who can get the service.
#
Order allow, deny
Allow from all

#
# UserDir: Specifies the directory name that will be added to the user's home directory when a ~user request is received.
#
UserDir public_html
# In order to prevent vulnerabilities in the UserDir command, it is very useful to set
# like "./" for the root user.
# If you are using Apache 1.3 or above, we strongly recommend that you
# include the following line in your server configuration file
UserDir disabled root
#
# Here is a way to use the UserDir directive to make a site's directory read-only Examples of properties:
#
#
# AllowOverride FileInfo AuthConfig Limit Indexes
# Options MultiViews Indexes SymLinksIfOwnerMatch IncludeNoExec
#
# Order allow,deny
# Allow from all
#
#
# Order deny,allow
# Deny from all
#
#
#
# DirectoryIndex: Defines the file name that Apache provides services to users when the request is a directory
#
# The index.html.var file (a type image file) is used to provide a document processing list.
# For the same purpose, you can also use the MultiViews option, but it will be very slow.
#
DirectoryIndex index.php index.html index.html.var
#
# AccessFileName: Query in each directory the file name of the file that provides additional configuration instructions for the directory.
# See AllowOverride directive.
#
AccessFileName .htaccess
#
# The following lines prevent .htaccess and .htpasswd files from being viewed by web clients.
#

Order allow,deny
Deny from all

#
# Typeconfig: Define where to query mime.types files.
#
TypeConfig conf/mime.types
#
# DefaultType: Defines the default MIME type provided by the server when the MIME type cannot be determined.
# If your service mainly contains text or HTML documents, "text/plain" is a good choice;
# If it mostly contains binary documents, such as software or images, you should use
# "application/octer-stream" Prevents the browser from displaying binary files as text.
#
DefaultType text/plain
#
# mod_mime_magic allows the server to use different clues
(hints) from files that define their own type,
# This MIMEMagicFile directive defines the file where hints are defined.
#

MIMEMagicFile conf/magic

#
# HostnameLookups: Specify to record the name or IP address of the client. For example, when this command is on,
# records the host name, such as www.apache.org; when it is off, record the IP address. , 204.62.129.132.
# The default value is off, which is much better than setting it to on, because if set to on, each client request will
# cause at least one query to the nameserver.
#
HostnameLookups Off
#
# EnableMMAP: Control whether to perform memory dump (if supported by the operating system).
# The default is on, if your server is installed on a network file system (NFS), please turn it off.
# On some systems, turning it off will improve system performance (regardless of the file system type);
# Please see http://httpd.apache.org/docs-2.0/mod/core.html#enablemmap
# for details.
# EnableMMAP off
#
# EnableSendfile: Control whether to use sendfile kernel support to send files
# (if the operating system supports it). The default is on. If your server is installed on the Network File System
# (NFS), please turn it off.
# See http://httpd.apache.org/docs-2.0/mod/core.html#enablesendfile
#
# EnableSendfile off
#
# ErrorLog: Error log file location.
# If you do not define the ErrorLog directive inside, the error information of this virtual host
# will be recorded here. If you define ErrorLog there, these error messages will be logged in the file you
# define, not the file defined here.
#
ErrorLog logs/error_log
#
# LogLevel: Controls the amount of log information recorded in the error log file.
# Possible values ​​include: debug, info, notice, warn, error, crit, alert, emerg.
#
LogLevel warn
#
# The following directive defines the format alias for the CustomLog directive.
#
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
# You need to install mod_logio.c Only modules can use %I and %O.
# LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i" %I %O"
combinedio
#
# Specify Access log file location and format (general log format).
# If you do not define this command inside, the transfer information will be recorded here.
# If you define this command, it will be recorded at the location you specify, not the location defined here.
#
CustomLog logs/access_log common
#
# If you want to record agent and referer information, you can use the following command
#
# CustomLog logs/referer_log referer
# CustomLog logs/agent_log agent
#
# If you want To use a file to record access, agent and referer information,
# You can define this directive as follows:
#
# CustomLog logs/access_log combined
#
# ServerTokens
# This directive defines the type of information included in the HTTP response header. The default is "Full",
# This means that the operating system type and compilation information in the module will be included in the response header.
# can be set to one of the values ​​in the column:
# Full | OS | Minor | Minimal | Major | Prod
# Full conveys the most information, and Prod the least.
#
ServerTokens Full
#
# Optionally add a line containing the server version and virtual host name to the server-generated output page
# (internal error documentation, FTP directory listing, mod_status and mod_info output, etc., except CGI errors
# or a custom error document).
# Set to "EMail" will contain a mailto: connection pointing to ServerAdmin.
# can be the following values: On | Off | EMail
#
ServerSignature On
#
# Aliases: Add the alias you need at this time, the format is as follows:
# Alias ​​Alias ​​real name
#
# Note, if you are If the end of the alias contains "/", then the URL also needs to contain "/".
# Therefore, "/icons" is not an alias in this example.
# If the alias ends with "/", then the real name must also end with "/",
# If the ending "/" is omitted from the alias, then the real name must also be omitted.
#
# We use the alias "/icons/" to represent the FancyIndexed directory listing. If you don't use,
# FancyIndexing, you can comment it out.
#
# Alias ​​/icons/ "/usr/local/apache2/icons/"
#
# Options Indexes MultiViews
# AllowOverride None
# Order allow,deny
## Allow from all
#
#
# This will change ServerRoot/manual. This alias provides the location of the man page,
# even if you change your DocumentRoot. If you don't care about having a man page,
# you can comment it out.
#
Alias ​​/manual "/usr/loacl/apache2/manual"

Options Indexes FollowSymLinks MultiViews IncludesNoExec
AddOutputFilter Includes html
Order allow,deny
Allow from all

#
# ScriptAlias: Specify the directory containing the service script.
# ScriptAliases are essentially the same as Aliases, except that the document here is processed as a program when requested.
# The trailing "/" rule is the same as Alias
#
ScriptAlias ​​/cgi-bin/ "/usr/loacl/apache2/cgi-bin/"
# Here is the instruction to add PHP 4 support
AddType application/x-httpd -php .php
LoadModule php4_module modules/libphp4.so

#
# Add mod_cgid.c settings, mod_cgid provides the
# script interface path for UNIX sockets that use cgid for communication.
#
# Scriptsock logs/cgisock

#
# Change "/usr/local/apache2/cgi-bin" to the CGI directory specified by your ScriptAliased,
# if you configured it.
#

AllowOverride None
Options None
Order allow,deny
Allow from all

#
# Redirect allows you to tell the client to use documents that exist in the server's namespace,
# instead of the current one, which helps clients locate documents that have changed location.
# For example:
# Redirect permanent /foo http://www.example.com/bar
#
# Commands to control the display of server-generated directory lists
#
#
# IndexOptions: Control the display characteristics of server-generated directory lists .
#
IndexOptions FancyIndexing VersionSort
#
# AddIcon* command tells the server how to display image files with different extensions.
# Only applicable to FancyIndexed command
#
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 . vrml .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 .for
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 provides handling for files that do not have an explicitly defined icon
#
DefaultIcon /icons/unknown.gif
#
# AddDescription allows you to place a short description after the server-generated index.
# Only valid for FancyIndexed directive.
# Format: AddDescription "Description" File name
#
# AddDescription "GZIP compressed document" .gz
# AddDescription "tar archive" .tar
# AddDescription "GZIP compressed tar archive" .tgz
#
# ReadmeName specifies the server default Find the name of the README file and add it to the directory list
#
# HeaderName specifies the file name of the directory list prefix file
ReadmeName README.html
HeaderName HEADER.html
#
# IndexIgnore specifies the directory index to ignore and not be included in the list A collection of file names in ,
# supports shell-type wildcards.
#
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
#
# AddEncoding allows you to use (Mosaic/X 2.1+) to decompress messages during message transmission,
# NOTE : Not all browsers support this option.
# Although the names are similar, the following commands are different from the FancyIndexing custom command above.
#
AddEncoding x-compress Z
AddEncoding x-gzip gz tgz
#
# DefaultLanguage and AddLanguage allow you to specify the language of the document.
# This allows you to let users navigate the document in easy-to-understand language.
#
# Specifies the default language, which means that all packages that do not specify a language will use this language.
# In most cases, you probably don't want to set this unless you're sure it's the right thing to do.
# Usually, it is better not to use certain language than to use the wrong language.
#
# DefaultLanguage nl
#
# Note 1: The affixes used as language keywords are undoubtedly not the same - documents in Polish
# (the Internet standard language code is pl) will want to use "AddLanguage pl. po"
# to avoid ambiguity with the general affixes of perl scripts.
#
# Note 2: The following example illustrates some examples where the two-character abbreviation of a language is different from the two-character abbreviation of its country
#, such as the comparison of "Danmark/dk" and "Danmark/da".
#
# Note 3: In the case of "ltz" we use a three-character affix, which violates the provisions of RFC.
# It will be fixed during operation and the reference data will be obtained using the RFC1766 standard.
#
# Danish (da) - Dutch (nl) - English (en) - Estonian (et)
# French (fr) - German (de) - Greek-Modern (el)
# Italian (it) - Norwegian ( no) - Norwegian Nynorsk (nn) - Korean (ko)
# Portugese (pt) - Luxembourgeois* (ltz)
# Spanish (es) - Swedish (sv) - Catalan (ca) - Czech(cz)
# Polish ( pl) - Brazilian Portuguese (pt-br) - Japanese (ja)
# Russian (ru) - Croatian (hr)
#
AddLanguage da .dk
AddLanguage nl .nl
AddLanguage en .en
AddLanguage et .et
AddLanguage fr .fr
AddLanguage de .de
AddLanguage he .he
AddLanguage el .el
AddLanguage it .it
AddLanguage ja .ja
AddLanguage pl .po
AddLanguage ko .ko
AddLanguage pt .pt
AddLanguage nn .nn
AddLanguage no .no
AddLanguage pt-br .pt-br
AddLanguage ltz .ltz
AddLanguage ca .ca
AddLanguage es .es
AddLanguage sv .sv
AddLanguage cz .cz
AddLanguage ru .ru
AddLang uage tw .tw
AddLanguage zh -tw .tw
AddLanguage hr .hr
# LanguagePriority allows you to give priority to some languages ​​during the conversation.
#
# List them in descending order of priority. We arrange them in more or less alphabetical order
#. Maybe you want to change the order.
LanguagePriority en da nl et fr de el it ja ko no pl pt pt-br ltz ca es sv tw
#
# ForceLanguagePriority allows you to provide a results page for MULTIPLE CHOICES(Prefer)[in the case of communication]
# or NOT ACCEPTABLE(Fallback)[in the case of no acceptable language match].
#
ForceLanguagePriority Prefer Fallback
#
# It's always a good idea to specify a default character set for all pages sent out, and opens the door to the internationalization of your
# web site, which is what you've ever wanted Do you want it? Likewise, specifying a
# default character set has some minor detriments to a page that uses the iso-8859-1 (latin1) standard command
# unless otherwise specified such as if you simply declare it explicitly.
# There are also browser security reasons
# related to javascript and URL syntax that always encourage you to use the default character set.
#
#AddDefaultCharset ISO-8859-1
AddDefaultCharse GB2312
#
# Character sets are generally used in the form of file extensions. Maybe you want to avoid
# collisions with language extensions unless you do a good job of testing after every change.
# See http://www.iana.org/assignments/character-sets for a list of character set
# names and their respective RFCs.
#
AddCharset ISO-8859-1 .iso8859-1 .latin1
AddCharset ISO-8859-2 .iso8859-2 .latin2 .cen
AddCharset ISO-8859-3 .iso8859-3 .latin3
AddCharset ISO-8859-4 .iso8859-4 .latin4
AddCharset ISO-8859-5 .iso8859-5 .latin5 .cyr .iso-ru
AddCharset ISO-8859-6 .iso8859-6 .latin6 .arb
AddCharset ISO-8859-7 .iso8859- 7 .latin7 .grk
AddCharset ISO-8859-8 .iso8859-8 .latin8 .heb
AddCharset ISO-8859-9 .iso8859-9 .latin9 .trk
AddCharset ISO-2022-JP .iso2022-jp .jis
AddCharset ISO-2022-KR .iso2022-kr .kis
AddCharset ISO-2022-CN .iso2022-cn .cis
AddCharset Big5 .Big5 .big5
# For Russian, multiple character sets are used (how to use mainly depends on the client) :
AddCharset WINDOWS-1251 .cp-1251 .win-1251
AddCharset CP866 .cp866
AddCharset KOI8-r .koi8-r .koi8-ru
AddCharset KOI8-ru .koi8-uk .ua
AddCharset ISO-10646- UCS -2 .ucs2
AddCharset ISO-10646-UCS-4 .ucs4
AddCharset UTF-8 .utf8
# The following character sets are not mapped to a specific standard (iso), but they are widely used in browsers
# support. Notice those capital letters.
# (It shouldn't, but it is done for compatibility with some browsers)
#
# See http://www.iana.org/assianments/character-sets for a list of
# them. But browser support is less.
#
AddCharset GB2312 .gb2312 .gb
AddCharset utf-7 .utf7
AddCharset utf-8 .utf8
AddCharset big5 .big5 .b5
AddCharset EUC-TW .euc-tw
AddCharset EUC-JP .euc-j p
AddCharset EUC-KR .euc-kr
AddCharset shift_jis .sjis
#
# AddType allows you to add or override the MIME configured in the mime.types file for a specified file type
#
AddType application/x-tar .tgz
AddType image/ x-icon .ico
#
# AddHandler allows you to map certain file extensions to "handlers":
# File type-independent behavior. This can either be compiled into the server or added to the Action directive
# (see below).
# To use CGI scripts other than those specified by the ScriptAliased directive:
# (To make it available, you also need to add "ExecCGI" in Options.
#
# AddHandler cgi-script .cgi
#
# For those that include them File of own HTTP header
#
# AddHandler send-as-is asis
#
# For server-parsed imagemap file:
#
# AddHandler imap-file map
#
# agemap file:
#
#AddHandler imap - File images
#
# for type image transfer resources)
# (this is the default setting to allow Apache's "It Worked" page to be distributed in multiple languages).
#
AddHandler type-map var
#
# Filter allows you to process it before sending it to the client.
#
# In order to analyze the .shtml document containing (SSI) on the server side:
# (To execute this command, you also need to add "Includes" in the Options directive.)
#
# AddType text/html .shtml
# AddOutputFilter INCLUDES .shtml
#
# Action lets you define a script that will be executed when a matching media file is called. This will reduce
# duplicate entry of URL pathnames for frequently used CGI scripts.
# Format: Action media/type /cgi-script/location
# Format: Action handler-name /cgi-script/location
#
#
# The configurable error response has three styles:
# 1) plain text 2 )local redirects 3) external redirects
#
# Some examples:
# ErrorDocument 500 "The server made a boo boo."
# ErrorDocument 404 /missing.html
# ErrorDocument 404 "/cgi-bin/missing_handler.pl"
# ErrorDocument 402 http://www.example.com/subscription_info.html
#
#
# By combining these instructions, we can create an internationalized error response.
#
# We use Alias ​​to redirect any /error/HTTP_.html.var response to
# our collection of multilingual error messages. use

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn