Social Icons

Pages

Monday, 24 August 2009

SETUP APACHE, MYSQL, & PHP on Tarball

Huaaaaaaaahhhh.. akhirnya setelah sekian lama dengan deadline yang begitu menyeramkan.. hingga terpaksa menyita waktu :((
(maklum newbie :D)..

Oke lets go on for install LAMP from tarball..

1. Pastikan semua paket yang akan di install ada paketnya yaitu :
a. mysql-5.0.45-linux-i686.tar.gz
b. httpd-2.2.11.tar.gz
c. php-5.2.1.tar.bz2
(This packages request from office (red.php-5.2.1), where, if php other version can cause error programme.. andai saja semua paket boleh apa aja, I can using yum installer :D)

2. Save all package on folder home atw apa keq (e.g disini /usr/local/src)

3. Then we start to installation mysql :
a. ~#groupadd mysql
(--make group mysql--)

b. ~#useradd -g mysql mysql
(-- make user mysql--)

c. ~#cd /usr/local/
(-- change dir. or into dir. for place saving mysql--)

d. ~#gunzip < /usr/local/src/mysql-5.0.45-linux-i686.tar.gz | tar xvf -
(--extrak mysql into dir. yg td qt masuk--)

e. ~#ln -s mysql-5.0.45-linux-i686.tar.gz mysql
(--make symbolic link to mysql, so we'll using mysql--)

f. ~#cd mysql
(--into dir.mysql (dir. hasil symlink)--)

g. ~#chown -R mysql .
(--change ownership user become mysql ([.] the main is for all/current dir.--)

h. ~#chgrp -R mysql .
(--change ownership group
become mysql ([.] the main is for all/current dir.--)

i. ~#scripts/mysql_install_db --user=mysql
(--go on installasi binary--)

j. ~#chown -R root .
(--change ownership become root--)

k. ~#chown -R mysql data
(-- change ownership
become mysql especially data folder--)

l. ~#vim /etc/profiles :
export PATH=/usr/local/mysql-5.0.45-linux-i686/bin:$PATH
(enter the script into /etc/profiles --> maksudnya adalah agar untuk
pemanggilan file binari mysql kita tidak usah masuk kedalam path mysql tersebut.
misal saya mau masuk ke mysql maka yang saya lakukan hanya :
~#mysql -uroot
in case klo skrip tersebut tidak digunakan then :
~#/usr/local/mysql/bin/mysql -uroot -pPassLo ---> panjang kan??

m. ~#mysqld_safe --user=mysql &
(--start mysql server--)

n. ~#mysql -uroot -pPassWlo
(--start mysql client/want to query--)

if you change password mysql, please using this step :
- mysql>use mysql;
- mysql>update user set password=PASSWORD("passwd_wish") where User='root';
- mysql>flush privileges;
- restart mysql

4. Installation Apache2 :
~# tar -xvzf /usr/local/src/httpd-2.2.11.tar.gz -C /usr/local/
~# cd httpd-2.2.11
~# ./configure --prefix=/usr/local/apache2 --enable-so <-- prefix = target directory
~# make
~# make install
<----- until here, apache has been install ------>
~#/usr/local/apache2/bin/apachectl start & <-- for stop ../apachectl stop

5. Installation PHP
~# tar -xvjf /usr/local/src/php-5.2.1.tar.bz2 -C /usr/local/
~# cd php-5.2.1
~# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql
~# cp php.ini-dist /usr/local/lib/php.ini

please check on /usr/local/apache2/conf/httpd.conf :
LoadModule php5_module modules/libphp5.so
(--if php has already been install, so this script will be include to httpd--)
and then please add this script :
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps

coba buat script php sederhana atau phpinfo.php untuk memastikan bahwa php & apachenya syncron, atau klo mau coba LAMP berhasil atau tidak bikin guest_book.php :P

note : & --> running process on background mode, so if you close the console then process will remain.

Sorry, this artikel using 2 bahasa, maklum masih belajar :P
 

Iklan

Content Here

My Facebook

Iklan

Content Here