: // www \. aslibra \. com/" local_ref = 1
Order Allow, Deny
Allow from env = local_ref
Allow from 127.0.0.1
The above is to determine that the source is the above domain name, and then set to allow access
SetEnvIfNoCase Referer "^ http: // notpermit \. aslibra \. com/" aaa
Order Allow, Deny
Allow from all
Deny from env = aaa
The above is to determine the source, and then do not allow this domain name
3. Log Segmentation
You can use cronolog to process log segmentation.
Installation is easier.
D
the DNS lookup function. However, this causes the server to perform DNS queries for each customer request, increasing system overhead and slowing down the response. Therefore, this option is disabled by default. After the option is disabled, the server will not obtain the host name of the client, but can only use IP addresses to record the client. Errorlog/var/log/httpd-error.log Loglevel warn Logformat quot; % H % L % u % T quot; % R quot; % gt;
Accessfilename. htaccess distributed access control file
// Specify the storage location for configuration files that process MIME-specific formats
Typesconfig/etc/mime. Types
// Specify the default MIME file type as a plain text or HTML file
Defaulttype text/plain
// Only record the IP address connected to the Apache server, not the host name
Hostnamelookups off
Access log settings
Errorlog logs/error_log location of the Error Log
# Loglevel: Debug, info, notice, warn, error, crit,
Logl
number of messages that are recorded to Error.log. # It's possible.
Values include: debugging, information, notification, warning, error, crit, # Alert, Emerg.
#
LogLevel Warning
#
# The following instructions are used to define some format nicknames with # a customlog instruction (
See below).
#
Logformat "%h%l%u%t \%r\"%>s%b \ "%{referer}i\" \ "%{user-agent}i\" "combined
Logformat "% h% l% u% t \"%r\ "%
*.*/|. Ftpaccess #DenyFilter做一些过滤, Regular expression
#DenyFilter ~! ' **/?,$@ # according to their own needs to write it, above the good rotten: P
#LsDefaultOptions "-L" #ls参数
#AllowForeignAddress on #要允许 FXP written on
Commandbuffersize 128 #最大命令长度
Dirfakeuser on FTP #不显示给用户真实的用户, group
Dirfakegroup on FTP
Deferwelcome on #显示欢迎信息
Pathdenyfilter "(^.ftpaccess$)" #同DenyFilter filtration
User nobody #proftpd which users, groups to run
Group Nobody
TIMESGMT off #时间
Denyall
#也可以这里设置允许连接的网段 Log
1, identify the search engine:
Before the "/etc/httpd/conf/httpd.conf" file "Logformat", add the following to determine whether the spider is crawling or real user access:
Setenvifnocase user-agent "(googlebot| mediapartners-google| baiduspider| Msnbot|sogou spider| sosospider| Yodaobot| yahoo| Yahoo) "Robot
2. Define Log format:
Add a row under "httpd.conf" File "Logformat" to set a new log format:
permissions are inherited, and if the user rights to run the Apache service are too high, it is likely that intruders will be severely threatened by the webshell of the system. In general we run Apache with nobody users and nobody groups. The user and group options are found between the 250-275 lines of httpd.conf, such as our default settings as follows (the annotation information is removed):
User Nobody
Group #-1
(2) Apache log files
Apache log file is very important, you can fin
]OptionLogfileThe reference name is the log file name. If logfile contains '%', it is considered as a string in strftime (3) format; otherwise, it is automatically added with the. nnnnnnnnnn Suffix in seconds. Both formats indicate the start time of the new log.RotationtimeInterval of Log File rollback in secondsOffsetThe number of minutes relative to the UTC time difference. If it is omitted, it is assumed that it is 0 and UTC time is used. For example, to specify the local time of the area wit
Dynamic VM
This is the configuration method in the httpd. conf file to achieve the same effect as the virtual host mentioned in the motivation section above, but the mod_vhost_alias module is used here:
# Obtain the Host name from the "Host:" Header
UseCanonicalName Off
# This log format can extract the host name from the first field
LogFormat "% V % h % l % u % t \" % r \ "% s % B" vcommon
CustomLog logs/access_log vcommon
# DeflateFilterNote ratio
LogFormat "% h % l % u % t \" % r \ "%> s % B \" % {Referer} I \ "\" % {User-Agent} I \ "" combined
LogFormat "% h % l % u % t \" % r \ "%> s % B" common
LogFormat "% {Referer} I-> % U" referer
LogFormat "% {User-agent} I" agent
ErrorLog "|/usr/local/cronolog/sbin/cronolog/www // www.te
(3); otherwise, it is automatically appended with the. nnnnnnnnnn suffix in seconds. Both formats represent the time when the new log began to be used.RotationtimeThe interval in seconds for the log file to be rolled back, and 86400 for one day, a new log file is generated daily.OffsetThe number of minutes of the time difference relative to UTC. If omitted, the default is 0, and UTC time is used. For example, to specify local time for a region with a UTC time difference of 5 hours, this paramet
host configuration file:In double quotes, the front vertical line is the pipe character, which means that the resulting log is passed to Rotatelogs, which is the tool for Apache's own cut logs. The function of-L is to calibrate the timezone to UTC, Beijing time. The last side of 86400, the unit is the second, meaning a day. The combined for double cited is the log format, which defines the log format in/usr/local/apache2/conf/httpd.conf.[[email protected] ~]# grep
(3); otherwise, it is automatically appended with the. nnnnnnnnnn suffix in seconds. Both formats represent the time when the new log began to be used.RotationtimeThe interval in seconds for the log file to be rolled back, and 86400 for one day, a new log file is generated daily.OffsetThe number of minutes of the time difference relative to UTC. If omitted, the default is 0, and UTC time is used. For example, to specify local time for a region with a UTC time difference of 5 hours, this paramet
parameter is shown in the official manual Errorlogformat."[%{u}t] [%-m:%l] [pid %P:tid %T] %7F: %E: [client\ %a] %M% ,\ referer\ %{Referer}i"1.2 Access Log CustomlogUse the Customlog directive to specify the location of the access log records, which can be used multiple times under the same host to represent the same log record to multiple locations. The syntax format is:CustomLog file|pipeformat|nickname [env=[!]environment-variable| expr=expression]Use Lo
I. log analysis if the default configuration is used during apache installation, two files are generated under the logs directory, access_log and error_log1.access_logaccess_log, respectively, as access logs, record all requests to the apache server. Its location and content are controlled by the CustomLog command. The LogFormat command can be used to simplify
I. log analysis if the default configuration is used during apache installation, two files a
AccessFileName. htaccess
Order allow, deny
Deny from all
UseCanonicalName On
TypesConfig/etc/mime. types
DefaultType text/plain
MIMEMagicFile share/magic
HostnameLookups Off
ErrorLog/usr/httpd/log/error_log
LogLevel warn
# Define which error types are recorded in the error log
LogFormat "% h % l % u % t \" % r \ "%> s % B \" % {Referer} I \ "\" % {User-Agent} I \ "" combined
# All logformats are used to define entries in logs.
kernel to send files to the client. By default, when processing a request that does not need to access data in the file (for example, sending a static file content), if the operating system supports, apache uses sendfile to directly send the file content to the client without reading the file.
1 484 ErrorLog logs/error_log
Location where error logs are stored
491 LogLevel warn
Apache Log Level
497 LogFormat "% h % l % u % t \" % r \ "%> s % B \" % {R
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.