Install/upgrade to php 5.2.5 on Centos4

1, Get FedoraCore php src rpm
  -> http://ftp.riken.jp/Linux/fedora/releases/9/Fedora/source/SRPMS/
2, Install php 5.2.5.src.rpm, and modify spec

[email protected]ns99 ~# rpm -ivh php-5.2.5-7.fc9.src.rpm
[email protected]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. 

 [email protected] SPECS#rpmbuild –bb php.spec
 [email protected] SPECS#cd ../RPMS/i386/
 [email protected] 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
http://ftp.riken.jp/Linux/centos/4.7/centosplus/SRPMS/
httpd-2.0.63-2.el4s1.centos.2.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 192.168.1.100
RewriteBase / #any access below http://www.sample.local/ directory
RewriteRule (.*)$ /maintenance.html #reloaded pages is… 
</IfModule> 

To use this, you must install mod_rewrite.

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

Visitors – fast web log analyzer
http://www.hping.org/visitors/

 

How To install

wget http://www.hping.org/visitors/visitors-0.7.tar.gz
tar xvzf visitors-0.7.tar.gz
cd visitors_0.7
make
cp visitors /usr/bin/

 

Usege

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

 

make flowchart with Graphviz
http://www.graphviz.org/Download..php

 

How To install

wget http://dag.wieers.com/rpm/packages/graphviz/graphviz-2.2-1.2.el4.rf.i386.rpm

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

 

Usege

1, make graph.dot
visitors access.log –prefix http://sample.net -V > graph.dot

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

 

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

visitors access_log –prefix http://gigazine.net -V > graph.dot

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