Apache Configuration Options Detailed

Source: Internet
Author: User

Http://www.365mini.com/page/apache-options-directive.htm

OptionsDirectives are a common and important instruction in the Apache configuration file, which Options can be used in Apache Server Core configuration (server config), virtual host configuration (VM), specific directory configuration (directory) As well as the. htaccess file used. OptionsThe primary purpose of the directive is to control which server features are enabled for a particular directory.

OptionsThe common configuration example code for directives is as follows:

    1. <directory />
    2. #指定根目录 "/" Enable indexes, followsymlinks two features.
    3. Options Indexes FollowSymLinks
    4. AllowOverride All
    5. Order Allow,deny
    6. Allow from all
    7. </Directory>

OptionsThe complete syntax for the directive is: Options [+|-]option [[+|-]option] ... . In short, the Options command can be appended with a specified number of server features, and feature options are separated by a space. Let's take a look at the Options specific functions and meanings of the feature options that can be appended after the instruction (the contents of the Apache configuration are not case-sensitive):

All
represents MultiViews all attributes except the. This is also the default setting for the options directive.
None
indicates that no server attributes are enabled.
FollowSymLinks
The server allows symbolic connections to be used in this directory. If the configuration option is <Location> in the configuration section, it will be ignored.
Indexes
If you enter a URL that corresponds to a file directory on the server, and there is no DirectoryIndex instruction (for example:) in this directory, the DirectoryIndex index.html index.php server returns mod_autoindex a list of formatted directories generated by the module and lists all the files (such as) in that directory.

MultiViews
allows the use mod_negotiation of modules to provide content negotiation "multi-attention graph." In short, if a client requests a path that might correspond to more than one type of file, the server will automatically select a file that best matches the client's requirements, depending on the client's request. For example, file there are two files named and in the folder under the server site, at which hello.jpg point the hello.html user enters Http://localhost/file/hello and if file there is no subdirectory under the folder hello , the server will try to file find the shape under hello.* the folder Files, and then returns the most matching requirements, depending on the specific circumstances of the user request hello.jpg hello.html .
SymLinksIfOwnerMatch
The
server uses a symbolic connection only if it has the same user ID as the owner of the destination file or directory. In short, symbolic connections are used only if the owner of the destination file or directory to which the symbolic connection and the symbolic connection points is the same user. If the configuration option is <Location> in the configuration section, it will be ignored.
execcgi
allows the use of mod_cgi modules to execute CGI scripts.
Includes
allows mod_include the use of server-side include functionality provided by the module.
IncludesNOEXEC
Allow server-side containment, but disable "#exec cmd" and "#exec CGI". However, you can still ScriptAlias use the virtual CGI script "#include virtual" from the directory.

In addition, a more attentive reader should note that the Options instruction syntax allows for the addition of the symbol "+" or "-" before the configuration option, so what does this mean?

In fact, Apache allows you to set multiple instructions in a single directory configuration Options . However, in general, if a directory is set more than once Options , one instruction that specifies the maximum number of attributes is Options fully accepted (others are ignored), and the individual Options directives are not merged. But if we precede the optional configuration with the symbol "+" or "-", it means that the optional option will be merged. 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. You can refer to the following example:

  1. #示例1
  2. <Directory /Web/file>
  3. Options Indexes followsymlinks
  4. </directory>
  5. <directory/Web/file/image>
  6. Options includes
  7. </directory>
  8. #目录/Web/file/image will only be set includes attribute
  1. #示例2
  2. <Directory /Web/file>
  3. Options Indexes followsymlinks
  4. </directory>
  5. <directory/Web/file/image>
  6. Options +includes -Indexes
  7. </directory>
  8. #目录/Web/file/image will be set includes,followsymlinks Two kinds of features

Note 1: mixed use of the same option preceded by "+"/"-" and without "+"/"-" may lead to unexpected results.

Note 2: -IncludesNOEXEC when used or -Includes , the server-side containment is completely disabled, regardless of the previous setting.

Apache Configuration Options 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.