Got a packet bigger than ‘max_allowed_packet’ bytes

October 1, 2009    |   Posted by admin   |    Category: cPanel Management, Linux Administration, Plesk Management

“Got a packet bigger than ‘max_allowed_packet’ bytes”

The message is displayed when you try to restore a database and the packet size if more than the default one OR the one defined in the my.cnf file.You can check the existing bytes with the following command

root@server [~]# mysqladmin variables | grep max_allowed_packet
| max_allowed_packet              | 1048576
|

To overcome the issue, add the following parameter in the my.cnf file

max_allowed_packet = 2097152

The value should be more than the default one. Save the file and restart the mysql service.

Comments Off on Got a packet bigger than ‘max_allowed_packet’ bytes

HowTo: retrieve email account passwords in Plesk?

September 27, 2009    |   Posted by admin   |    Category: Plesk Management

Plesk uses a database called ‘psa’ to save all the details about the domains, settings, users and their passwords in plain text. A person with root access to the server can easily retrieve email account passwords in a Plesk server from the Mysql prompt.

SSH to the server and connect to the Mysql server

# mysql -uadmin -p`cat /etc/psa/.psa.shadow`

At the mysql prompt, goto the ‘psa’ database which is used by Plesk.

mysql> use psa;

and execute the following command to retrieve passwords of all the email accounts on a domain

mysql> select mail_name, password from domains, mail, accounts where \
domains.name='domainname.com' and domains.id=mail.dom_id and \
mail.id=accounts.id;

where,
replace domainname.com with the actual domain name whose email account passwords you wish to retrieve.
domains, mail, accounts are the table names where different entries of an email account is stored.

Comments Off on HowTo: retrieve email account passwords in Plesk?

Failed domain creation: mailmng failed

September 22, 2009    |   Posted by admin   |    Category: Plesk Management

If you receive “virtual.db: No such file or directory” error message while adding a domain in Plesk control panel, you need to create the virtual.db file and place it in the proper location. The complete error message looks like:

Failed domain creation: Unable to update domain data: mailmng failed: Fatal error: plesk::mail::postfix::PostfixConfigurationError(postmap:fatal:open database /var/spool/postfix/plesk/virtual.db: No such file or directory)

You need to manually fix the problem:
#Create the virtual.db file
postmap /etc/postfix/virtual

#Copy the .db file to the location you see in the error message:
cp /etc/postfix/virtual.db /var/spool/postfix/plesk/virtual.db

This will allow you to add domains on your server.

Comments Off on Failed domain creation: mailmng failed

IP Access restriction policy in Plesk

September 20, 2009    |   Posted by admin   |    Category: Plesk Management

Plesk offers an IP restriction policy which allows an administrator to restrict Plesk panel access to certain IPs. If your IP is not in the allowed list, you will receive the following error message while accessing the Plesk control panel:

Error: Access for administrator from address ‘xx.xx.xx.xx’ is restricted in accordance with IP Access restriction policy currently applied.

In order to enable Plesk panel access to everyone, you need to access the ‘psa’ database by logging to your server as root.

#First connect to your mysql server:
mysql -uadmin -p`cat /etc/psa/.psa.shadow ` psa

#List the IPs those are allowed to access the Plesk control panel.
mysql> select * from cp_access;

#Check the default access policy
mysql> select * from misc where param=’access_policy’;

#To remove all the IPs from ‘cp_access’ table:
mysql> delete * from cp_access;

#To change the default access policy to “allow” by default:
mysql> update misc set val=”allow” where param=’access_policy’;

You will now be able to access Plesk from any location without any problems.

Comments Off on IP Access restriction policy in Plesk

Install SSL certificate for Plesk

September 18, 2009    |   Posted by admin   |    Category: Plesk Management

SwSoft install it’s own certificate during Plesk installation but because it’s a self-signed certificate it gives you a warning message while accessing Plesk control panel. If you wish, you can purchase your own SSL certificate and replace it with the default certificate.

Issue your new SSL certificate using the server hostname say ‘server.yourdomain.com’ and place it under the configuration directory of Plesk located at “/usr/local/psa/admin/conf/“.
The default certificate is named as “httpsd.pem”.
Name the new certificate as “httpsd-new.pem” and place it under the same configuration directory.
Edit the Plesk configuration file “httpsd.conf” and search for the following line:

SSLCertificateFile “/usr/local/psa/admin/conf/httpsd.pem”

replace it with

SSLCertificateFile “/usr/local/psa/admin/conf/httpsd-new.pem”

Save the file and restart the ‘psa’ service:

service psa stop
service psa start

Once done, access Plesk using the hostname as https://server.yourdomain.com:8443. This will make sure you won’t receive a warning message while accessing Plesk control panel.

Comments Off on Install SSL certificate for Plesk