LINUX Apache Server Configuration Raiders (6)

zhaozj2021-02-11  213

LINUX Apache Server Configuration Raiders (6)

Author: Bo OSO Oso

Usually, the server can only get the client's IP address, if you want to get the client's

The host name, in order to use the logging and supplied to the CGI program, you need to use this HostNameLookups option to set it to ON to open the DNS inverse feature. However, this will enable the server to perform DNS queries for each customer request, increase the system overhead, so that the reaction goes slow, so the default setting is to close this option using OFF. After the option is closed, the server will not obtain the host name of the client, and only the IP address can be used to record the customer.

Errorlog /var/log/httpd-error.log

Loglevel Warn

Logformat "% H% L% u% T"% R "%> S% B"% {refere} i ""% {user-agent} "" Combined

Logformat "% H% L% U% T"% r "%> s% B" CommON

Logformat "% {referer} i ->% u" Referer

Logformat "% {User-agent} i" Agent

#Customlog /var/log/httpd-access.log Common

#Customlog /var/log/httpd-referer.log Referr

#Customlog /var/log/httpd- at theLOG Agent

Customlog /var/log/httpd-access.log Combined

Here, the system log is defined, and the server error record is defined by ERRORLOG, Loglevel to define different error log files and its recorded content.

For system access logs, the default uses CustomLog parameter definition logs, default Using Combined parameters Specify all access logs in a file, but you can also place different types of access logs in different log record files. This is done by specifying a different record type in CustomLog. Common represents a normal pair request access record, Referer means a reference record of each page, you can see the number included in a page, and the agent represents the type record of the client, obviously can set the existing Combined definition. Release it off, and use common, refrer, and agent as Customlog parameters to specify logging files, respectively.

Obviously, logformat is the format used to define different types of logs, here

Use the macro definition of the beginning to record different content.

If these parameters specified by the files are relative path, then relative to ServerRoot

path.

Serversignature ON

In some cases, for example, the server will generate an error document when the webpage requested by the customer requests.

By default, since the Serversignature option is opened, the last line of the error document will contain information such as the server's name, Apache version. Some administrators more inclined to display this information,

This parameter can be set to OFF, or set to email, and the last line will replace the email prompt for ServerAdmin.

Alias ​​/ ICONS / "/ www / icons /"

Options Indexes MultiViews

ALLOWOVERRIDE NONE

ORDER ALOW, DENY

The Allow from AlLalias parameter is used to direct the URL to the real location in the server file system, general

The document will be queried in DocumentRoot, however, using Alias ​​defined paths will be mapped directly to phase

In response to DocumentRoot, you should check it out below. So Alias ​​can be used to map some

The path to the public file, such as the ICONS path of various commonly used icons. This allows the directory outside the document root directory to be available to the browser in addition to using the Alias ​​mapping, in addition to using the Alias ​​mapping.

Once you define the path to the map, you should need to use the Directory statement to set access restrictions.

Scriptalias / cgi-bin / "/ www / cgi-bin /"

ALLOWOVERRIDE NONE

Options none

ORDER ALOW, DENY

ALLOW FROM ALL

Scriptalias is also mapping for the URL path, but different from Alias ​​is that Scriptalias is the path for mapping the CGI program. The files under this path are defined as the CGI program, by performing them, not directly Returns its content. By default, the CGI program uses the CGI-bin directory as a virtual path.

# Redirect Old-Uri New-URL

The redirect parameter is used to override the URL. When the browser accesses an unsatisfactory resource on the server, the server returns the new URL to the browser, telling the browser to get resources from the URL. This is mainly used to exist in the server on the server, and after changing the location, and hopes to use the old URL to access to keep the previous URL compatible.

IndexOptions FancyIndexing

AddiconbyEncoding (CMP, / ICONS / Compressed.gif) X-Compress X-Gzip

AddiconByType (txt, / icons / text.gif) text / *

AddiconByType (IMG, / ICONS / Image2.gif) Image / *

AddiconByType (SND, / ICONS / SOUND2.GIF) AUDIO / *

AddiconBytype (VID, / ICONS / MOVIE.GIF) VIDEO / *

Addicon /icons/binary.gif .bin .exe

Addicon /icons/binhex.gif .hqx

Addicon /icons/tar.gif.tar

Addicon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv.

Addicon /icons/compressed.gif.z .z .tgz .gz .zip

Addicon /icons/a.gif.ps .ai .eps

Addicon /icons/Layout.gif .html .shtml .htm .pdf

Addicon /icons/text.gif.txt

Addicon /icons/c.gif .c .c

Addicon /icons/p.gif.pl .py

Addicon /icons/f.gif .for

Addicon /icons/dvi.gif.dvi

Addicon /icons/uuencoded.gif .uu

Addicon /icons/script.gif .conf .sh .shar .csh .ksh .tcl

Addicon /icons/tex.gif .tex

Addicon /icons/bomb.gif core

Addicon /icons/back.gif ..

Addicon /icons/hand.right.gif readmeaddicon /icons/folder.gif ^^ Directory ^^

Addicon /icons/blank.gif ^^ blankicon ^^

Defaulticon /icons/unknown.gif

#Adddscription "gzip compressed document" .gz

#Adddescription "tar archive" .tar

#Adddescription "Gzip Compressed Tar Archive" .tgz

ReadMename Readme

Headername header

Indexignore. ?? * * ~ * # HEADER * README * RCS CVS *, V *, T

When an HTTP request URL is a directory, the server returns the index file in this directory. However, if there is no default index file in a directory, and the server is licensed to display a list of directory files, the file list in this directory will be displayed, in order to make this file list can be understood, not just It is a simple list that requires the previous setting parameters.

>> Previous article: Linux Apache Server Configuration Raiders (5) >> Next article: Linux Apache Server Configuration Raiders (7)

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

New Post(0)