Install/upgrade to php 5.2.5 on Centos4

1, Get FedoraCore php src rpm
2, Install php 5.2.5.src.rpm, and modify spec

root@ns99 ~# rpm -ivh php-5.2.5-7.fc9.src.rpm
root@ns99 SPECS#cd /usr/src/redhat/SPECS

replace php.spec as provide here. ” it for avoid error on php test step”
Download php.spec here

3, build rpm and install
If any package need for dependency, install before build rpm. 

 root@ns99 SPECS#rpmbuild –bb php.spec
 root@ns99 SPECS#cd ../RPMS/i386/
 root@ns99 i386# rpm -Uvh php-common-5.2.5-7.i386.rpm php-mysql-5.2.5-7.i386.rpm php-debuginfo-5.2.5-7.i386.rpm  php-ncurses-5.2.5-7.i386.rpm php-devel-5.2.5-7.i386.rpm php-odbc-5.2.5-7.i386.rpm php-pdo-5.2.5-7.i386.rpm php-gd-5.2.5-7.i386.rpm php-pgsql-5.2.5-7.i386.rpm php-imap-5.2.5-7.i386.rpm php-snmp-5.2.5-7.i386.rpm php-ldap-5.2.5-7.i386.rpm php-5.2.5-7.i386.rpm php-mbstring-5.2.5-7.i386.rpm php-bcmath-5.2.5-7.i386.rpm php-mcrypt-5.2.5-7.i386.rpm php-xml-5.2.5-7.i386.rpm php-cli-5.2.5-7.i386.rpm php-mhash-5.2.5-7.i386.rpm php-xmlrpc-5.2.5-7.i386.rpm

Rebuild apache rpm on Centos4

Download src rpm

Install src rpm
ns2 ~ # rpm -ivh httpd-2.0.63-2.el4s1.centos.2.src.rpm
ns2 ~ # cd /usr/src/redhat/SPECS
ns2 SPECS # vim httpd.spec
%define contentdir /var/www -> %define contentdir /home
ns2 SPECS # rpmbuild -bb /usr/src/redhat/SPECS/httpd.spec
error: Failed build dependencies:
xmlto >= 0.0.11 is needed by httpd-2.0.63-2.el4s1.centos.2.i386
apr-devel >= 0.9.4-20 is needed by httpd-2.0.63-2.el4s1.centos.2.i386
apr-util-devel is needed by httpd-2.0.63-2.el4s1.centos.2.i386
distcache-devel is needed by httpd-2.0.63-2.el4s1.centos.2.i386
Install missing packages
ns2 SPECS # yum install xmlto apr-devel apr-util-devel distcache-devel
ns2 SPECS # rpmbuild -bb /usr/src/redhat/SPECS/httpd.spec
ns2 SPECS # cd ../RPMS
ns2 RPMS # rpm -ivh –force httpd-2.0.63-2.el4s1.centos.2.i386.rpm
ns2 ~ # /etc/init.d/httpd restart
ns2 ~ # suexec -V

install Apache2 + php5 + mysql on gentoo

Install apache2 with php, mysql and ssl

1, Modify /etc/make.conf
add those use flag : apache2 ssl pam xml xml2 pcre session unicode php mysql innodb berkdb

ns2 ~ # emerge apache mysql php
……… when it done
ns2 ~ # /usr/bin/mysql_install_db
ns2 ~ # /etc/init.d/apache restart && rc-update add apache default

Show maintenance page with apahce

.htaccess can redirect http request.
This is one of example how to show maintenance page.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REMOTE_ADDR}       !^192\.168\.1\.100$ #ignore this setting if access from
RewriteBase / #any access below http://www.sample.local/ directory
RewriteRule (.*)$ /maintenance.html #reloaded pages is… 

To use this, you must install mod_rewrite.

free web log analyzer “Visitors” 10000 line in 1 seconds

Visitors – fast web log analyzer


How To install

tar xvzf visitors-0.7.tar.gz
cd visitors_0.7
cp visitors /usr/bin/



like: visitors -A -m 30 access.log -o html > report.htm
like: visitors -A -m 30 access.log -o html –trails –prefix > report.html 


make flowchart with Graphviz


How To install


rpm -ivh graphviz-2.2-1.2.el4.rf.i386.rpm 



1, make
visitors access.log –prefix -V >

2, make PNG image
dot -Tpng > graph.png


for better use
visitors -GKZWMRDXYS -m 30 access_log –trails –prefix -o html > `date –date ‘1 day ago’ +%Y%m%d`report.html

visitors access_log –prefix -V >

dot -Tpng > `date –date ‘1 day ago’ +%Y%m%d`graph.png