Plesk won’t start or gives 500 error

0

Plesk wont start or gives 500 error on loading in browser.

service sw-cp-server start

The status will be failed

Starting SWsoft control panels server… stale pidfile. [FAILED]

Check the Plesk error log /var/log/sw-cp-server/error_log.

tail -f /var/log/sw-cp-server/error_log

2013-06-26 20:51:20: (network.c.371) can’t bind to port: 127.0.0.1 10001 Address already in use
2013-06-26 20:53:45: (log.c.166) server started
2013-06-26 20:53:45: (network.c.371) can’t bind to port: 127.0.0.1 10001 Address already in use
2013-06-26 20:53:45: (log.c.166) server started
2013-06-26 20:53:45: (network.c.371) can’t bind to port: 127.0.0.1 10001 Address already in use
2013-06-26 20:53:50: (log.c.166) server started
2013-06-26 20:53:50: (network.c.371) can’t bind to port: 127.0.0.1 10001 Address already in use

Check what is open on port 10001.

lsof -i tcp:10001

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
sw-cp-ser 14726 sw-cp-server 5u IPv4 4145375026 0t0 TCP localhost:scp-config (LISTEN)

Stop The Plesk service.
service sw-cp-server stop

Stoppping SWsoft control panels server… not running. [ OK ]

Remove the Plesk PID.
rm -rf /var/run/sw-cp-server.pid

Check if the Plesk process is still running.

# ps ax | grep sw-cp-server | grep -v grep
14726 ? S 0:00 /usr/sbin/sw-cp-serverd -f /etc/sw-cp-server/config

Kill the process.
ps ax | grep sw-cp-server | grep -v grep | xargs kill -9

Start Plesk.
service sw-cp-server start

Advertisements

Find email account password in Plesk

5

Find email account password in Plesk

1) To find the mail account information.

root@[# /usr/local/psa/bin/mail –info email@domain.com

Example :

Mailname: username
Domain: domain.com
Mailbox: true
Password: password
Password type: plain
Mbox quota: Unlimited
Mailgroup: false
Attachment files:
Autoresponders: Disabled
Antivirus mail checking: Disabled

SUCCESS: Gathering information for ’email@domain.com’ complete

2) To find the email account passwords for a domain

root@[#] /usr/local/psa/admin/bin/mail_auth_view | grep domain.com

| email@domain.com | | password |

3) The below command will list passwords for all email accounts in plesk.

root@server[#] /usr/local/psa/admin/bin/mail_auth_view
OR

root@[#]mysql -uadmin -p` cat /etc/psa/.psa.shadow` -Dpsa -e”select mail_name,name,password from mail left join domains on mail.dom_id = domains.id inner join accounts where mail.account_id = accounts.id;”
——————————————————>

Mail server doesn’t work

1

How to repair mail server configuration?

Use mchk utility to repair/rebuild mail server configuration and restore settings for all mailboxes created in Plesk Panel.

For Linux:

~[# /usr/local/psa/admin/sbin/mchk –help

Usage: /usr/local/psa/admin/sbin/mchk [OPTION]

OPTIONS:
–without-spam restore all settings except for SpamAssassin configuration
–with-spam restore all settings
–spam-only restore only SpamAssassin settings

~[# /usr/local/psa/admin/sbin/mchk –with-spam

For Windows:

Warning! Only settings that were applied to mailboxes through Parallels Plesk Panel interface or command-line utilities will be restored by mchk. Any custom configuration options, applied by other means (e.g. through mail server’s configuration console), will be lost.

C:\>”%plesk_bin%\mchk” –help
usage: mchk [options] …

–help
–all [–fix=all|local]
–domain –domain-name= [–fix=local]
–domains –domain-names=| [–via-file] [–fix=local]
–all-domains [–fix=local]
–global-settings

[C:\>”%plesk_bin%\mchk” –all
———————————–>

Install PHP.5.3 + APC on Plesk Linux

0

Install PHP 5.3 + APC on Plesk Linux

Installing atomic repo on the server, may be the apc rpm is not available in Plesk repo

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

yum install php-pear httpd-devel pcre-devel
yum install gcc
pecl install apc

Build process completed successfully
Installing ‘/usr/include/php/ext/apc/apc_serializer.h’
Installing ‘/usr/lib64/php/modules/apc.so’
install ok: channel://pecl.php.net/APC-3.1.13
configuration option “php_ini” is not set to php.ini location
You should add “extension=apc.so” to php.ini
—————————-

To check the php version

[]# php -v
PHP 5.3.25 (cli) (built: May 12 2013 16:33:12)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
with the ionCube PHP Loader v4.2.2, Copyright (c) 2002-2012, by ionCube Ltd.
——————————–>

To check the apc modules in the server

———-
[root@vps-1130388-16019 ~# php -m | grep apc
apc
———-
[]# php -r “phpinfo();” | grep apc
Additional .ini files parsed => /etc/php.d/apc.ini,
apc
MMAP File Mask => /tmp/apc.XXXXXX
apc.cache_by_default => On => On
apc.canonicalize => Off => Off
apc.coredump_unmap => Off => Off
apc.enable_cli => Off => Off
apc.enabled => On => On
apc.file_md5 => Off => Off
apc.file_update_protection => 2 => 2
apc.filters => no value => no value
apc.gc_ttl => 3600 => 3600
apc.include_once_override => Off => Off
apc.lazy_classes => Off => Off
apc.lazy_functions => Off => Off
apc.max_file_size => 1M => 1M
apc.mmap_file_mask => /tmp/apc.XXXXXX => /tmp/apc.XXXXXX
apc.num_files_hint => 1024 => 1024
apc.preload_path => no value => no value
apc.report_autofilter => Off => Off
apc.rfc1867 => Off => Off
apc.rfc1867_freq => 0 => 0
apc.rfc1867_name => APC_UPLOAD_PROGRESS => APC_UPLOAD_PROGRESS
apc.rfc1867_prefix => upload_ => upload_
apc.rfc1867_ttl => 3600 => 3600
apc.serializer => default => default
apc.shm_segments => 1 => 1
apc.shm_size => 64M => 64M
apc.slam_defense => On => On
apc.stat => On => On
apc.stat_ctime => Off => Off
apc.ttl => 7200 => 7200
apc.use_request_time => On => On
apc.user_entries_hint => 4096 => 4096
apc.user_ttl => 7200 => 7200
apc.write_lock => On => On
——————————–>

Plesk Backup options using command line

1

Plesk Backup options using command line.

To keep the copy of backups of each Domain, Clients, Resellers, Mails, Database and configuration settings are very essential.

Before, we get start lets understand the basic Backup logical structure in Plesk. All backup created by Plesk by default stored under Plesk backup repository located on Plesk server:

For Plesk Linux/Unix, repository location:

/var/lib/psa/dumps/
specified by the DUMP_D variable defined in the /etc/psa/psa.conf configuration file.
For example:
grep DUMP_D /etc/psa/psa.conf
# Backups directory
DUMP_D /var/lib/psa/dumps

For Plesk Windows, repository is located in the %plesk_dir%\Backup\ folder, where %plesk_dir% is environment variable specifying directory where Plesk is installed (if installed to default locations, it is “C:\ProgramFiles\Parallels\Plesk\”).

To Backup whole Plesk server

# /usr/local/psa/bin/pleskbackup –server -v
-v option show information about backup process

To Backup Single domain in Plesk with mails, hosting files, configuration and Database

#/usr/local/psa/bin/pleskbackup –domains-name yourdomain.com –v

To Backup only mail configuration and content

# /usr/local/psa/bin/pleskbackup –domains-name yourdomain.com –only-mail -v

To Backup only hosting configuration and content without emails

# /usr/local/psa/bin/pleskbackup –domains-name yourdomain.com –only-hosting –v

To Backup selected resellers . If no resellers provided, back up all resellers on the server.

# /usr/local/psa/bin/pleskbackup –resellers-name [Reseller logins name] –v

For example:
# /usr/local/psa/bin/pleskbackup –resellers-name Jade –v (back up all data for reseller Jade).
# /usr/local/psa/bin/pleskbackup –resellers-name Jade Robert David –v (back up all data for Jade Robert,David)

You can also use single file to read list of domains/clients/resellers from file, not from command line. File should contain list of domains/clients/resellers one per line.
Example:

To Backup selective resellers, clients and domains in Plesk

# /usr/local/psa/bin/pleskbackup –resellers-name –f resellersclient.txt –v (resellerclietns.txt is a file which contain list for resellers names per line )

# /usr/local/psa/bin/pleskbackup –clients-name –f clients.txt –v (clients.txt file which contains list for clients name per line )

# /usr/local/psa/bin/pleskbackup –domains-name –f domainsname.txt –v (domainnames.txt file which contain list of domains name per line)

—————————————–>

Unable to install mcrypt on Plesk 9 php5.3

0

Unable to install mcrypt on Plesk 9 php.5.3

#yum install php53-mcrypt

php53-common-5.3.3-13.el5_8.x86_64 from base has depsolving problems
–> php53-common conflicts with php-common
Error: php53-common conflicts with php-common
You could try using –skip-broken to work around the problem
You could try running: package-cleanup –problems
package-cleanup –dupes
rpm -Va –nofiles –nodigest
The program package-cleanup is found in the yum-utils package.

Why this happens because the package is not available in the Plesk repo. So I have added epel repo on the server.

#wget http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
#rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

#yum install php53-mcrypt

# php -v
PHP 5.3.3 (cli) (built: Jun 27 2012 12:25:48)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with the ionCube PHP Loader v4.0.7, Copyright (c) 2002-2011, by ionCube Ltd.
———————————————
[root@~]# php -m | grep mcrypt
mcrypt
———————————->

Parallels Plesk Panel shows incorrect disk usage

1

Parallels Plesk Panel shows incorrect disk usage

Linux :

To update traffic and disk usage for a single domain, run:

/usr/local/psa/admin/sbin/statistics –calculate-one –domain-name=domain.tld

Windows:

Replace the file %plesk_dir%\admin\smb\application\controllers\StatisticsController.php with the file the attachment.
Create a copy of this file before replacement.

Then recalculate statistics for the domain using the following command:

“%plesk_bin%\statistics.exe” –process-domains=domain.tld
=============================================>

Unable to load object of type IPAddress in Plesk Control Panel

0

Getting following Error while add a new subscription Plesk Control Panel.

Error :-
Internal error: Unable to load object of type IPAddress with id=2: Table->select() failed: no such row in the table

Cause :-

The error means that IP pool of ” VPS / Contains” refer to IP address that does not exist in the list of all available IP addresses in Plesk database.
Usually it happen if IP addresses are removed not through Panel interface from Plesk >> Settings >> IP addresses page but directly from ‘IP_Addresses’ table of Plesk database.
Such problem also exist if clone of a “VPS / Container” with already installed Plesk was used. As old “VPS / Container” are already having old IP address in there database. When new IP address was added and Old IP was removed, such problem persist.

Solution :-

Make sure that you have already read the new IP addresses into Plesk by logging into the Plesk control panel >> Settings >> IP addresses >> Reread IP

Now Login to mysql as Plesk admin
[root@vps9999 ~]# mysql -uadmin -p`cat /etc/psa/.psa.shadow` -Dpsa
Use psa database.
mysql> use psa
You will see the list of id numbers in the first column followed by the addresses in the second column.
Perform the modification of the component_id table as,
mysql> select id,ip_address from IP_Addresses;
+—-+—————-+
| id | ip_address |
+—-+—————-+
| 6 | xxx.xxx.xxx.164 |
| 7 | xxx.xxx.xxx.165 |
| 8 | xxx.xxx.xxx.222 |
You could see the output above, the id is 6, 7 and 8, It supposed to be in sequence like 1, 2 and 3.

Then update the table accordingly as,
mysql> update IP_Addresses set id=1 where ip_address=’xxx.xxx.xxx.164′;
Query OK, 1 row affected (0.01 sec)
Rows matched: 1 Changed: 1 Warnings: 0

mysql> update IP_Addresses set id=2 where ip_address=’xxx.xxx.xxx.165′;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0

mysql> update IP_Addresses set id=3 where ip_address=’xxx.xxx.xxx.222′;
Query OK, 1 row affected (0.01 sec)
Rows matched: 1 Changed: 1 Warnings: 0
Verify the changes as,
mysql> select id,ip_address from IP_Addresses;
+—-+—————-+
| id | ip_address |
+—-+—————-+
| 1 | xxx.xxx.xxx.164 |
| 2 | xxx.xxx.xxx.165 |
| 3 | xxx.xxx.xxx.222 |
Once this was done, check the Plesk Home page in Plesk Control Panel. It works fine.

Note :- Replace xxx.xxx.xxx with your original IP address values.
============================================>

Error message “no such row in the table” shows up when I click on IP Pool

0

Error message “no such row in the table” shows up when I click on IP Pool under a Client

Symptoms

When I click on Clients > a Client > IP Pool icon, the following error message is shown:

Unable to create IP Address object: Table->select() failed: no such row in the table

0: /usr/local/psa/admin/plib/common_func.php3:156
psaerror(string ‘Unable to create IP Address object: Table->select() failed: no such row in the table’)
1: /usr/local/psa/admin/plib/class.IPPoolList.php:120
ipPoolList->fetchIPPoolList()
2: /usr/local/psa/admin/plib/class.cList.php3:103
cList->fetchList()
3: /usr/local/psa/admin/plib/class.cList.php3:123
cList->init()
4: /usr/local/psa/admin/htdocs/clients/cl_pool.php3:81

Cause :-

The error means that the IP pool the Client contains refers to an IP address that does not exist in the list of all available IP addresses in the Parallels Plesk Panel (PP) database. Usually, this happens when IP addresses are managed not through the PP interface at the Server > IP addresses page, but directly from the “IP_Addresses” table of the PP database.

Resolution
It is necessary to find the referrer to the non-existent IP in the Client’s IP pool and remove it.

Solution :-

Make sure that you have already read the new IP addresses into Plesk by logging into the Plesk control panel >> Settings >> IP addresses >> Reread IP

1) Now Login to mysql as Plesk admin
# mysql -uadmin -p`cat /etc/psa/.psa.shadow` -Dpsa

2) Find the IP pool of the Client (substitute the real Client login instead of LOGIN below):
mysql> select login, pool_id from clients where login = ‘LOGIN’;
+——-+———+
| login | pool_id |
+——-+———+
| LOGIN | 7 |
+——-+———+

3) The IP pool is “7.” Now find the IDs of the IP addresses that are in this IP pool:
mysql> select * from Repository where rep_id = 7;
+——–+————–+
| rep_id | component_id |
+——–+————–+
| 7 | 1 |
| 7 | 2 |
| 7 | 3 |
+——–+————–+

4) IP pool 7 contains IP addresses with IDs 1, 2, and 3. Now check whether these IP addresses are in the “IP_Addresses” table:
mysql> select id, ip_address, iface from IP_Addresses where id in (1,2,3);
+—-+—————+——-+
| id | ip_address | iface |
+—-+—————+——-+
| 1 | 192.168.45.50 | rl0 |
| 2 | 192.168.45.51 | rl0 |
+—-+—————+——-+

5) As you can see, the IP address with the ID 3 does not exist. Therefore, we need to remove the record where IP pool = 7 and IP Address ID = 3 from the “psa.Repository” table:
mysql> delete from Repository where rep_id = 7 and component_id = 3;
==============================================>
Reference : http://kb.parallels.com/en/2242

PLESK FOR WINDOWS MYSQL ACCESS.

1

PLESK FOR WINDOWS MYSQL ACCESS.

Plesk uses two Mysql servers. One for clients databases (port 3306) and second server for Plesk databases (8306). You can connect to Plesk DB using the following command:

%plesk_dir%\mysql\bin\mysql.exe -uadmin -pPlesk_admin_passwd -P8306

“C:\Program Files\Parallels\Plesk\Databases\MySQL\bin\mysql.exe” -uadmin -pPlesk-admin_passwd -P8306

Plesk-admin_passwd = “C:\Program Files\Parallels\Plesk\admin\bin\plesksrvclient.exe” -get

However if you want to connect to Client’s Mysql Server you should use the following command:

%plesk_dir%\databases\mysql\bin\mysql.exe -uadmin -pPassword -P3306

Password you can find in the psa.misc or psa.databaseservers tables (Plesk DB).

If the Plesk DB provider is set to Access mdb or MSSQL then an appropriate tool will be needed to view the Plesk DB.
===================================================>