Plesk error: SWKeyExFatalError Cannot open file

April 8, 2012    |   Posted by admin   |    Category: Plesk Management

 
Sometimes a Plesk upgrade may result in an “SWKeyExFatalError: Cannot open file” error while accessing the Plesk panel. The error message looks like

ERROR: SWKeyExFatalError
error: Cannot open file
----------------------------
0: common_func.php3:4537
of_get_key_by_product(string ‘plesk-unix’)
1: common_func.php3:4537
getPleskKey()
2: common_func.php3:4616
getKeyProp(string ‘demo’)
3: auth.php3:48

 
The SWKeyExFatalError error occurs when ownership of files/directories in /etc/sw/keys are incorrect.
The files and directories in /etc/sw/keys/ should be owned by psaadm:swkey-data except registry.xml.

# ls -la /etc/sw/keys
 drwxrws--- 2 psaadm swkey-data 4096 Mar 25 04:02 backup
 -rw-r--r-- 1 psaadm swkey-data 22 May 18 2010 info
 drwxrws--- 2 psaadm swkey-data 4096 Sep 15 2011 instances
 drwxrws--- 2 psaadm swkey-data 4096 Mar 25 04:02 keys
 drwxrws--- 2 psaadm swkey-data 4096 Sep 15 2011 lock
 -rw-rw---- 1 root swkey-data 7431 Apr 8 04:02 registry.xml
 drwxrws--- 2 psaadm swkey-data 4096 Sep 15 2011 restart

 
If the ownership of the files is not what you see above, correct them as follows:

# chown psaadm:swkey-data /etc/sw/keys -R
# chown root:swkey-data registry.xml

 
Next, restart the Plesk service and Plesk control panel should work.

# service psa restart

 
However, if the user ‘psaadm’ is not in the ‘swkey-data’ group, it is possible that the ownership of the files get reverted on restarting the Plesk service.

# id psaadm
 uid=501(psaadm) gid=501(psaadm) groups=501(psaadm),2522(psaserv)

 
As you can see above, the user psaadm is not in the group of swkey-data. You can also verify it as follows:

# grep swkey-data /etc/group
 swkey-data:x:502:

 
In such a case, edit the /etc/group file and add the psaadm user in swkey-data group. The line should look like follows:

swkey-data:x:502:psaadm

 
Save the file and verify the new settings

# id psaadm
uid=501(psaadm) gid=501(psaadm) groups=501(psaadm),502(swkey-data),
2522(psaserv)

 
Restart the Plesk service and the Plesk panel will work without problems.

Comments Off on Plesk error: SWKeyExFatalError Cannot open file

How to add a sub-domain in Plesk with www prefix?

September 17, 2011    |   Posted by admin   |    Category: Plesk Management

Generally, a sub-domain is not accessed using the www prefix i.e. you can access subdomain.domain.tld but not www.subdomain.domain.tld by default.

Solution:

To make a subdomain work with ‘www’ prefix on a Plesk server, you have to add a ServerAlias entry in the vhost configuration of the sub-domain and add an A record from Plesk.

Steps:

1. Create a vhost.conf file for the sub-domain

# cd /var/www/vhosts/domain.tld/subdomains/<sub-domain>/conf
# nano vhost.conf

and add a ServerAlias entry

ServerAlias www.subdomain.domain.tld

2. Add an ‘A’ record for the ‘www’ prefix of the sub-domain from
     Plesk -> Domains -> <domain.tld> -> DNS Settings -> Add Record

www.subdomain.domain.tld A 1.1.1.1

3. To apply the ServerAlias changes, run the websrvmng utility

# /usr/local/psa/admin/bin/websrvmng -a

4. Restart the webserver

# service httpd restart

Replace the subdomain/domain name and the 1.1.1.1 IP with the actual values.

Comments Off on How to add a sub-domain in Plesk with www prefix?

Webmail login error: Your Internet Address has changed since the beginning of your Mail session.

August 28, 2011    |   Posted by admin   |    Category: cPanel Management, Plesk Management

Sometimes you see the following error at the middle of your Webmail Horde session :

Your Internet Address has changed since the beginning of your Mail 
session. To protect your security, you must login again.

This error mostly occurs when the ISP is using proxy servers to filter the browsers content. The proxy server randomly change its IP address and thus cause you to fail the web mail security measures.

The solution is to turn off the ‘checkip’ parameter in the Horde’s configuration file.  The configuration file is located as follows:

cPanel server : /usr/local/cpanel/base/horde/config/conf.php
Plesk server  : /usr/share/psa-horde/config/conf.php

Edit the respective configuration file depending on the control panel you have and look for

$conf['auth']['checkip'] = true;

replace it with

$conf['auth']['checkip'] = false;

This is it. Please note, this is a server wide change and cannot be done on user basis.

Comments Off on Webmail login error: Your Internet Address has changed since the beginning of your Mail session.

Horde: there are no parts that can be displayed inline.

June 26, 2011    |   Posted by admin   |    Category: cPanel Management, Plesk Management

While accessing an email using Horde, you may notice that Horde isn’t displaying the contents of the email rather it displays the following message

there are no parts that can be displayed inline.

The reason for “no parts can be displayed inline” error is the “inline” setting of the Horde HTML driver is set as false.  To enable the setting, edit the mime_drivers.php file and set the “imp/html/inline” attribute to true.

On a cPanel server, the file is located at /usr/local/cpanel/base/horde/imp/config/mime_drivers.php and the attribute is:

$mime_drivers['imp']['html'] = array(  'inline' => false;

On a Plesk server, the file is located at /etc/psa-horde/imp/mime_drivers.php and the attribute is:

$mime_drivers['imp']['html']['inline'] = false;

Set the value as ‘true’ and save the file. Horde will display the contents properly again.

Comments Off on Horde: there are no parts that can be displayed inline.

How to install PHP-Json module on a Linux Plesk server?

May 20, 2011    |   Posted by admin   |    Category: Installations, Plesk Management

To install/enable Json support for PHP on a Linux Plesk server, follow the below steps:

1. Install php-pear and gcc

# yum install php-pear gcc

2. Install json module

# pecl install json

3. Now, the json.so file is created under the php lib directory i.e. /usr/lib64/php/modules/ and needs to be called in the json.ini so PHP configuration could read it.

# cd /etc/php.d 
# echo "extension=json.so" >> json.ini

4. Once done, restart the httpd service

# /etc/init.d/httpd restart

This is it.

However, the other way is to manually install the php-json module. Follow the below steps:

1. Download the json package

# wget http://pecl.php.net/get/json-1.2.0.tgz

2. Untar and goto the newly created directory

# tar -zxf json-1.2.0.tgz 
# cd json-1.2.0

3. Create the configuration files and configure json

# phpize 
# ./configure

4. Create the installation file and install it

# make 
# make install

Once done, json.so will be created in /usr/lib64/php/modules/ directory and needs to be called by the php configuration directory

# cd /etc/php.d 
# echo “extension=json.so” >> json.ini

Restart the httpd service and check the php-json module by executing

# php -m | grep json

Note:  The manual installation method can be used on a plain Linux server as well, just the extension need to be added in the php.ini file directly.

Comments Off on How to install PHP-Json module on a Linux Plesk server?