Fixing the annoying “perl: warning: Setting locale failed” error message

I was getting really annoyed getting these messages while anaging my Debian and Ubuntu VPSes


perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_US.utf8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

Turns out the solution is simply to run these commands

export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
apt-get install locales
dpkg-reconfigure locales

The export lines above can also be saved into either ~/.profile or ~/.bashrc or ~/.cshrc

KnowledgeTree speed on VPSes

KnowledgeTree speed on VPSes

I was trying out KnowledgeTree 3.7.0.2 (Community Edition) on 3 different virtual private servers just to see how they fare  with “heavy” websites, and here’s how they perform generating a page of 20 items. All VPSes are 512MB instances running on Ubuntu 10.04 LTS .

APC Hosting (Virtuozzo)

Request created in 17.190s

Rackspace Cloud Server (Xen)

Request created in 0.446s

Club Uptime (OpenVZ)

Request created in 0.299s

The most ironic thing is that the above VPSes are listed in order of most expensive to least expensive. It seems here we do not get the best performance from the most  expensive service? In fact it performs much worse than the other two!

At this point, the Rackspace offering is the most attractive with its built-in manual and scheduled daily and weekly snapshots, from which you can quickly spin up new VPSes.

Debian Lenny to Squeeze upgrade

Debian Lenny to Squeeze upgrade

Debian 6 i.e. “Squeeze” was released almost a month ago. Although there are still about 11 months more before Debian 5 “Lenny” is no longer supported, I figured I would upgrade one Debian Lenny Xen-based VPS hosted on a Rackspace Cloud,  currently functioning as an OpenLDAP server, as a weekend project.

The upgrade steps were straightforward:

1. Edit /etc/apt/sources.list and change all instances of lenny to squeeze.

2. Run the following commands in succession in terminal

sudo apt-get update
sudo apt-get install apt dpkg aptitude
sudo apt-get dist-upgrade

Surprisingly enough the upgrade went well with Apache and even OpenLDAP migrated successfully. Just the following issues related to phpldapadmin were encountered:

1. The upgraded phpldapadmin would work until I ran

sudo apt-get purge phpldapadmin

sudo apt-get install phpldapadmin

2. I would face a screen full of “Automatically removed objectClass from template” warnings upon logging into phpldapadmin. This I resolved this by renaming the .xml files in /etc/phpldapadmin/templates/modification once again to another non- .XML suffix.

3. Every time I attempted to edit an try, I would get an annoying “Select a template to edit the entry” screen. This was resolved by renaming the files for the templates referenced in the error screen, at /etc/phpldapadmin/templates/creation, to have non- .XML suffix.

Unattended updates on CentOS

Unattended updates on CentOS

Having recently had to clean up after the Exim4 vulnerability that did not get patched on a server in time, one of the first things I do on a new VPS is set up automatic unattended updates. The steps are clearly documented for Debian/Ubuntu, but for CentOS it was a little harder to find the information. Here are the steps:

In a terminal session run

yum install yum-updatesd

Next you need to edit /etc/yum/yum-updatesd.conf
and edit the following lines to hold the values in bold


emit_via = email
# automatically install updates
do_update = yes
# automatically download updates
do_download = yes
# automatically download deps of updates
do_download_deps = yes

and also enter the following lines


# who to send the email to:
email_to = [email protected]
# who send the notifications
email_from = [email protected]

Finally, you need to restart the notification service by typing

/etc/init.d/yum-updatesd restart

Now you will receive an email notification every time and update is available or installed (depending on your configured options above)

WordPress updates without FTP login prompts

WordPress updates without FTP login prompts

One gripe I have about running WordPress on a VPS is that it keeps prompting me to enter the FTP password every time I do an update. As it turns out, you can save your FTP login credentials in wp-config.php so that you never get asked again!

Simply add the following lines to wo-config.php


// ** FTP SETTINGS FOR AUTO-UPDATE ** //
define('FTP_HOST', 'YOUR-HOSTNAME-HERE');
define('FTP_USER', 'YOUR-FTP-USERNAME');
define('FTP_PASS', 'YOUR-FTP-PASSWORD');

Remember to change the values above accordingly.

« Previous Entries