Apache server configuration overview (6)

Source: Internet
Author: User

Here we can see another statement, Limit, which is used to set access control for specific request methods, you can use GET, POST, and other server-supported request methods as Limit parameters to set access restrictions for different request methods. Generally, you can open the GET, POST, and HEAD request methods, and shield other request methods to increase security. In the Limit statement, you can use the Order, Allow, Deny, Allow, and Deny methods to restrict domain names and IP addresses, except that the domain names are matched forward and backward, the IP address is matched from the front to the back.
 

DirectoryIndex index.html
In many cases, the document name is not specified in the URL, but a directory name is provided. The Apache server will automatically return the files defined by DirectoryIndex in this directory. Of course, multiple file names can be specified, and the system will search in this directory in sequence. If all the files specified by DirectoryIndex do not exist, the Apache server can generate a list of all the files in this directory based on the system settings. In this case, the Indexes option (Options Indexes) in the access control option of the directory must be enabled so that the server can generate a directory list. Otherwise, Apache rejects access.
 

AccessFileName. htaccess
AccessFileName defines the name of the access control file under each directory. The default value is. htaccess. You can change this file to change the access control restrictions of different directories.
 

Order allow, deny
Deny from all
In addition to directory access control, you can also set access control based on files.
Is the task of the File statement. When using the File statement, no matter which directory the File is in, the corresponding access control must be accepted as long as the name matches. This statement is important to system security. For example, in the above example, all users will be blocked from accessing the. htaccess file, so that key security information in. htaccess will not be obtained by the customer.
 

# CacheNegotiatedDocs
By default, if the proxy server and Apache server negotiate whether to cache their web pages
In a negative response, you do not want your webpage to be cached by the proxy server. However, this method cannot effectively take advantage of the proxy server. Therefore, you can set the CacheNegotiatieDocs option to enable the proxy server to cache webpages. However, even if this option is not set, some proxy servers (or by adjusting the settings) can cache webpages.
 

UseCanonicalName On
Enabling this UseCanonicalName is the standard practice of the Web server, because most of the requests sent by the client are referenced by the server, so that the server can use the ServerName and Port options to build a complete URL, and respond to the customer so that the browser can get a standard URL. If this parameter is set to Off, Apache will obtain the server name and port value from the customer request (this information will be available in requests of customers that support HTTP 1.1 ), rebuild the URL.

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.