LINUX Apache Server Configuration Raiders (5)

zhaozj2021-02-11  202

LINUX Apache Server Configuration Raiders (5)

Author: Bo OSO Oso

Here you can see another statement Limit, the LIMIT statement is used to set access control for the specific request method, where you can use the requesting method supported by various servers such as GET, POST to make limit parameters, to set the pair The access limit of the request method. All three request methods for GET, POST, HEAD can generally be opened, and other request methods can be opened to increase security. In the LIMIT statement, you can use the matching method to limit the domain name and IP in order, allow, deny, allow, and deny, just match the domain name, match the IP address.

DirectoryIndex Index.html

In many cases, there is no name of the document in the URL, but just give a directory name. Then the Apache server automatically returns files defined by DirectoryIndex in this directory, of course, multiple file names can be specified, and the system searches in this directory. When all files specified by DirectoryIndex do not exist, the Apache server can generate all file lists in this directory according to system settings, providing user selection. The indexes option (Options Indexes) in the access control option of this directory must be opened so that the server can generate a directory list, otherwise Apache will reject access.

AccessFileName .htaccess

AccessFileName Defines the file name of the access control file in each directory, default to .htaccess, you can change the access control limit for different directories by changing this file.

ORDER ALOW, DENY

Deny from all

In addition to access control for the directory, you can set access control according to the file.

Is the task of the File statement. Using the File statement, regardless of the directory of the file, as long as the name matches, the corresponding access control must be accepted. This statement is more important for system security, such as the above case, unable to access the .htaccess file, so that key security information inhtaccess is not obtained by customers.

#Cachenegotiatedddocs

By default, if the proxy server and the Apache server negotiate if its webpage is cached, Apache gives

Give a negative answer, do not want your own web page to be cached by the proxy server. However, this is not effective to utilize the advantages of the proxy server, so the cachenegotiatiedocs option can be set so that the proxy server can cache the web page. However, even if this option is not set, some proxy servers (or by adjusting settings) can also cache web pages.

Usecanonicalname on

Open this UsecanonicalName is a standard approach to the web server, because most of the requests sent by customers are references to this server, so that the server can build a complete URL using the set content of the ServerName and Port Options, and respond to the customer, enabling the browser to get Specification URL. If this parameter is set to OFF, Apache will use the name and port value of the server from the customer request (which will have this information in the request of the HTTP 1.1), re-build the URL.

Typesconfig /usr/local/apache/etc/mime.types

TYPECONFIG is used to set file names that have different MIME type data, and set to /usr/local/apache/etc/mime.types under Linux.

DefaultType Text / Plain If the web server does not determine the default type of a document, this usually means that the document uses a non-standard suffix, then the server sends a document to the client browser using the DEFAULTTYPE defined MIME type. The settings here are text / plain, which sets the problem is that if the server cannot judge the MIME of the document, this document is a binary document, but use the text / place format to send back, the browser will open inside It does not prompt to save. Therefore, it is recommended to change this setting to

Application / OCTET-Stream, so browser will prompt users to save.

MimeMagicfile / usr / local / apache / etc / magic

In addition to judging the MIME type of the file from the verative suffix, Apache can further divide

Analytical features of the document to determine the real MIME type of the file. This feature is implemented by the mod_mime_magic module, which requires a file that records various MIME type features for analysis and judgment. The above setting is a conditional statement. If this module is loaded, you must specify the location of the corresponding flag file MAGIC.

>> Previous article: Linux Under Apache Server Configuration Raiders (4) >> Next article: Linux Apache Server Configuration Raiders (6)

转载请注明原文地址:https://www.9cbs.com/read-3636.html

New Post(0)