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:  ftp://ftp.flirble.org/pub/CPAN/authors/01mailrc.txt.gzCouldn't fetch 01mailrc.txt.gz from ftp.flirble.org Fetching with LWP:  ftp://ftp.mirror.anlx.net/CPAN/authors/01mailrc.txt.gzLWP failed with code[400] message[FTP return code 150]Fetching with Net::FTP:   ftp://ftp.mirror.anlx.net/CPAN/authors/01mailrc.txt.gz First I tried removing the exisint Config.pm 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 http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm 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 ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY # 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 (.*) http://www.thedomain.com/oldsite/$1 [R=301,L] Redirecting to a New Domain Options +FollowSymLinks RewriteEngine on RewriteRule (.*) http://www.newdomain.com/$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 »

Xen

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:http://bugs.centos.org/view.php?id=2516 I downloaded the connection.py.patch 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 »