Last update at :2024-06-17,Edit by888u
Today, some netizens inquired about the need to delete website and system log files in the WDCP panel site environment. Since the website has been running for more than a year, the log data has taken up a lot of hard disk space, and the hard disk is almost full, so it must be deleted. log. Whether it is system logs or website logs, they are sometimes useful. We can check website visits and analyze the frequency of crawlers on the website, but most of the time we will not check them.
So, as time accumulates, the logs will occupy more and more VPS host hard disk capacity, and we need to process them regularly. In the WDCP panel, whether we start the NGINX or APACHE environment, there are log files in the system, one is the error log and the other is the access log.
First, website log
We need to check the operation of the website. When adding a site, we can turn on the site's log.
If we need to enable the log of a certain site, we need to check it when adding the site or edit and re-check the existing site, so that the website will generate errors and access logs, and we can perform data analysis. At the same time, the log will appear in the /www/web_logs/ directory. Corresponding to the prefix of the domain name, we can see two files: laozuo.org_access_log and laozuo.org_error_log.
Second, system log
/www/wdlinux/nginx-1.0.15/logs/www/wdlinux/httpd-2.2.22/logs
In the above two directories, you will also see an error log and an access log.
For the above two parts of log files, we delete them according to their size. If they are not large, we do not want to delete them. Before deleting them, we need to stop the WEB operation first, close the WEB and MYSQL operations in the WDCP panel, and delete Log and then turn it on again.
For system logs, we can prohibit future generation. Generally, closing them will not have much impact. If we do not want to close them, we must check them regularly.
A – Nginx log closing method
sed -i \\’/log_format/aaccess_log off;\\’ /www/wdlinux/nginx/conf/nginx.conf
B – Apache log shutdown method
sed -i \\’s#CustomLog \\”logs/access_log\\” common#CustomLog /dev/null common#\\’ /www/wdlinux/apache/conf/httpd.conf
After closing the generation, we also need to restart NGINX or APACHE
A – Restart Nginx/etc/init.d/nginxd restart
B – Restart Apache/etc/init.d/httpd restart
In this way, we can completely solve the log occupation problem of the WDCP system. Finally, we use df -h to check whether the data on the hard disk has free space.
Recommended site searches: website registered domain name query, telecom hosting, Godaddy registered domain name, US anti-attack server, Korean independent server, US vps server, Alibaba Cloud domain name registration entrance, domain name space purchase, Hong Kong space, host server rental,
发表评论