Redhat, Plesk, named, and chroot oh my!

Well once again I performed my updates via Redhat up2date, and once again I lost all name services on a server.  This time I thought I would post my fix, since it was the same as last time.

There was an update issued by RHN this evening which updated the bind-chroot rpm. As part of it’s post install script it will attempt to relocate any zone files that may be located outside of the chroot into a chrooted directory in /var/named/chroot.

Since PSA implements a chroot for named outside of this package the nameserver files will be relocated to a path like…

/var/named/chroot/var/named/run-root/var/named/

This will of course break named’s ability to startup.

simply remove the bind-chroot rpm and re-link the /etc/named.conf file to the right location.

rpm -e bind-chroot
ln -sf /var/named/run-root/etc/named.conf /etc/named.conf
/sbin/service named restart

You should be good to go at that point.

PHP failing to upload images on a Plesk managed server

I recently upgraded a few of my Linux servers from Plesk 7.5 to 8.2. Everything seemed to be fine, however calls started coming in about PHP forms not uploading images correctly.

My team and I were troubleshooting this problem for a few days trying to narrow down the problem. We looked at folder permissions, script permissions, database connectivity, and almost anything else we could think of. Then we stumbled across the error message given by PHP (who would have thought to look at the error message?) that said function move_uploaded_file will not work in safe_mode.

Now looking at the PHP info the main php.ini was set with safe_mode off. However, I found that the httpd.conf for the individual domains on a Plesk managed server carries a declaration for PHP safe_mode, and it was turned on. Upon further investigation I found that in the Plesk interface for the domain there is a checkbox beside the PHP setting that allows safe_mode to be turned on and off.

Mission accomplished!

Restarting Plesk base services

I recently had the need to restart Plesk on a server. Everything on the server was running just fine, but Plesk was not responding.

After some searching I found these handy lines that allowed me to get Plesk back up and running.

# /etc/rc.d/init.d/psa stopall
# /etc/rc.d/init.d/psa start

Note: Must be run as root, or su.