Posts By: jonny

CPAN Perl Modules – LWP failed with code

I had a little difficulty today installing some Perl modules from CPAN. I was getting messages like: Fetching with Net::FTP:'t fetch 01mailrc.txt.gz from Fetching with LWP: failed with code[400] message[FTP return code 150]Fetching with Net::FTP: First I tried removing the exisint file from /usr/lib/perl5/5.8.5/CPAN/ Then I tried the install… Read more »

Adding the RPMforge Repositories on CentOS5

Adding the RPMforge repositories is one of the first things I like to do on a new install. Instructions are on the RPMforge website but it is as straightforward as: wget rpm -Uhv rpmforge*  You will then notice the repo details in /etc/yum.repos.d This allowed me to update Spam Assassin from the 3.1.9 version… Read more »

Keep MySQL Alive

I wanted to have a cron job that would check if MySQL was still running and if not to start it again. The following got me started with an hourly check: 0 * * * * ps -ef | grep mysqld | grep -v grep >> /dev/null || /etc/init.d/mysql start

"Crontab -e Returns a Number" Problem

I sometimes find on a certain machine that when I change to a bash shell and try to edit the crontab with # crontab -e instead of getting my vi editor I just get a number returned, for example: # crontab -e3839 Obviously something to do with how the default editor is set in the… Read more »

Testing a SpamAssassin Install

SpamAssassin can be checked by feeding a text file into it and piping the result out to another text file. Amendments can be made to the input file to check for effectiveness. Consider using the 'GTUBE' phrase as a trigger to increase the score and label a message as spam. spamassassin -t < sample-spam.txt >… Read more »

Adding Perl Modules

Using CentOS5/RHEL5 I needed to add some perl modules for SpamAssassin. Note sure how important this first step is but I:# cd /root/.cpan/sources# wget # perl -MCPAN -e shell when asked about configuration I said 'no' and allowed the autoconfiguration to take place. I then arrived at the CPAN prompt:  cpan>  install Mail::SPF::Query cpan>  install… Read more »

htaccess examples

Temporarily take site down for maintenance Options +FollowSymlinks RewriteEngine on RewriteCond %{REMOTE_ADDR} !^111\.111\.222\.111 RewriteCond %{REQUEST_URI} !/index.html$ RewriteRule $ /index.html [R=302,L] or Options +FollowSymlinks RewriteEngine on RewriteCond %{REQUEST_URI} !^/oldsite/ RewriteCond %{REMOTE_HOST} !^123\.111\.123\.111 RewriteRule (.*)$1 [R=301,L] Redirecting to a New Domain Options +FollowSymLinks RewriteEngine on RewriteRule (.*)$1 [R=301,L] Force https use RewriteEngine On RewriteCond %{SERVER_PORT}… Read more »

Slow SSH Logins

On a new server install on CentOS 5.1 I was getting very slow logins. Trying ssh with the -v (verbose) option showed that: debug1: Authentications that can continue: publickey,gssapi-with-mic,passworddebug1: Next authentication method: gssapi-with-micdebug1: Unspecified GSS failure.  Minor code may provide more informationNo credentials cache found To skip this and continue with password authentication I amended… Read more »


I had a problem installing a new virtual machine using Xen and virt-manager on CentOS 5.1.I could not choose a network device as the drop-down list/menu was empty. From the bug at the following page: I downloaded the file and copied it to the server at: /usr/share/virt-manager/virtManager/ then ran: cd /usr/share/virt-manager/virtManager/ patch -p0 <… Read more »

PHP 5.2.0 Upgrade and Issues

In the official yum repositories for Red Hat/CentOS for RHEL5 / CentOS 5.1 the current version of PHP is (at time of writing) 5.1.6 however when trying to install the Magento e-commerce application required PHP version 5.2.0 or higher. To upgrade PHP to 5.2.5 I followed some instructions here on using the Remi repository i.e…. Read more »