HTTPD Configuration Detailed

Source: Internet
Author: User
Tags regular expression require valid
configuration File Description

################## #文件说明 ###################
#This is the main Apache HTTP server configuration file. Itcontains the
# Configuration directives that give the server itsinstructions.
# See <url:http://httpd.apache.org/docs/2.2>for detailed information.
# in particular, see
#<url:http://httpd.apache.org/docs/2.2/mod/directives.html>
#for a discussion of each configuration directive.
#
# do notsimply read the instructions in here without understanding
# Whatthey do.  They ' re here is only as hints or reminders. If Youare Unsure
# Consult the online docs. You have been warned.
################## #配置说明 ##########################
#Configuration and logfile Names:if the filenames you specify Formany
# of the server ' s control files begin with "/" (or "drive:/" for Win32), the
# server would use Thatexplicit path. If the filenames do *not* begin
# with "/", the value of ServerRoot are prepended--so "logs/foo_log"
#with ServerRoot set to "/usr/local/apache" would beinterpreted by the
# server as "/usr/local/apache/logs/foo_log".
#如果包含的配置文件以根目录/Start, use the explicit path indicated, to start with a non-root directory, the path is: Find path =serverroot directory + Write directory
################# #软件主目录 ################
#ServerRoot: The top of the directory tree under which the server ' s
#configuration, error, and log files are kept.
#
# do not add Aslash at the end of the directory path. If you point
#ServerRoot at a non-local disk, being sure to point the lockfiledirective
# at a local disk. If you wish to share the sameserverroot for multiple
# httpd Daemons, you'll need to changeat least LockFile andpidfile.
#
#ServerRoot: The root directory for service profiles,/logs, error logs, etc., which is the directory where the software resides.
#注意不要再目录后加/, if the directory is not a local disk, first use the Lockfile directive on the local disk to indicate. If you want to share the root directory for multiple httpd programs, you need to change at least Lockfile and pidfile. That is, to guarantee the exclusivity of Apache's process files.
ServerRoot "/usr/local/apache"
################ #监听端口和IP ############################
#
#Listen: Allows-bind Apache to specific IP addresses and/or
#ports, instead of the default. See also the
# directive.
#
#Change the Listen on specific IP addresses as shown below to
#prevent Apache from glomming onto all bound IP addresses.
#
#Listen12.34.56.78:80
#apache程序运行的监听IP地址和端口, HTTP access address + port, default 80
Listen80
#################### #要加载的DSO模块 ##########################
#
#Dynamic Shared Object (DSO) support
#
# to is able to use thefunctionality of a module which is built as a DSO you
# toplace corresponding ' LoadModule ' lines at the
#directives contained in it is actually available _before_ they areused.
# statically compiled modules (those listed by ' httpd-l ') does not need
# to be loadedhere.
#需要动态加载的DSO模块写在这里以使程序启动时加载. Format as the example says, statically compiled modules do not need to be written here, and the static modules are loaded by httpd-l
#Example:
# LoadModule Foo_module modules/mod_foo.so
#



#非NetWare和winnt模式下
#
#If wish httpd to run as a different user or group, you must run
#httpd a s Root initially and it'll switch. 
#
#User/group:the name (or #number) of the User/group to run httpdas.< br> # It is usually good practice-to-create a dedicated user Andgroup for
# running httpd, as with the most systemservices .
################### #软件运行用户设定 ###################
#如果要更换不同的用户或组来运行apache, you must first run as root, and then he will switch to the set user. As with most system services, it is a good practice to create a separate user and group for Apache to run. (Note that this is set to be configured under non-NetWare and non-win systems, otherwise configuration is not required)
Userdaemon
Group daemon



##################### #Apache主配置部分 ###############
############## #概要说明 ##########
# ' Main ' server Configuration
#
# The directives in this sectionset the values used by the ' main '
# server, which responds Toany requests that aren ' t handled by a
#
# any
#
# AllOf These directives could appear inside
# in W Hich case Thesedefault settings would be a overridden for the
# Virtual host beingdefined.
#
#主站点的配置选项, this option is configured as a master Default value, if a virtual host is defined, the command inside overrides the value here, otherwise the value configured at that point is used.
#
#ServerAdmin: Your address, where problems with the server should is
#e-mailed.  this address appears On some server-generated pages,such
# as Error documents.  e.g.admin@your-domain.com
############# #服务器联系人 # ############
ServerAdminyou@example.com

################# #服务器网站域名指定 ###############
#ServerName gives the name and port, the server uses to Identifyitself.
# This can often is determined automatically, but werecommend you specify
# It explicitly to prevent problems duringstartup.
#
# If Your host doesn ' t has a registered DNS name,enter its IP addresshere.
#服务器域名指定. This can be automatically recognized here, you can also give the domain name and port to explicitly specify (virtual host multi-use this option), if not registered DNS, you can use the IP address.
#ServerNamewww. example.com:80

############### #网站根目录 #############
#DocumentRoot: The directory out of which serve your
#documents. By default, all requests is taken from this directory,but
# Symbolic links and aliases May is used to point to otherlocations.
#站点根目录. General site requests come directly here to find a webpage, but a dynamic link or alias may be used to point to another location.
DocumentRoot "/usr/local/apache/htdocs"

################# #网站目录全局设置 ##############
#Each directory to which Apache have access can be configured Withrespect
# to which services and features is allowed and/ordisabled in that
# directory (and its subdirectories).
#apache能访问的每一个目录都可以配置哪些特性能开启禁用, the attribute settings are valid for the child directory. The default is to give a very strict feature setting.
#First, we configure the "default" to be a very restrictiveset of
# features.
#
#Options指令控制了在特定目录中将使用哪些服务器特性. The values are as follows: Noneall Indexes includes followsymlinks symlinksifownermatch execcgimultiviews
#option可以为None, in this case, no extra features will be enabled. or set to one or more of the following options:
#All: All features except MultiViews. This is the default setting.
#ExecCGI: Allows CGI scripts to be executed using mod_cgi.
#FollowSymLinks: The server allows symbolic connections to be used in this directory. Note: Even though the server uses symbolic connections, it does not change the
#Includes: Allows server-side containment provided with mod_include.
#IncludesNOEXEC: Allow server-side containment, but disable #execcmd and #execcgi. However, you can still use the "#includevirtual" virtual CGI script from the Scriptalias directory.
#Indexes: If a URL mapped to a directory is requested, and there is no directoryindex (for example: index.html) In this directory, the server returns a formatted list of directories generated by Mod_autoindex.
#MultiViews: Allows the use of mod_negotiation to provide content negotiation of "multi-Attention Map" (multiviews).
#SymLinksIfOwnerMatch: The server uses a symbolic connection only if it has the same UID as the owner of its destination directory or file.
#一般来说, if a directory is set to the options multiple times, the most special one will be fully accepted (others are ignored), and the settings of each option are not fused to each other. However, this option will be merged if all of the options are available with a "+" or "-" symbol before the option command. All options preceded by the "+" sign will force the override of the current optional setting, and all options preceded by the "-" sign will be forced to be removed from the current optional settings.

#AllowOverride指令控制允许存在于 the instruction type in the. htaccess file with the following values: Optionsfileinfo authconfig Limit Allnone
#当服务器发现一个. htaccess file (specified by accessfilename), it needs to know which directives are declared in this file to overwrite the configuration directives specified earlier. AllowOverride only if no regular expression is included
#选项:
#AuthConfig: Permits the use of instructions related to certification authorizations (Authdbmgroupfile,authdbmuserfile, AuthGroupFile, AuthName, AuthType, AuthUserFile, Require, etc.).
#FileInfo: Allows the use of commands that control document types (Defaulttype,errordocument, Forcetype, languagepriority, Sethandler,setinputfilter, Setoutputfilter, Mod_mime add* and remove* directives, etc.), instructions for controlling document metadata (Header,requestheader, setenvif, Setenvifnocase, Browsermatch, Cookieexpires,cookiedomain, Cookiestyle, Cookietracking,cookiename), mod_rewrite in the instructions (RewriteEngine, Rewriteoptions, Rewritebase, Rewritecond,rewriterule), and the action directive in mod_actions.
#Indexes: Allows the use of commands that control the index of the directory (Adddescription,addicon, addiconbyencoding, Addiconbytype, Defaulticon,directoryindex, Fancyindexing, Headername, Indexignore, Indexoptions,readmename, etc.).
#Limit: Allows the use of commands that control host access (Allow,deny, order).
#Options [=option,...] Allows the use of commands (options and Xbithack) that control the functionality of the specified directory. You can append a comma-delimited list of options (no spaces) after the equals sign to control which options are allowed for the option directive.

#Order指令: Controls whether to allow fetching from the server, that is, the order in which the default access state is controlled and allowed and deny directives are in effect
#Allow指令: Control which hosts have access to the server
#Deny指令: Control which hosts are blocked from accessing the server

Options FollowSymLinks
AllowOverride None
Order Deny,allow
Deny from all

#
#Note that forward must specifically allow
#particular features to be enabled-so if something's not Workingas
# You are might expect, make sure so you have specificallyenabled it
# below.
#

############### #网站主根目录设置 ############
#This should is changed to whatever you set Documentrootto.
# Use this to change the site root that you will be setting

   #
    # Possible values for the Options directiveare " None "," All ",
    # or Anycombination of:
    #   Indexes Includesfollowsymlinks symlinksifownermatch execcgi multiviews
   #
    # Note That "MultiViews" must benamed *explicitly*---"Options all"
   # doesn ' t give it for you.
&NBSP;&N bsp;  #
   # the Options directive is both complicated and important. please see
&NBSP;&N bsp;  #http://httpd.apache.org/docs/2.2/mod/core.html#options
   # for more information.
    #
   options Indexes followsymlinks

#
# AllowOverride Controls What directives is placed in. htaccessfiles.
# It can be ' all ', ' None ', or any combination of the keywords:
# Options FileInfo authconfig Limit
#
AllowOverride None

#
# Controls who can get stuff from the this server.
#
Order Allow,deny
Allowfrom All

################### #网站主页索引 ##############
#DirectoryIndex: Sets the file that Apache would serve if a directory
#is requested.
#在目录被请求是查找的主文件. The site home page format is set.

DirectoryIndex index.html

################## #ht文件等是否被查看设定 ##############
#The following lines prevent. htaccess and. htpasswd files from Being
# viewed by WEB clients.
#如下配置保护正则表达式中所描述的文件不被web所查看
#Satisfy指令: Access policies when both allow and require are used. The parameter can be set to all or any. This instruction acts only when access control for a particular zone is limited by the user name/password and the client host address. The default behavior (all) takes the way that the client first passes the address access restrictions and enters a valid user name and password. Using the optional any will give the client access to one of two ways, either through a host limit or by entering a valid user name and password. This way, you can restrict access to a zone by using a password, but you do not need to enter a password to allow client access to certain addresses.

   order allow,deny
    deny from all
   satisfy all

################ #错误日志存储地点 ##############
#ErrorLog: The location of the error log file.
# If You did notspecify an errorlog directive within a
# container, errormessages relating to that virtual host would be
# logged here. If you *do* define an error logfile for a
# container, Thathost ' s errors'll be logged there and nothere.
#错误日志. If the virtual host is not configured with error log parameters, the number is written, and if the virtual host is configured with this parameter, the file defined by the virtual host parameter is used.
Errorlog "Logs/error_log"

################# #日志存储级别 (that is, log content and format) ####################
#LogLevel: Control The number of messages logged to the Error_log.
#Possible values Include:debug, info, notice, warn, error, crit,
#alert, Emerg.
#控制记录到日志的消息的级别. Optional values are debug,info, notice, Warn, error, crit, alert, Emerg.
LogLevel warn


   #
    # Following directives define some formatnicknames for use with
    # a Customlog directive (see below).
   #
#下面的指令定义了一些为用户指令而使用的别名的格式. Apache configuration, Logformat available variable format string describes
#%% percent (Apache2.0.44 or higher)
#%a remote IP address
#%a native IP address
#%b bytes transmitted in addition to HTTP headers
#%b the number of bytes transmitted in CLF format except for the HTTP header, which means '-' instead of 0 when there is no byte transfer.
#%{foobar}c the contents of the Cookiefoobar in the request to the server.
the time, in micro units, that the #%d server takes to process this request.
#%{foobar}e environment variable FOOBAR

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.