Archive for November, 2007

Installing PHP 5.2.5, Suhosin, PHP-Eaccelerator on Centos 4 with YUM

Posted on November 17th, 2007 in Linux, PHP | 15 Comments »

This is currently no longer supported as I’m now using Centos 5

You will find similar, but updated rpms here http://blog.famillecollet.com/

I’ve created a repo containing the new PHP 5.2.5 rpms and other extensions.

My yum repo currently only supports i386 architectures and centos / el4.

To upgrade to php 5.2.5 please run:

wget http://www.smudge-it.co.uk/pub/yum/RPM-GPG-KEY-smudge
rpm –import RPM-GPG-KEY-smudge

Add my repository by creating the file
vi /etc/yum.repos.d/smudge.repo

[smudgeit]
name=Smudge IT RPMS for Centos 4 – $basearch
baseurl=http://www.smudge-it.co.uk/pub/yum/centos/4/$basearch/
enabled=1
gpgcheck=1

Then run yum update php.

I have the following files in my repo:

pcre-6.6-1.1.i386.rpm php-gd-5.2.5-1.i386.rpm php-pdo-5.2.5-1.i386.rpm
pcre-devel-6.6-1.1.i386.rpm php-imap-5.2.5-1.i386.rpm php-pear-1.6.1-2.noarch.rpm
php-5.2.5-1.i386.rpm php-ldap-5.2.5-1.i386.rpm php-pgsql-5.2.5-1.i386.rpm
php-bcmath-5.2.5-1.i386.rpm php-mbstring-5.2.5-1.i386.rpm php-snmp-5.2.5-1.i386.rpm
php-cli-5.2.5-1.i386.rpm php-mcrypt-5.2.5-1.i386.rpm php-soap-5.2.5-1.i386.rpm
php-common-5.2.5-1.i386.rpm php-mhash-5.2.5-1.i386.rpm php-suhosin-0.9.20-1.i386.rpm
php-dba-5.2.5-1.i386.rpm php-mssql-5.2.5-1.i386.rpm php-tidy-5.2.5-1.i386.rpm
php-devel-5.2.5-1.i386.rpm php-mysql-5.2.5-1.i386.rpm php-xml-5.2.5-1.i386.rpm
php-eaccelerator-5.2.5_0.9.5.1-1.i386.rpm php-ncurses-5.2.5-1.i386.rpm php-xmlrpc-5.2.5-1.i386.rpm
php-embedded-5.2.5-1.i386.rpm php-odbc-5.2.5-1.i386.rpm

You can install other extensions such as:

yum install php-eaccelerator
yum install php-suhosin

Edit /etc/php.d/suhosin.ini to->

extension=suhosin.so
suhosin.session.encrypt = Off

Now you have a more secure php installation.

*** Updated sqlite2 packages. If you were having issues installing php-pdo then do

yum clean all

and then

yum install sqlite2

Share/Save/Bookmark

Get Google Page Rank using PHP

Posted on November 14th, 2007 in PHP | 9 Comments »

Here is a nice little script to get a google page rank using php. This should work on 32 and 64 bit machines.

You basically pretend to be the Google Tool bar and read the data sent back from google.

PHP Google Page Rank Script


Share/Save/Bookmark

Email alerts from Dell Poweredge using omreport

Posted on November 14th, 2007 in Dell Poweredge, Linux | No Comments »

Dell Poweredge Servers come with tools to monitor the hardware and driver updates. They have called it, OpenManage Server Administrator and this is how you can get it running. (if using yum and Centos)

wget -q -O – http://linux.dell.com/repo/hardware/bootstrap.cgi | bash

yum install srvadmin-all

srvadmin-services.sh start.

If all goes fine, you should be able to view a web interface via port 1311.

https://localhost:1311

I then had to log in with my root user name and password. I was pleased with the amount of features incorporated in Open Manage.

To setup the alerts you can click on Alerts Management > Then on the individual sensor. I chose to select, Execute application, so that I can have the software email me a complete list of errors detected.

Here is the script I use to email me:

#!/bin/bash

ps -ef >/tmp/psout.txt 2>&1

omreport system alertlog > /tmp/alertmsg.txt 2>&1

mail -s “Server Alert” root </tmp/alertmsg.txt> /tmp/mailout.txt 2>&1

Obviously substitute root with your email. Now when the server detects, will receive a printout of processes running at the time of the incident and a copy of the log file.

Share/Save/Bookmark

Minimal services on Redhat / Centos

Posted on November 14th, 2007 in Linux | 2 Comments »

On completing a minimal install of Centos, you often find that there are quite a few unwanted services started by default.

I like to disable the folowing with the commands:

/sbin/chkconfig xfs off
/sbin/chkconfig isdn off
/sbin/chkconfig gpm off
/sbin/chkconfig pcmcia off
/sbin/chkconfig sendmail off
/sbin/chkconfig cups off
/sbin/chkconfig portmap off
/sbin/chkconfig nfslock off
/sbin/chkconfig netfs off
/sbin/chkconfig rpcgssd off
/sbin/chkconfig rpcidmapd off
/sbin/chkconfig autofs off
/sbin/chkconfig lm_sensors off

Share/Save/Bookmark