Apache Main Configuration Detailed

Source: Internet
Author: User
Tags aliases ranges web hosting

1.

# Deny access to the entirety of your server ' s filesystem. You must

# explicitly permit access to Web content directories in other

# <Directory> blocks below.

#拒绝所有对你服务器文件系统的访问. You must explicitly license access to the Web content directory in the other <Directory> areas below

#

<directory/>

allowoverride None

Require all denied

</Directory>


2.

# Documentroot:the directory out of which you'll serve your

# documents. By default, all requests is taken from this directory, but

# Symbolic links and aliases may is used to the other locations.

#DocumentRoot: The directory where you want to use the "serve" document. By default, all requests are fetched from this directory, but you can use the symbolic connection "symbolic link" and the alias to specify a different location.

# "The following command specifies the document directory, which is the root directory of the Web site"

DocumentRoot "C:/apache24/htdocs"

<directory "C:/apache24/htdocs" >

#

# Possible values for the Options directive is "None", "all",

# or any combination of:

# Indexes includes followsymlinks symlinksifownermatch execcgi multiviews

#可能的设置指令值是 "None", "all", or any of the following combinations:

#Indexes includes followsymlinks symlinksifownermatch execcgi multiviews

#

# Note that "MultiViews" must is named *explicitly*---"Options all"

# doesn ' t give it to you.

#注意那个 "MultiViews" must be named exactly-----"Options all" will not play any role "doesn ' t give it to you"? 】

#

# The Options directive is both complicated and important. Please see

# http://httpd.apache.org/docs/2.4/mod/core.html#options

# for more information.

#选项指令复杂且重要. See Http://httpd.apache.org/docs/2.4/mod/core.html#options for more information #

#

Options Indexes FollowSymLinks

#

# AllowOverride Controls What directives is placed in. htaccess files.

# It can be ' all ', ' None ', or any combination of the keywords:

# allowoverride FileInfo authconfig Limit

# allowoverride controlled instructions may be included in the. htaccess file. It can be any combination of "all", "None", or any of the following keywords:

# allowoverride FileInfo authconfig Limit

#

AllowOverride None

#

# Controls who can get stuff from the this server.

#下面的指令控制谁能从这台服务器上获取东西

#

Require all granted

</Directory>


3.

# directoryindex:sets The file that Apache would serve if a directory

# is requested.

# DirectoryIndex: Set the file to be accessed when the Apache service gets a directory request "default home page"

#

<ifmodule dir_module>

DirectoryIndex index.html

</IfModule>


4.

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

# viewed by WEB clients.

#下面的行禁止. htaccess and. htpasswd files are viewed by the Web client "Prohibit access to. htaccess and. htpasswd files from the browser"

#

<files ". ht*" >

Require all denied

</Files>

5.

# errorlog:the location of the error log file.

# If You don't specify an errorlog directive within a <VirtualHost>

# container, error messages relating to that virtual host would be

# logged here. If you *do* define an error logfile for a <VirtualHost>

# container, that host ' s errors would be logged there and isn't here.

# errorlog: The location of the error log file. If you do not specify a errorlog directive in the <VirtualHost> container, the errors associated with that virtual host will be recorded here. If you do define an error message file for a <VirtualHost> container, then the host's error log will be recorded there instead of here.

#

Errorlog "Logs/error.log"

6.

<ifmodule alias_module>

#

# Redirect:allows clients about documents, used to

# exist in your server ' s namespace, but does not anymore. The client

# would make a new request for the document at its new location.

#Redirect: Allows you to notify the client of a document that was previously present in the server namespace and no longer exists. The client sends a new request to obtain a new document location.

# Example:

# Redirect Permanent/foo Http://www.example.com/bar

#

# Alias:maps Web paths into filesystem paths and are used to

# Access content that is does not live under the documentroot.

# alias: An alias that maps a network path to a file system path and is used to access content that does not exist at the root of the Web site.

# Example:

# Alias/webpath/full/filesystem/path

#

# If you include a trailing/on/webpath then the server would

# require it to is present in the URL. You'll also likely

# need to provide a <Directory> sections to allow access to

# The FileSystem path.

#如果你包含了 Trainng/on/webpath then the server gets it and renders it in the URL. 【? 】

#

# Scriptalias:this controls which directories contain server scripts.

# scriptaliases is essentially the same as Aliases, except that

# documents in the target directory is treated as applications and

# run by the server when requested rather than as documents sent to the

# Client. The same rules about trailing '/' Apply to Scriptalias

# directives as to Alias.

#ScriptAlias: A script alias that controls the directories that contain server scripts. The "script alias" is essentially the same as "alias" unless the document in the target directory is treated as an application and is run by the server when requested, rather than as if the document was sent to the client. "When the document in the target directory is an application, the client is run by the server when requested, rather than being sent to the client as a document, and only then does the script alias be different from the alias"? 】。 The rule ends with a slash "/" for the Scriptalias and alias directives.

#

scriptalias/cgi-bin/"c:/apache24/cgi-bin/"

</IfModule>

7.

<ifmodule mime_module>

#

# Typesconfig points to the file containing the list of mappings from filename extension to Mime-type.

# Typesconfig points to a file that contains a list of mappings from the file extension to Mime-type "Typesconfig points to a file that contains a list of mappings for the file name extension with Mime-type"

#

Typesconfig Conf/mime.types

#

# AddType allows you to add to or override the MIME configuration

# file specified in Typesconfig for specific file types.

# AddType allows you to add or overwrite MIME profiles specified in Typesconfig for special file types

#

#AddType Application/x-gzip. tgz

#

# addencoding allows you are certain browsers uncompress information on the fly. Note:not all browsers.

# addencoding allows you to have an adaptive ability to extract information from specific browsers. Note: Not all browsers are supported.

#

#AddEncoding x-compress. Z

#AddEncoding x-gzip. gz. tgz

#

# If The addencoding directives above is commented-out, then you

# Probably should define those extensions to indicate media types:

#如果上面的AddEncoding指令被注释, you might want to define those extensions to indicate the media type.

#

AddType application/x-compress. Z

AddType application/x-gzip. gz. tgz

#

# AddHandler allows to the map certain file extensions to "handlers":

# actions unrelated to filetype. These can either built into the server

# or added with the Action directive (see below)

# addhandler allows you to map a specific file extension to "handlers": the action is independent of the file type. This can also be built into the server or added with the action directive (see below)

#

# to use CGI scripts outside of scriptaliased directories:

# (You'll also need to add "execcgi" to the "options" directive.)

#为了在脚本别名指定的目录外使用CGI脚本: (You also need to add "execcgi" to the "Options" command)

#AddHandler Cgi-script. CGI

# for type maps (negotiated resources): For type Mapping (protocol Resource) "? 】

#AddHandler type-map var

#

# Filters allow your to process content before it's sent to the client.

# filters allows you to handle content before it is sent to the client.

#

# to parse. shtml files for Server-side includes (SSI):

# (You'll also need to add "includes" to the "options" directive.)

#为 "Server side contains" analysis. shtml file: (You also need to add "includes" to the "Options" command)

#AddType text/html. shtml

#AddOutputFilter includes. shtml

</IfModule>

8.

# Customizable error responses come in three flavors:

# 1) Plain text 2) local redirects 3) external redirects

#可定制的错误响应支持三种方式: 1) Clear text 2) local redirect 3) external redirect

# Some Examples:

#ErrorDocument "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

#

#

# maxranges:maximum number of Ranges in a request before

# returning the entire resource, or one of the special

# values ' Default ', ' None ' or ' unlimited '.

# Default setting is to accept Ranges.

# Maxranges: Defines the maximum number ranges before a request returns all resources, or a value specified in ' Default ', ' None ' or ' unlimited ' three values.

#MaxRanges Unlimited

9.

# Server-pool Management (MPM specific)

#服务器池管理

#Include conf/extra/httpd-mpm.conf

# Multi-Language error messages multi-language fault message

#Include conf/extra/httpd-multilang-errordoc.conf

# Fancy Directory listings Dynamic Directory list form configuration

#Include conf/extra/httpd-autoindex.conf

# Language Settings Language Settings

#Include conf/extra/httpd-languages.conf

# User Home directories users home directory

#Include conf/extra/httpd-userdir.conf

# Real-time info on requests and configuration real-time information on requests and configurations

#Include conf/extra/httpd-info.conf

# Virtual hosts web Hosting

#Include conf/extra/httpd-vhosts.conf

# Local access to the Apache HTTP Server Manual the Apache HTTP Server manual.

#Include conf/extra/httpd-manual.conf

# Distributed Authoring and Versioning (WebDAV) Distributed Authoring and Versioning

#Include conf/extra/httpd-dav.conf

# Various default settings multi-category defaults

#Include conf/extra/httpd-default.conf

10.

# Configure mod_proxy_html to understand HTML4/XHTML1 configuration mod_proxy_html, so it supports HTML4/XHTML1

<ifmodule proxy_html_module>

Include conf/extra/proxy-html.conf

</IfModule>

# Secure (SSL/TLS) connections secured connection

#Include conf/extra/httpd-ssl.conf

Apache Main Configuration Detailed

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.