Upgrading Plesk – Useful commands

I’ve been upgrading Plesk today and yesterday. Although Plesk has a nice interface, it’s not 100% clear in what happens. After some help on the FreeNode #plesk IRC channel and some cyberciti.biz pages, I’ve composed some details and commands to execute at the command line which can help when upgrading Plesk.

To Start Plesk

/etc/init.d/psa start

To Stop Plesk

/etc/init.d/psa stop

Upgrade through autoinstaller

/usr/local/psa/admin/bin/autoinstaller

Restart apache

/etc/init.d/httpd restart

Check the running processes.

The first column represents the owner. The second column contains the process id.

Source

ps aux | grep autoinstall

or

ps u

Killing a process

kill -9 [processid]

Backup an RPM database and rebuild it.

source 1

source 2

Remove any stale lock file

/bin/rm -f /var/lib/rpm/__db*

Back up the /var/lib/rpm directory

tar czvf $(hostname).rpmdatabase.tar.gz /var/lib/rpm

If your hostname is linux-server, it will save backup to a file called linux-server.rpmdatabase.tar.gz
Rebuild the rpm db

rpm --rebuilddb

Many thanks also go out to ‘koor’ who helped me at the #plesk IRC channel at FreeNode.

Collision of RPM files (RPM already exists)

When upgrading I encountered a collision of an RPM file which already existed. Because of that the upgrade could not proceed. A solution to that is presented here in the last post. It comes down to:

  • Navigating to the folder which holds the rpm file (e.g. cd /root/psa/PSA_8.1.0/dist-rpm-RedHat-el3-i386/base)
  • Forcing an update on the RPM. (e.g. rpm -U –force –nodeps psa-8.1.0-rhel3.build81061129.22.i586.rpm)

Running the updater after repairing the file will solve the problem.

SSH connection is refused
I had this problem once. After a little search I found this post. It’s brilliant! From Plesk itself you start a cronjob (run it as root user) which (re)starts (or use restart instead of start) the ssh daemon. After that my problem was solved.

Virtual hosts
By default Plesk has a pre-defined ‘behavior’ of a domain. This includes some settings for PHP like safe mode and open basedir restrictions. By default these settings are stored in a file called ‘httpd.include’ in the folder

/var/www/vhosts/yourdomain.ext/conf/

You can edit this file to change the behavior of the domain, but changes in this file are just temporary. Once the file is reloaded your changes will be gone.
To permanently make changes you need to create or edit a file called ‘vhost.conf’ which is located in the same directory. When loading the httpd.include file, the webserver also checks if this vhost.conf file exists and if so, it includes it. How you can create this virtual host file can be found on this page.

Apache logs
The apache log files are located at

/var/log/httpd/

Webserver config
The webserver (httpd) config is located at

/etc/httpd/conf/httpd.conf
Getagged , ,

Één reactie op “Upgrading Plesk – Useful commands

  1. Hamed schreef:

    Thank you, it’s so useful. please continue…

Geef een reactie

Het e-mailadres wordt niet gepubliceerd. Vereiste velden zijn gemarkeerd met *