Category Archives: Parallels Plesk

Odin (Parallels Plesk) – Calculate Statistics Manually Command Line

Recently I had to clean up my Odin (Parallels Plesk) Server. After cleaning up I noticed that the statistics weren’t accurate  (file usage, backup capacity, etc.). In order to ensure that my cleanup work was successful I had to manually run the following command:

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

You can read more at the official Odin site: How to recalculate statistics for a particular domain

 

Parallels Plesk Postfix Mail Queue Spam Issue

Over the weekend I noticed that SMTP traffic on one of the domains I host was sending an abnormal amount of SMTP traffic. In Parallels Plesk the Postfix Mail Queue showed upwards of 65,000 emails stuck in the queue. This was especially alarming because the domain does not have any email accounts. Based on the domain traffic activity report within Plesk it was clear that the emails were coming from domain.com.

I spent some time searching the internet and found a few very valuable pieces of information:

I should also mention that Plesk 12 has a new feature which allows you to set limits on outgoing mail flow. The first step I took was to restrict mail flow for domain.com. You can control mail flow at the following levels from within the Plesk Control Panel; Default per Mailbox, Default per Domain, Default per Subscription.

Here are the steps I took to resolve the Postfix Spam problem:

Step 1) I set the outgoing mail flow to 0 for the domain in question. I then ran some of the built in Plesk tools such as Watchdog security scan. Watchdog threw a couple of warnings but there weren’t any issues other than normal alerts (SSH enabled, root access, etc.).

Step 2) In PHP 5.3.0. developers created a brilliant way to track emails sent via PHP scripts. In order to use this new feature you have to create a log file for PHP to write to:

  • Create log file
    touch /var/log/php-mail.log
    
  • Change permissions of log file
    chmod 777 /var/log/php-mail.log
    

Step 3) Once you create the log file and change the permissions for PHP you need to log into Parallels Plesk and modify the PHP settings: (specific to the domain in question)

  • Modify PHP settings for suspect domain
    • Added the following entries
      add_x_header = On
      mail.log = /var/log/phpmail.log
      

Parallels Plesk PHP parameters (domain specific)

Step 4) After a short period of time (less that a minute) the log file began to fill with data:

mail() on [/var/www/vhosts/domain.com/httpdocs/drupal_dev/modules/taxonomy/ini.php:1]: To: [email protected] -- Headers: From: "Molly Weiss" <[email protected]>  Reply-To:"Molly Weiss" <[email protected]>  X-Priority: 3 (Normal)  MIME-Version: 1.0  Content-Type: text/html; charset="iso-8859-1"  Content-Transfer-Encoding: 8bit
mail() on [/var/www/vhosts/domain.com/httpdocs/drupal_dev/modules/taxonomy/ini.php:1]: To: [email protected] -- Headers: From: "Molly Weiss" <[email protected]>  Reply-To:"Molly Weiss" <[email protected]>  X-Priority: 3 (Normal)  MIME-Version: 1.0  Content-Type: text/html; charset="iso-8859-1"  Content-Transfer-Encoding: 8bit
mail() on [/var/www/vhosts/domain.com/httpdocs/drupal_dev/modules/taxonomy/ini.php:1]: To: [email protected] -- Headers: From: "Molly Weiss" <[email protected]>  Reply-To:"Molly Weiss" <[email protected]>  X-Priority: 3 (Normal)  MIME-Version: 1.0  Content-Type: text/html; charset="iso-8859-1"  Content-Transfer-Encoding: 8bit
mail() on [/var/www/vhosts/domain.com/httpdocs/drupal_dev/modules/taxonomy/ini.php:1]: To: [email protected] -- Headers: From: "Molly Weiss" <[email protected]>  Reply-To:"Molly Weiss" <[email protected]>  X-Priority: 3 (Normal)  MIME-Version: 1.0  Content-Type: text/html; charset="iso-8859-1"  Content-Transfer-Encoding: 8bit
mail() on [/var/www/vhosts/domain.com/httpdocs/drupal_dev/modules/taxonomy/ini.php:1]: To: [email protected] -- Headers: From: "Molly Weiss" <[email protected]>  Reply-To:"Molly Weiss" <[email protected]>  X-Priority: 3 (Normal)  MIME-Version: 1.0  Content-Type: text/html; charset="iso-8859-1"  Content-Transfer-Encoding: 8bit
mail() on [/var/www/vhosts/domain.com/httpdocs/drupal_dev/modules/taxonomy/ini.php:1]: To: [email protected] -- Headers: From: "Molly Weiss" <[email protected]>  Reply-To:"Molly Weiss" <[email protected]>  X-Priority: 3 (Normal)  MIME-Version: 1.0  Content-Type: text/html; charset="iso-8859-1"  Content-Transfer-Encoding: 8bit
mail() on [/var/www/vhosts/domain.com/httpdocs/drupal_dev/modules/taxonomy/ini.php:1]: To: [email protected] -- Headers: From: "Molly Weiss" <[email protected]>  Reply-To:"Molly Weiss" <[email protected]>  X-Priority: 3 (Normal)  MIME-Version: 1.0  Content-Type: text/html; charset="iso-8859-1"  Content-Transfer-Encoding: 8bit
mail() on [/var/www/vhosts/domain.com/httpdocs/drupal_dev/modules/taxonomy/ini.php:1]: To: [email protected] -- Headers: From: "Molly Weiss" <[email protected]>  Reply-To:"Molly Weiss" <[email protected]>  X-Priority: 3 (Normal)  MIME-Version: 1.0  Content-Type: text/html; charset="iso-8859-1"  Content-Transfer-Encoding: 8bit
mail() on [/var/www/vhosts/domain.com/httpdocs/drupal_dev/modules/taxonomy/ini.php:1]: To: [email protected] -- Headers: From: "Molly Weiss" <[email protected]>  Reply-To:"Molly Weiss" <[email protected]>  X-Priority: 3 (Normal)  MIME-Version: 1.0  Content-Type: text/html; charset="iso-8859-1"  Content-Transfer-Encoding: 8bit
mail() on [/var/www/vhosts/domain.com/httpdocs/drupal_dev/modules/taxonomy/ini.php:1]: To: [email protected] -- Headers: From: "Molly Weiss" <[email protected]>  Reply-To:"Molly Weiss" <[email protected]>  X-Priority: 3 (Normal)  MIME-Version: 1.0  Content-Type: text/html; charset="iso-8859-1"  Content-Transfer-Encoding: 8bit

Based on the data I was able to identify the following file: /var/www/vhosts/domain.com/httpdocs/drupal_dev/modules/taxonomy/ini.php. This file was embedded within the suspect domains website directory. I am not totally sure how it got there but my guess is through an exploit in Drupal or an incorrect permission as I was developing a new website in Drupal.

I moved the file to a different directory, changed its permissions and downloaded it from the server for further investigation. Since the removal of this file there have been no further issues with the domain sending spam.

Due to this issue I have changed all passwords. Depending on what I find I may even look at an entire rebuild however I don’t believe it is required.

If you have had any similar issues please share or if you think missed something please let me know.

Large Parallels Plesk log files – Reduce Parallels Plesk log file size

Recently I ran into an issue with Paralles Plesk 11 for UNIX/Linux where log files for a specific virtual host took up a larger than normal amount of space. In Parallels Plesk 11 you can actually modifying log file settings through the Control Panel GUI.

The below are examples of some of the log files in Parallels Plesk 11 which grew large in size, approximately 200 MB each which chewed through hosting space.

/var/www/vhosts/<domain>/statistics/logs
/var/www/vhosts/<domain>/statistics/logs/access_log
/var/www/vhosts/<domain>/statistics/logs/error_log

Through GOOGLE I was able to fine the solution however it was not so easy to find. Below is s short guide to modify the Parallels Plesk 11 log files (may also be referred to log rotation)

Open Parallels Control Panel > Select Websites & Domains > Show Advanced Options > Select Logs > Under Tools select Log Rotation > Modify Log settings as required, click Ok or Cancel

Parallels Plesk Migration 9 to 10

So I had some fun trying to migrate from Parallels Plesk 9.5.x to 10.0.x (UNIX based system). It took me some time but after finding the documentation the process was actually very smooth, however unlike other new releases I found this documentation much harder to find.

Anyhow I had to move my Parallels Plesk 9.5.x VDS (Virtual Dedicated Server) to my new Parallels Plesk 10.0.x VDS (Virtual Dedicated Server). I bought my VDS systems through Go Daddy and renew yearly. Go Daddy does not allow root access to their VDS systems so doing a migration from the Parallels Plesk Control Panel was not an option – although Go Daddy has a KB article which allows you to modify the SUDO (super users list – UNIX based systems) which didn’t work for me.

Thanks to GOOGLE and after several hours I found some documentation which instructs a user to convert a Plesk 9.xdata backup to Plesk 10.0.x compatible backup: Parallels Plesk KB Article. Once I read this article the process went very smooth. The reason I had problems until stumbling across this article was that there is/was no documentation at the time telling me I could not restore a Plesk 9.x backup to a Plesk 10.x backup.

Parallels Plesk Partitioning… Partition Guide

Hi there,

I have been using Parallels Plesk formally Plesk  (SWOSFT) since version 7.5. The software is great, I am running it on Linux and my host OS (operating system) is Cent OS 5.x.  Partitioing Plesk is very easy, by default all hosted accounts are configured in /www/var/vhosts. This is the path where websites will be hosted.

You will see that I used Logical Volumes, that way if I need to increase or decrease space for a particular partition I can. When I partition my drive(s) I will make set up the following structure: (this setup was done a 100GB Virtual Machine)

/boot     200MB
Logical Volume     Max partition size
swap     double physical memory (LVM)
/root     25000MB or 25GB (LVM)
/var      75000MB or 75GB (LVM)

Once the system is created your drive will look as follows:

[[email protected] ~]$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol01
24G  6.2G   17G  28% /
/dev/mapper/VolGroup00-LogVol02
72G  418M   68G   1% /var
/dev/sda1             190M   12M  169M   7% /boot

If you have any questions or comments please let me know! The following link will take you to Parallels Plesk Partitioning knowledge base document Plesk Partitioning. The document is very straight forward and easy to read.

[ad#google-468×60]