WDCP log removal techniques in Linux

Source: Internet
Author: User
Tags disk usage

Apache or Nginx have a switch default log, one is the normal access log, one is the wrong log,
Directory in
/www/wdlinux/nginx-1.0.15/logs
/www/wdlinux/httpd-2.2.22/logs
Both logs will record all normal and abnormal access log information.
and is the domain name on all servers, unless, in the site management city, logging is enabled to record the corresponding site domain name log to another separate file.
Otherwise, it will be recorded in these files so that is the default Web server log file.
However, generally speaking, this log is not necessary, unless there are other necessary, such as the analysis of the log or other data statistics, close the log only benefits no harm.

If a log is opened for the site, the default directory is in/www/web_logs, and the site log is recorded at the beginning of the site's domain name. Go to/www/web_logs and delete it below.
According to the actual situation whether or not to open the site log in the WDCP background of the site settings there.

Close method:

1. Enter WDCP background-system settings-click "Close Web Default log"

2. Access to the above directory (/www/wdlinux/nginx-1.0.15/logs/www/wdlinux/httpd-2.2.22/logs)

Delete a file that starts with a and E:

#rm-fr Access_log

#rm-fr Error_log

3. Execute/www/wdlinux/tools/web_logs.sh On/off//Open or close (wdcp_v2.5 version)

or manual operation

Nginx Shutdown method
Sed-i '/log_format/a
Access_log off; '/www/wdlinux/nginx/conf/nginx.conf

The Apache Shutdown method
Sed-i ' S#customlog ' logs/access_log ' common#customlog/dev/null common# '/www/wdlinux/apache/conf/httpd.conf

At last

Restart Apache
/ETC/INIT.D/HTTPD restart

Restart Nginx
/etc/init.d/nginxd restart

Again df-h view disk usage has returned to normal.

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.