Archive for March, 2007

Installing Perl Module from CLI

Thursday, March 22nd, 2007

perl -MCPAN -eshell

Installing Apache 2.x and PHP5

Saturday, March 10th, 2007

Installing Apache 2.x

./configure \
--prefix=/usr/local/apache \
--enable-info \
--enable-rewrite \
--enable-ssl \
--enable-unique-id \
--enable-deflate \
--enable-usertrack \
--enable-so

make
make install


cp build/rpm/httpd.init /etc/init.d/httpd
chkconfig --add httpd
chkconfig --level 3456 httpd on

Installing PHP required Libraries
http://www.ijg.org/files/jpegsrc.v6b.tar.gz
./configure --enable-shared
mkdir -p /usr/local/man/man1
make
make install

http://www.libpng.org/pub/png/libpng.html
./configure
make
make install

http://voxel.dl.sourceforge.net/sourceforge/freetype/freetype-2.1.9.tar.gz
./configure
make
make test
make install

Install LibMCrypt
http://sourceforge.net/projects/mcrypt
./configure
make
make install

Installing PHP5

./configure \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-openssl \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-zlib-dir \
--with-freetype-dir \
--with-ttf \
--with-mysql=/usr/local/mysql \
--with-mysqli=/usr/local/mysql/bin/mysql_config \
--with-mcrypt \
--enable-mbstring \
--enable-bcmath

make
make install

Configuring Apache for PHP
vi /usr/local/apache/conf/httpd.conf

add
AddType application/x-httpd-php .php

change
DirectoryIndex index.php index.html index.html.var

php.ini
copy php.ini-development or php.ini-production to /usr/local/lib/php.ini

edit /usr/local/lib/php.ini
timezone = Asia/HongKong

PostgreSQL installation

Saturday, March 10th, 2007

This is a guide to show step-by-step PostgreSQL installation.


./configure
make
su
make install
adduser postgres
mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
su - postgres
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data >logfile 2>&1 &
/usr/local/pgsql/bin/createdb test
/usr/local/pgsql/bin/psql test