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

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 cannot access www.subdomain.domain.tld by default. 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.

Solution:

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

# nano /var/www/vhosts/domain.tld/subdomains/<sub-domain>/conf/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.

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

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.

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

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 is the “inline” setting of the HTML driver is set to false. To fix the issue, you need to enable i.e. change false to true for  “imp/html/inline” attribute in the Horde’s mime_drivers.php file.

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

$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 as:

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

Once you change the attribute to ‘true’, save the file and Horde will start displaying the contents of the email.

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

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 install the php-json module manually. 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.

Plesk StatInfo-> getProductVersion failed: file_get_contents () failed

Posted by admin     Category: Plesk Management

While accessing the Plesk control panel, you may encounter an error message as follows:

ERROR: PleskFatalException StatInfo-> getProductVersion failed
OR
ERROR: PleskFatalException
StatInfo-> getProductVersion failed: file_get_contents () failed:
mktime() [<a href='function.mktime'>function.mktime</a>]

The error indicates that the file /usr/local/psa/version which contains the Plesk version is empty AND/OR the plesk version in the ‘psa.misc’ table is incorrect. This is mostly caused due to a Plesk upgrade OR by removing/installing some Plesk modules.

To fix the issue do the following:

1. First, check the Plesk version installed on the server

# rpm -qi psa

note down the ‘version’ and ‘release’ values (these values will be different on your server).

Version     : 9.5.3
Release     : cos5.build95301122.20

now, check the OS installed on the server (for example, on CentOS)

# cat /etc/redhat-release
CentOS release 5.5 (Final)

Using the above Plesk and OS info, insert a line as follows (your values will differ) in the /usr/local/psa/version file.

9.5.3 CentOS 5 95301122.20

Save the file and restart the psa serivce. If this doesn’t fix the issue, goto step 2.

2. First check the current value of  Plesk in the psa.misc table.

mysql> select * from psa.misc where param='version';

If the value is not 0953 (example from my server), run the mysql update query to set the proper value. You should use the value that is returned by the ‘rpm -qi psa’  command on your server.

mysql> update psa.misc set val="0953" where param="version";

Exit and restart mysql. That is it.