How to Remove Websties Log Files in Plesk

Website log files are getting bigger and bigger as the website runs day by day, it may cause errors. I will show you how to remove log files in Plesk.

There are several kinds of log files, .gz , .webstat , .processed log files can be removed safely by using the following command:

#rm -rf /var/www/vhosts/system/

Main website log files (access_log, error_log) should be cleared with the following command, removing main log files may possibly lead to incorrect functionality of Apache and nginx.

#cat /dev/null >/var/www/vhosts/

According to the Plesk official documents, different types of logs are recorded in different files, here is a list of log files types:

  • access_log. This log records all HTTP requests processed by the web server.
  • access_ssl_log. This log records all HTTPS requests processed by the web server.
  • error_log. This log contains diagnostic information. It also records any errors that the web server encounters in processing requests.
  • proxy_access_log. This log records all HTTP requests processed by the proxy web server.
  • proxy_access_ssl_log. This log records all HTTPS requests processed by the proxy web server.
  • proxy_error_log. This log contains diagnostic information. It also records any errors that the proxy web server encounters in processing requests.

Manual Installation of Plesk for Linux

We usually use one-click-installer to install Plesk automatically, it’s straightforward and what you need to do is waiting. However, you also can install Plesk manually and get more options during the installation.

Like one-click-installer, you need to download the installer first and then add execution permission to it.

chmod +x plesk-installer

Option 1: Install pervious version of Plesk

./plesk-installer --all-versions

By default, one-click-installer installs the latest stable version for you, you can add –all-versions to install previous versions or testing versions manually. Based on the Operating System, Plesk will show you a list of available versions for you.

plesk all versions

Options 2: Install Plesk from web interface

Before the installation, make sure that port 8447 is not blocked by firewall and you could access it.

./plesk-installer --web-interface

Run the command above and you will be prompted to open https://ip-address:8447/ in your browser. The web interface installation is now ready and sign in with “root” user and its password, all the operations can be done in browser.

If you want to install previous version of Plesk in web interface, just combine the two arguments.

./plesk-installer --all-versions --web-interface

How to Enable GeoIP Plugin for Awstats in Plesk

By default, Awstats doesn’t show countries visitors are visiting from, but there is a plugin called GeoIP could do it. In this tutorial, I will show you how to enable GeoIP plugin for Awstats in Plesk control panel. If you are not using Plesk, it’s OK, the steps are more or less the same, the only difference is you have to setup a cron job instead of adding a scheduled task. Scheduled tasks, which was a component of Plesk control panel, is a GUI tool for web masters to manage cron job easily and flexibly.


First, install required perl modules (Geo::IP), take CentOS for example.

yum install GeoIP GeoIP-data GeoIP-devel

Second, download GeoIP database, and store it in local directory (you can store in any directory as you want).

cd /var/www/vhosts/
gzip -d GeoLiteCity.dat.gz

Edit Awstats Configuration Files

The main configuration files are /etc/awstats/awstats.comf and /etc/awstats/awstats.model.conf, all the changes you made will only be effected to the new websites. If you have websites which had awstats enabled, you can find configuration files for existing websites in /usr/local/psa/etc/awstats/.

Enable GeoIP by uncommenting a line looks like LoadPlugin=”geoip GEOIP_STANDARD /pathto/GeoIP.dat” in the configuration file, place “/pathto/GeoIP.dat” with the your own path where you stored the GeoIP you downloaded in previous. The following line is what I configured in my awstats configuration file.

LoadPlugin="geoip GEOIP_STANDARD /var/www/vhosts/"

Update awstats and you can see the countries information your visitors are visiting from. By default, Awstats will be updated everyday, if you want to update Awstats in real-time, just add a scheduled task.

How to Change Awstats Update Frequency on Plesk Panel

Awstats is a powerful statistics tool and it is a built-in component on plesk panel, you can active awstats by choosing it at website settings. By default, plesk update awstats everyday, you have to wait for 24 hours before awstats generate the graphic results. In this tutorial, I will show you how to update awstats hourly in two steps.

Log onto the Plesk control panel and navigate to “Tools & Settings”–>”Scheduled Tasks”, add a task by clicking “Add Task” button.

Choose “Run a command” for Task Type option.

Fill in the “Command” blank with /usr/local/psa/admin/sbin/statistics

The command above will update all websites, it may consumes a lot of server resources. You can assign a website in the command, please replace with your own domain.

/usr/local/psa/admin/sbin/statistics --calculate-one

Then set the frequency, description, notification, and make sure the “Active” option is selected on the top.

Here is a screenshot.

Now, awstats will be updated hourly.

There is a tutorial online suggesting move file ‘awstats’ in /etc/cron.daily/ to /etc/cron.hourly/, I’ve tried but it didn’t work. I asked Plesk Support on twitter and they suggest me to set up a cron job to implement this task.