Posts Tagged ‘CLI’

Plesk remove chroot for domain

December 9th, 2011 Comments off

I haven’t found the way how to disable creating chroot-folders on webspace with new domain creation.

So, on Parallels forum support offered me to create Event manager handler.

Open Plesk -> Tools & Settings -> Event Manager -> Add New Event Handler

Fill the form:


Default domain (the first domain added to a subscription/webspace) created

highest (100)


/usr/local/psa/admin/sbin/chrootmng –remove –source=/var/www/vhosts/chroot –target=/var/www/vhosts/${NEW_DOMAIN_NAME}

This handler will remove chroot from newly created domain immediately.

Categories: Plesk Tags: , ,

Plesk disable quotas check during upgrade

November 24th, 2011 Comments off

You can disable it by setting the following environment variable prior to the installation
or upgrade:


Of course this will work only if you run the process in the same shell, thus, it can’t be
set for GUI upgrader.

KB Parallels: During an installation/upgrade file system quotas check takes way too much time, can I disable it?.

Categories: Plesk Tags: ,

PHP based torrent file creator, tracker and seed server – PHPTracker

September 16th, 2011 Comments off

Great software!

Why PHPTracker? Because it’s not “just a tracker”, it contains a seeder server too so the distribution of your files is automatic. This is a big step for the content providers to adapt this amazing technology and change the stereotype that “torrent = warez”.

PHP based torrent file creator, tracker and seed server – PHPTracker.

Categories: Linux, MySQL, PHP Tags: , , ,

Plesk: Real memory usage reported by ‘Server Health’ does not match actual RAM

August 29th, 2011 Comments off

Real memory usage reported by Plesk Health Monitoring Service (Home > Server Health > Memory) does not match RAM reported by utility ‘free‘.

RAM was updated after Parallels Plesk Panel was installed.
Plesk Health Monitor does not detect if the system configuration was changed after the initial installation.

The problem will be fixed in future update of Parallels Plesk Panel that will be released after version 10.2.

To workaround:

# /usr/local/psa/bin/sw-engine-pleskrun /usr/local/psa/admin/plib/scripts/setup-health-monitor.php
Categories: Linux, Plesk Tags: , ,

ffmpeg-php – error: ‘PIX_FMT_RGBA32’ undeclared (first use in this function)

August 24th, 2011 Comments off

ffmpeg-php – error: ‘PIX_FMT_RGBA32’ undeclared (first use in this function) | HOW GEEK!.

/root/install/ffmpeg-php-0.6.0/ffmpeg_frame.c: In function 'zim_ffmpeg_frame_toGDImage':
/root/install/ffmpeg-php-0.6.0/ffmpeg_frame.c:336: error: 'PIX_FMT_RGBA32' undeclared (first use in this function)
/root/install/ffmpeg-php-0.6.0/ffmpeg_frame.c:336: error: (Each undeclared identifier is reported only once
/root/install/ffmpeg-php-0.6.0/ffmpeg_frame.c:336: error: for each function it appears in.)
/root/install/ffmpeg-php-0.6.0/ffmpeg_frame.c: In function 'zim_ffmpeg_frame_ffmpeg_frame':
/root/install/ffmpeg-php-0.6.0/ffmpeg_frame.c:421: error: 'PIX_FMT_RGBA32' undeclared (first use in this function)
make: *** [ffmpeg_frame.lo] Error 1

To fix this, replace PIX_FMT_RGBA32 with PIX_FMT_RGB32 .

You can use “rpl” to replace files recursively:

cd to the ffmpeg-php folder and run this command (beware!):


If rpl not installed on your system, install it, for example:

yum install rpl
Categories: Linux, PHP Tags: , ,

Plesk FTP account passwords

May 5th, 2011 Comments off

Open phpMyAdmin or mysql command line client, choose database pma and execute query:

USE psa;
SELECT REPLACE( sys_users.home, '/var/www/vhosts/', '' ) AS domain, sys_users.login, accounts.password
FROM sys_users
LEFT JOIN accounts ON sys_users.account_id =
ORDER BY sys_users.home ASC

It will show you all FTP users from Plesk

Categories: MySQL, Plesk Tags: , , ,

Linux upgrade from i386/i686 to x86_64

April 1st, 2011 1 comment

This article describes upgrade CentOS 5.5 from i386 arch to x86_64 arch.

First of all, upgrade kernel and boot loader from CD. For my system this operation was done by hosting provider.

After kernel upgrade system have a lot of i386/i686 packages. It isn’t possible to upgrade each package manually. For example, my CentOS had 300+ packages.

To continue you need to install yum

The algorithm of upgrading is simple:

  1. install for each i386/i686 package its x86_64 analogue
  2. erase i386/i686 packages

But it can be complicated, because any packages uses the same paths or something else and you need manually to install RPMs.

Let’s begin.

Install yum plugin yum-downloadonly:

yum install yum-allowdowngrade

Then take a list of packages for upgrade:

rpm -qa --qf "%{name}.%{arch}\n" | grep -E "i386|i686"

Copy this list into your text editor and replace “.i386” and “.i686” with “.x86_64”. Also replace all returns with spaces. You will take something like this:

glibc.x86_64 readline.x86_64 ncurses.x86_64

Now download this packages RPMs:

yum install --downloadonly --downloaddir=/root/rpms/ <packages>

where <packages> are in my example glibc.x86_64 readline.x86_64 ncurses.x86_64

Of course directory/root/rpms/ must exist.

When yum finishes to download hundreds of packets, chdir to /root/rpms/ and execute

rpm -i --force *.rpm

rpm will force installation of all downloaded packages.

After installation you need come back to your i386/i686 packages list and uninstall them.

yum erase <packages>

where <packages> are in my example glibc.i686 readline.i386 ncurses.i386

That’s all!

Categories: Linux, Plesk Tags: , ,

Proftpd passive mode hangs or works slow

February 9th, 2011 Comments off

There is 2 steps.

First of all, add to /etc/proftpd.include followed code:

TimeoutIdle                 900
TimeoutNoTransfer           900
PassivePorts                49152 65534
TimesGMT                    Off

Then test the iptables nat helper:

modprobe ip_conntrack_ftp

If there is no errors, add to directive IPTABLES_MODULES in /etc/sysconfig/iptables-config module ip_conntrack_ftp:


If you need to load two or more helpers, separate them with spaces because the iptables script does a for-in on the IPTABLES_MODULES directive.

Categories: Linux, Plesk Tags: , , , ,

Plesk: Premature end of script headers OR cgi_wrapper target uid/gid mismatch (500 Internal server error)

January 24th, 2011 1 comment

When you have a newly installed Plesk, it’s not enought to run PHP-scripts in CGI. Unfortunately.

You need manually copy suexec file from Plesk binaries file folder to system binaries folder.

In common cases it does command:

# cp /usr/local/psa/suexec/psa-suexec /usr/sbin/suexec

If cp cannot find any of files, search they manually

# locate suexec

Important! It’s recommended to make a copy of system’s suexec file

# cp /usr/sbin/suexec /usr/sbin/suexec_old
Categories: Linux, Plesk Tags: , , , ,

Parallels small business panel. How to disable mail for domain

December 19th, 2010 1 comment

I’ve needed to allow for my domain only hosting without mail service. Mail server will be remote. I’ve changed MX-records to remote server IP (or hostname), but it’s not enough. Also this domain must be removed from mail daemon (Qmail, Postfix or other) config files.

There is no possibility to disable mail service for domain via Small business panel. You can only do it via command line.

#/usr/local/psa/bin/domain -u <domain> -mail_service false

Additionally, if you want to set option “What to do with mail sent to nonexistent users” to “Forward to address”, you need than manually edit


with command

postmap -d @<domain> hash:virtual
Categories: Mail, Plesk Tags: ,