Wednesday 3 November 2010

Intalling Postgres, Apache and PHP in Kubuntu (Linux)

Download Software's:

Download source archive files of PostgreSQL, Apache and PHP from respective project sites. Currently supported versions are given as reference. Take the latest point release (denoted as x below) from the sites:
1. http://www.postgresql.org/ftp/source/v8.4.4/postgresql-8.4.4.tar.bz2
2. http://httpd.apache.org/download.cgi#apache22
3. http://in2.php.net/get/php-5.3.3.tar.bz2/from/a/mirror (if this download is not found go to http://in2.php.net/downloads.php and click on the latest version to download)

Postgresql

1. tar xvjf postgresql-8.4.4.tar.bz2
2. cd postgresql-8.4.4/
3.a. su (i.e change to super use)
b. apt-get install tcl
c. apt-get install tcl-dev
d. ./configure --with-tcl
4. make
5. make install
6. mkdir /usr/local/pgsql/data
7. chown postgres:postgres /usr/local/pgsql/data/
8. su postgres
9. /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data/
10. /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data start&
11. /usr/local/pgsql/bin/psql template1
12. exit (from db)
13. a. /usr/local/pgsql/bin/createuser leatherlink
b. exit as postgres user
14. cp contrib/start-scripts/linux /etc/init.d/postgresql
15. chmod a+x /etc/init.d/postgresql
16. /etc/init.d/postgresql restart
17. nano /home/leatherlink/.bashrc
export PATH=/usr/local/pgsql/bin:$PATH
18. psql template1
CREATE DATABASE leatherlinkdb;
\c leatherlinkdb
CREATE LANGUAGE plpgsql;
CREATE LANGUAGE pltcl;
\q


Apache:


1. cd
2. tar xvjf httpd-2.2.xx.tar.bz2
3. cd httpd-2.2.xx/
4. ./configure –enable-so
5. make
6. a. su
b. make install
7. /usr/local/apache2/bin/apachectl start
8. /usr/local/apache2/bin/apachectl stop
9. cp /usr/local/apache2/bin/apachectl /etc/init.d/httpd
10. /etc/init.d/httpd restart

PHP

1. cd
2. tar xvjf php-5.3.2.tar.bz2
3. cd php-5.3.2/
4. a. apt-get install libxml2-dev
b. apt-get install openssl
apt-get install libcurl4-openssl-dev
(http://linux.goeszen.com/missing-openssl-evp-hmac.html)
c. ./configure –with-pgsql –with-apxs2=/usr/local/apache2/bin/apxs –with-curl=/usr –enable-calendar –with-curl –enable-dba –enable-ftp –with-zlib-dir –enable-soap –with-regex=php –with-openssl –enable-bcmath
5. make
6. a. su
b. make install
7. cp php.ini-development /usr/local/lib/php.ini
8. /usr/local/apache2/conf/httpd.conf

SetHandler application/x-httpd-php


SetHandler application/x-httpd-php-source

AllowOverride All
9. /usr/local/apache2/bin/apachectl restart

No comments:

Post a Comment