tantos

nek wedi ojo wani-wani, nek wani ojo wedi-wedi

Installing Apache 2, MySQL 5.1, and PHP 5.2 from Source in Ubuntu 9.04 (Jaunty)

October11

[ad#ad-posttext]

Here we go. I made this post based on my experience installing Apache 2, MySQL 5.1, and PHP 5.2 from apt-get and always get error when installing MySQL 5.1. Then I must install them from sources.

Before we begin, make sure you already download source of Apache 2, MySQL 5.1, and PHP 5.2.

Download Apache HTTP Server
Download MySQL Server
Download PHP

After the download completed, lets install them…

Assume this installation guide using :
Apache HTTP Server version 2.2.13
MySQL Server version 5.1.39
PHP version 5.2.11

If you get different version, just replace it’s version number :)

This code is ready to use, you can just paste it into your terminal/console.

Install Mysql 5.1
Open terminal, and change the directory to the download folder.
Do the following command :

#!/bin/bash
###login as root :
sudo su

###extract it :
tar -zxvf mysql-5.1.39.tar.gz

###change to the mysql extraction directory :
cd mysql-5.1.39

###adding mysql group :
groupadd mysql

###adding mysql user :
useradd mysql -g mysql

###create a directory for mysql pid file :
mkdir /var/run/mysqld

###change its owner to mysql :
chown -R mysql.mysql /var/run/mysqld

###create a directory for mysql data :
mkdir /var/mysqldata

###change its owner to mysql :
chown -R mysql.mysql /var/mysqldata

###configuring mysql :
./configure --prefix=/usr/local/ --localstatedir=/var/mysqldata --with-mysqld-user=mysql --with-unix-socket-path=/var/run/mysqld/mysqld.sock --with-plugins=innobase --without-docs --without-man

###make it :
make

###install it :
make install

###copying mysql.server file to /etc/init.d/mysql in order to automatically starting mysql-server each computer start :
cp support-files/mysql.server /etc/init.d/mysql

#make it executable
chmod +x /etc/init.d/mysql

#make it automatic start
update-rc.d mysql defaults

###starting mysql server manually :
/etc/init.d/mysql start

###install default mysql database :
mysql_install_db

Install Apache 2
Open terminal, and change the directory to the download folder.
Do the following command :

#!/bin/bash
###login as root :
sudo su

###extract it :
tar -zxvf httpd-2.2.13.tar.gz

###change to the apache extraction directory :
cd httpd-2.2.13

###configure it :
./configure --enable-so --enable-mime-magic --enable-rewrite --with-mpm=prefork

###make it :
make

###install it :
make install

###copying apachectl file to /etc/init.d/httpd in order to automatically starting Apache HTTP Server each computer start :
cp support/apachectl /etc/init.d/httpd

#make it executable
chmod +x /etc/init.d/httpd

#make it automatic start
update-rc.d httpd defaults

Install PHP 5.2
Open terminal, and change the directory to the download folder.
Do the following command :

#!/bin/bash
###login as root :
sudo su

###extract it :
tar -zxvf php-5.2.11.tar.gz

###change to the PHP extraction directory :
cd php-5.2.11

###configure it :
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-mysqli --with-gd --enable-gd-native-ttf --enable-json --enable-zip --enable-mbstring --with-mcrypt --disable-ipv6 --enable-calendar --with-config-file-path=/usr/local/etc --enable-exif --enable-magic-quotes --with-zlib --with-iconv --with-freetype-dir=/usr --with-jpeg-dir=/usr --with-png-dir=/usr --with-bz2

###make it :
make

###install it :
make install

Finally, start Apache HTTP Server manually :

/etc/init.d/httpd start

Now, you can test your installation by typing

http://localhost/

in your favorite browser. If it displays It works!, it must be success!
Not : Place your PHP or HTML files to

/usr/local/apache2/htdocs

If you get your installation failure, don’t be hesitate to ask here.

[ad#ad-post]

Related posts:

  1. Membuat Autentikasi user menggunakan Apache
  2. Membuat Virtual Host pada server lokal
  3. Installing Firefox 3.5 in Ubuntu (not from Repository)
  4. How To : Internet Connection using CDMA EVDO Modem and Karmic Koala (Ubuntu 9.10)
  5. How To : Karmic Koala and Canon PIXMA iP1800-iP1900
3 Comments to

“Installing Apache 2, MySQL 5.1, and PHP 5.2 from Source in Ubuntu 9.04 (Jaunty)”

  1. Avatar November 4th, 2009 at 1:32 pm nida Says:

    thanks banget infonya…..


  2. Avatar September 14th, 2010 at 2:24 pm maul_oke Says:

    :cystg php 5.2.14 kok gak bisa di make gan? gimana dong?


  3. Avatar February 20th, 2011 at 10:20 am sufehmi Says:

    Ada beberapa dependencies yang musti dipasang terlebih dahulu, kalau tidak maka PHP akan gagal di compile :)

    Untung caranya mudah, yaitu cukup ketik perintah berikut ini :

    sudo apt-get install libbz2-dev libmagic-dev libmcrypt-dev libmysqlclient-dev

    (libmagic-dev dipasang karena saya perlu pasang extension fileinfo di PHP 5.2, mungkin Anda tidak perlu)

    Thanks untuk artikelnya. :2thumbup


Email will not be published

Website example

Your Comment:

[+] kaskus emoticons