Archive for April, 2009

29th April
2009
written by Chris

I may be wrong here, but I believe the default queue lifetime for a message sitting in the qmail queue is 7 days. To me, that's entirely too long to wait to deliver a defunct message considering most of them are probably SPAM bounces anyway.

Here is how to shorten the lifetime.

Change to the qmail control directory, assuming you use default locations on your server.

cd /var/qmail/control

Set the timeout to the number of seconds you want the message to remain in the queue. This is done in the queuelifetime file. This file doesn't normally exist by default. I'll use 24 hours (86,400 seconds) as an example.

echo "86400" > queuelifetime

Restart qmail.

/etc/init.d/qmail restart

That's it. Messages that don't get delivered in 24 hours will be gone.

Tags: , ,
25th April
2009
written by Chris

Change to the Postfix configuration directory. Usually this is in /etc/postfix.

cd /etc/postfix

Open the sender_access file or create it if it doesn't exist.

vi sender_access

Add the email address you want rejected on a new line in the file followed by REJECT.

email@address.com REJECT

Save the file.

Create the server_access database with the postmap command

postmap hash:sender_access

Edit the main.cf file and add the following

smtpd_recipient_restrictions = check_sender_access hash:/etc/postfix/sender_access

Restart Postfix

service postfix restart

Check your logs to make sure everything is good.

24th April
2009
written by Chris

First, copy the smtp_psa file.

cp /etc/xinetd.d/smtp_psa /etc/xinetd.d/smtp_additional

Edit the newly copied file and replace the first line. Replace 'service smtp' with 'service submission'

vi /etc/xinetd.d/smtp_additional

Restart xinetd.d

service xinetd restart

Check that port 587 is listening on the server

netstat -ltnp
19th April
2009
written by Chris

Upgrading Plesk from 7.5.4 to 8.0.1 the easy way. If you are going from an 8.x version to higher 8.x version, you can go straight to editing the sources file and then up2date psa.

Run the script HERE first.

After running the script, follow theses steps (as applicable)

rpm -e tomcat4 tomcat4-admin-webapps tomcat4-webapps psa-tomcat-configurator
mv selinux dummy package and perl-TimeDate out of way
up2date alsa-lib chkfontpath jpackage-utils ttmkfdir xorg-x11-deprecated-libs xorg-x11-font-utils
rpm -Uvh dist*/base/*rpm dist*/opt/backup/*rpm dist*/opt/migration/*rpm dist*/opt/api/*rpm dist*/opt/updater/*rpm thirdparty*/psa-php4-configurator-*.rpm dist*/opt/java/*rpm thirdparty*/*rpm dist*/opt/modules/*/*rpm dist*/opt/mail/psa-spamassassin*.rpm

Edit /etc/sysconfig/rhn/sources and put this in:

yum psa86dist http://autoinstall.plesk.com/PSA_8.6.0/dist-rpm-RedHat-el4-i386/
yum psa86third http://autoinstall.plesk.com/PSA_8.6.0/thirdparty-rpm-RedHat-el4-i386/

Turn off signed packages by changing useGPG=1 to be useGPG=0 in /etc/sysconfig/rhn/up2date

up2date psa

=====UPGRADES=====
Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 United States License.

Plesk Upgrades

This living document aspires to provide best practices for Plesk upgrades
that result in less downtime for customers and reduced work for technicians.
One of the newest features of this tutorial is that packages can be resolved
and downloaded prior to the actual maintenance. See plesk-prefetch.html

Release notes / Changelogs
download1.parallels.com/Plesk/Plesk8.3/plesk-8.3.0-for-rpm-based-oses.html
download1.parallels.com/Plesk/Plesk8.4/plesk-8.4.0-for-rpm-based-os.html
download1.parallels.com/Plesk/Plesk8.6/plesk-8.6.0-for-rpm-based-os.html
download1.parallels.com/Plesk/PPP9/plesk-9.0.0-for-rpm-based-os.html

Version Hopping

2 -> 5 -> 6 -> 7 -> 7.5 -> 8.6

You can go directly from 7.5 to any higher version but should follow the
upgrade path listed above for prior releases. Technically, the RPMs specify
that direct upgrades from version 6 to any version are supported but this
has yet to be tested. I have recently gone 7.5.2 directly to 8.6 on RHEL4
with no issues.

Plesk 7.5+ works with PHP5+

Plesk 8.1.0 introduced MySQL5 compatibility

Plesk 8.2.1 introduced yum repositories, if you are coming from a version
prior to 7.5, you will need to use older methods like using the RPM tarball

Prerequisites

Networking-fu

ifconfig eth0; hostname
cat /etc/hosts

## Verify that the primary IP matches hostname and hosts file

    Backups

mkdir plesk_upgrade
cp -a /etc/php.* plesk_upgrade
php -v > plesk_upgrade/phpv
ls -l /etc/php.ini     #make sure there is no symlink
cp /etc/my.cnf plesk_upgrade
cp /etc/xinetd.d/smtp_psa plesk_upgrade
cp /usr/local/psa/version plesk_upgrade
mkdir plesk_upgrade/pg
cp /var/lib/pgsql/data/pg_hba.conf /var/lib/pgsql/data/usrs_* /var/lib/pgsql/data/postgresql.conf plesk_upgrade/pg

## I generally have faith in the mysqldump that the psa RPM produces but you may make an extra if you think
that it's a good idea. See /var/lib/psa/dumps/mysql.preupgrade.dump.gz

Resolve *all* updates first (except kernel, skip list may be of use in edge
cases)

# <= RHEL4

up2date -u –dry-run # ensure that *all* existing packages are patched or skip listed if absolutely necessary

# RHEL5

yum check-update # ensure that *all* existing packages are patched or skip listed if absolutely necessary

MAGIC (Not needed on RHEL5):

vim /etc/sysconfig/rhn/up2date

Set:

noReplaceConfig=0
useGPG=0

## noReplaceConfig will allow things that have modified configuration files to be upgraded (courier-imap)

## useGPG makes me sad but Plesk does not sign their packages

Determine which sources to use. Find them at the bottom of this post.

cat /etc/redhat-release

Add sources for appropriate RHEL/Plesk combination

# <= RHEL4

vim /etc/sysconfig/rhn/sources

# RHEL5

vim /etc/yum.repos.d/psa.repo
export PLESK_QUOTACHECK_OFF=1 # save some time

# <= RHEL4

up2date -u –dry-run # just to make sure everything looks good
up2date -u # perform upgrade, look ma no hands

# RHEL5
Doing a "dry-run" with yum:

yum shell

yum> update
yum> transaction list
yum> transaction solve
yum> transaction run # (if you want to perform the actions)

To skip that:

yum update

# <= RHEL4

if ! rpm -q psa-autoinstaller; then up2date psa-autoinstaller; else echo "already installed"; fi

# RHEL5

if ! rpm -q psa-autoinstaller; then yum install psa-autoinstaller; else echo "already installed"; fi

Clean-up

# <= RHEL4

vim /etc/sysconfig/rhn/sources   # Remove the yum sources
vim /etc/sysconfig/rhn/up2date  # noReplaceConfig=1 useGPG=1, all defaults restored

# RHEL5

mv /etc/yum.repos.d/psa.repo plesk_upgrade/
diff plesk_upgrade/php.ini /etc/php.ini # make sure nothing crazy is going on
php -v # no errors? compare with plesk_upgrade/phpv
/usr/local/psa/admin/bin/websrvmng -a # just in case
/etc/init.d/httpd restart

* Check GUI for additional updates and license issues
* make sure you can at least get to some sites
* Check some sites, POP, SMTP and FTP.
* Check for defunct processes, high load, etc

tail -30 /usr/local/psa/var/log/maillog

* Make sure that /var/qmail/control/dh1024.pem exists, see below

If there is no /var/qmail/control/dh1024.pem

cd /var/qmail/control
cp dhparam512.pem dh512.pem
cp dhparam1024.pem dh1024.pem
/etc/init.d/qmail restart
/etc/init.d/xinetd restart

Troubleshooting

If coming from psa7.5 to 8.x

rpm -e sitebuilder_module-shop sitebuilder_module-votes # if sitebuilder is installed
rpm -e psa-bu # it will be replaced by psa-backup-manager
rpm -e psa-tomcat-configurator # need to check into a little further, seems safe enough

On RHEL 5 with yum, you might see:

filelists.xml.gz 100% |=========================| 10 MB 00:39
Error: failed to retrieve repodata/filelists.xml.gz from rhel-x86_64-server-5
error was [Errno -1] Metadata file does not match checksum

Try:

yum clean all
rhn-profile-sync
yum clean all

If it still does not work, get around this perform the upgrade with: (You have already performed other updates right?)

yum update –disableplugin=rhnplugin

These sorts of issuses are supposed to be resolved in rhel5.3

If you are having a problem where you can't install packages from autoinstaller in rhel5 and it wants to do silly things with glibc, remove apache or something like
that, drop in the repos as described above and yum install them. This is because yum is not fully supported by Parrallels and the autoinstaller fails back to the old
filefetcher method. Their support refuses to admit this and claims that it was fixed in 8.6

On RHEL5.2 I had to do the following first to install Plesk 9.0:

rpm -e psa-updates-8.6.0 psa-hotfix4-8.6.0 psa-hotfix5-8.6.0

If you are running 9.0 and short name mail auth is not working, you have been switched to Postfix. Go back to qmail by installing

psa-mail-qc-driver via yum/up2date

If you are having real troubles updating to Plesk > 8 on RHEL3 due to SpamAssassin issues, you might try

'mv /var/spool/up2date /var/spool/up2date_old; mkdir /var/spool/up2date'

The older header files may be causing a conflict.
Worst case:

rpm -e psa-spamassassin spamassassin; up2date –get spamassassin perl-Mail-SpamAssassin; rpm -Uvh /var/spool/up2date/the.rpms; up2date psa-spamassassin;

To disable PHP safe mode for all domains:

mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa -e 'update hosting set php_safe_mode = "false";'
/usr/local/psa/admin/bin/websrvmng -a
/etc/init.d/httpd restart

=====UPGRADE SOURCES======

RHEL 4 386 8.2.1
yum product-distr-rpms http://autoinstall.plesk.com/PSA_8.2.1/dist-rpm-RedHat-el4-i386
yum thirdparty-rpms http://autoinstall.plesk.com/PSA_8.2.1/thirdparty-rpm-RedHat-el4-i386
yum product-updates-rpms http://autoinstall.plesk.com/PSA_8.2.1/update-rpm-RedHat-el4-i386

RHEL 4 386 8.3
yum plesk-dist-rpms http://autoinstall.plesk.com/PSA_8.3.0/dist-rpm-RedHat-el4-i386
yum plesk-thirdparty-rpms http://autoinstall.plesk.com/PSA_8.3.0/thirdparty-rpm-RedHat-el4-i386
yum product-updates-rpms http://autoinstall.plesk.com/PSA_8.3.0/update-rpm-RedHat-el4-i386

RHEL 4 386 8.3 Kitchen sink
yum plesk-dist-rpms http://autoinstall.plesk.com/PSA_8.3.0/dist-rpm-RedHat-el4-i386/
yum plesk-thirdparty-rpms http://autoinstall.plesk.com/PSA_8.3.0/thirdparty-rpm-RedHat-el4-i386/
yum sitebuilder-dist-rpms http://autoinstall.plesk.com/SiteBuilder/SiteBuilder_4.2.0/dist-rpm-RedHat-el4-i386
yum sitebuilder-thirdparty-rpms http://autoinstall.plesk.com/SiteBuilder/SiteBuilder_4.2.0/thirdparty-rpm-RedHat-el4-i386
yum sso-dist-rpms http://autoinstall.plesk.com/SSO_2.0/dist-rpm-RedHat-el4-i386
yum sso-thirdparty-rpms http://autoinstall.plesk.com/SSO_2.0/thirdparty-rpm-RedHat-el4-i386

RHEL 4 386 8.4
yum plesk-dist-rpms http://autoinstall.plesk.com/PSA_8.4.0/dist-rpm-RedHat-el4-i386
yum plesk-thirdparty-rpms http://autoinstall.plesk.com/PSA_8.4.0/thirdparty-rpm-RedHat-el4-i386
yum product-updates-rpms http://autoinstall.plesk.com/PSA_8.4.0/update-rpm-RedHat-el4-i386

RHEL 4 386 8.6
yum plesk-dist-rpms http://autoinstall.plesk.com/PSA_8.6.0/dist-rpm-RedHat-el4-i386
yum plesk-thirdparty-rpms http://autoinstall.plesk.com/PSA_8.6.0/thirdparty-rpm-RedHat-el4-i386
yum product-updates-rpms http://autoinstall.plesk.com/PSA_8.6.0/update-rpm-RedHat-el4-i386

RHEL 4 386 9.0
yum plesk-dist-rpms http://autoinstall.plesk.com/PSA_9.0.0/dist-rpm-RedHat-el4-i386/
yum plesk-thirdparty-rpms http://autoinstall.plesk.com/PSA_9.0.0/thirdparty-rpm-RedHat-el4-i386/
yum product-updates-rpms http://autoinstall.plesk.com/PSA_9.0.0/update-rpm-RedHat-el4-i386/

Tags: ,
19th April
2009
written by Chris

When having to migrate hugh numbers of IP addresses on Plesk, here is a way to manipulate the database to do it without having to use the panel to do them one at a time.

mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa
mysql> SELECT * FROM IP_Addresses;

mysql> UPDATE Repository SET component_id = [new ip id] WHERE component_id = [old ip id];

mysql> UPDATE hosting SET ip_address_id = [new ip id] WHERE ip_address_id = [old ip id];

Tags: ,
Previous