qmail-inject: fatal: mail server permanently rejected message

Posted by admin     Category: Plesk Management

You see the “qmail-inject: fatal: mail server permanently rejected message” error message while sending emails from a Plesk server and the error message such as follows in the mail logs:

qmail-queue-handlers[xxxx]: Unable to change group ID: Operation not permitted
qmail-queue[xxxx]: files: write buf 0xbff4dfe0[156] to fd (5) error – (32) Broken pipe
qmail-queue[xxxx]: files: cannot write chuck from 4 to 5 – (32) Broken pipe

It is due to the incorrect permission/ownership of the ‘qmail-queue’ file under the “/var/qmail/bin” directory. Make sure
the ownership is ”mhandlers-user:popuser’
the permission is 2511.

Check the current ownership/permission:

# ls -la /var/qmail/bin/qmail-queue

It should be as follows:

-r-x–s–x  1 mhandlers-user popuser 67804 May  4 08:41 /var/qmail/bin/qmail-queue

If not, correct the ownership

# chown mhandlers-user.popuser /var/qmail/bin/qmail-queue

set the proper permissions,

# chmod 2511 /var/qmail/bin/qmail-queue

Restart Qmail once and see if the email works.

Note: If the emails still doesn’t work, please comment this post with the error message and the output of the following command and I will find out the solution for you:

ls -la /var/qmail/bin/qmail-queue*

PleskFatalException Unable to connect to database

Posted by admin     Category: Plesk Management

When a Plesk server exceeds the allotted Mysql connections, you will see the “Mysql: Too many connections” error message while accessing the Plesk control panel instead of the login prompt. The temporary solution is to restart the Mysql service, and the permanent solution is to increase the “max_connections”.

ERROR: PleskFatalException
Unable to connect to database: mysql_connect() : Too many connections
0: /usr/local/psa/admin/plib/common_func.php3:190
psaerror(string ‘Unable to connect to database: mysql_connect() Too many connections’)

To resolve the “Mysql: Too many connections” issue, ssh to your server as root and restart the Mysql service

# /etc/init.d/mysqld restart

If the problem occurs quite frequently, you need to increase the “max_connections” on your server. First check the number max_connections set on your server

# mysqladmin variables -uadmin -p`cat /etc/psa/.psa.shadow` | grep max_connections

To increase the max_connections, edit the Mysql configuration file my.cnf

# vi /etc/my.cnf

and set the following parameter

max_connections = xxx

where, xxx is the number of connections you wish to set.

Save the file and restart the Mysql service for the changes to take affect:

# /etc/init.d/mysqld restart

Unable to install the psa-migration-manager: db4 error

Posted by admin     Category: Plesk Management

You may receive the “Unable to install the psa-migration-manager” error message while installing Plesk. It is down to the incomplete db4 packages which provides embedded database support for various applications.

ERROR: Unable to install the “psa-migration-manager-x.x.x-cos5.build86080930.03.x86_64 package. Packages “db4-4.3.29-9.fc6.x86_64″ and “db4-4.3.29-10.el5.x86_64″ cannot be installed at the same time.


Solution:

Check if db4 packages are installed. You can list the db4 packages by:

# rpm -qa | grep db4

If the db4-devel and db4-utils are not listed above, install the packages using yum

# yum install db4-utils
# yum install db4-devel

Once done, start the Plesk installation again and psa-migration-manager will be installed successfully.

How to install SuPHP/phpSuExec on Plesk?

Posted by admin     Category: Plesk Management
How to install SuPHP/phpSuExec on a Plesk server?

SuPHP Or PHPSuExec is a module that increases the security of the server and executes PHP files under the ownership of the owner of the file instead of the Apache user i.e. “apache”.

The advantages of having suPHP are:

1. Files and Directories those need 777 permissions to write into, via the browser will now need a maximum of 755 permissions. The files/directories with 777 permissions will result in an “Internal Server Error”.

2. If you need to manipulate the value of a php directive for a domain, for ex. register_globals, it needs to be placed in the php.ini of a domain instead of the .htaccess file as it will result in an “Internal Server Error”.

3. All the files and directories uploaded using a script will have the ownership of the user instead of user ‘apache’ (i.e. the Apache user).

4. A user can edit/remove the files using Ftp that are uploaded via the browser.

In order to install SuPHP on the server, download and install the atomic script

# wget -q -O - http://www.atomicorp.com/installers/atomic | sh

Once the script is installed, install SuPHP module using yum

# yum install mod_suphp

The next step is to load the SuPHP module with Apache. The suphp installation automatically creates a “suphp.conf” file under the Apache configuration directory, if not create it.

# vi /etc/httpd/conf.d/suphp.conf

and insert the following lines:

#Load the Mod_SuPHP module
LoadModule suphp_module modules/mod_suphp.so
php_admin_value engine off
# Enable handlers
suPHP_AddHandler x-httpd-php
AddHandler x-httpd-php .php .php3 .php4 .php5
#Enable the SuPHP engine
suPHP_Engine on

Apache calls all the configuration files from the /etc/httpd/conf.d directory by default so there is no need to include the module in the httpd.conf file separately.

Now,  configuration file under /etc should be present (if not create it)

vi /etc/suphp.conf

copy/paste the following contents as it is:

[global]
logfile=/var/log/suphp.log
loglevel=info
webserver_user=apache
docroot=/var/www/vhosts
allow_file_group_writeable=false
allow_file_others_writeable=false
allow_directory_group_writeable=false
allow_directory_others_writeable=false
check_vhost_docroot=false
errors_to_browser=false
env_path=/bin:/usr/bin
umask=0022
min_uid=500
min_gid=500

[handlers]
x-httpd-php="php:/usr/bin/php-cgi"
x-suphp-cgi="execute:!self"

Make sure the “handle_userdir” directive is commented or removed from the file since it is deprecated from the latest version.

At the end, we have to restart the httpd service for all these changes to take effect

# service httpd restart

Test the SuPHP installation: Create a phpinfo.php file with 777 permission and it should show you an “Internal Server Error” on browsing.

Related Links:
How to install/enable SuPHP on a cPanel server?

Failed domain creation: Unable to update domain data

Posted by admin     Category: Plesk Management

You may come across the “Failed domain creation” error message while adding a domain from the Plesk control panel.

Failed domain creation: Unable to update domain data: Failed setting of domain parameters: Cannot change Webmail on domain: webmail
0: DomainPropertiesUIPointer.php:267
DomainPropertiesUIPointer->accessItem_create(string ‘POST’)
1: DomainPropertiesUIPointer.php:59
DomainPropertiesUIPointer->accessItem(string ‘POST’, NULL null)
2: UIPointer.php:596
UIPointer->access(string ‘POST’)
3: plesk.php:38

The fix provided across the internet is to install the psa-hotfix3 but it doesn’t work. In order to resolve the Plesk domain creation issue, run the autoinstaller in order to upgrade the installed components. The autoinstaller is use to install the new components offered by Plesk OR to upgrade the existing ones.

/usr/local/psa/admin/sbin/autoinstaller –select-release-current –upgrade-installed-components –debug