Linux: Install Apache 2.2.8, mod_perl, php 5.2.6

June 16 | Posted by Muhammad Yusuf E. | Linux Software Tags: , , , , ,

Bagi yang memakai OS Linux atau FreeBSD, terkadang harus melakukan upgrade softwarenya. Apalagi apabila ada suatu hal yang berhubungan dengan security hole atau software yang harus dijalankan dalam versi tertentu, maka menginstall dengan paket source harus dilakukannya. Dalam tulisan ini penulis akan menampilkan bagaimana menginstall Apache 2.2.8 yang dilengkapi dengan mod_perl dan PHP 5.2.6.
Dalam percobaan ini penulis memakai server Red Hat Enterprise 4, yang barangkali mirip dengan versi Fedora 8.

Persiapan
Untuk melakukan installing, pertama-tama adalah mendownload software yang diperlukan seperti berikut ini.
Tergantung posisi anda ada di negara mana, silakan download dari tempat anda yang paling dekat.

# wget http://archive.apache.org/dist/httpd/httpd-2.2.8.tar.gz
# wget http://perl.apache.org/dist/mod_perl-2.0-current.tar.gz
# wget http://us2.php.net/get/php-5.2.6.tar.gz/from/www.php.net/mirror

Setelah semua didownload seperti di atas, maka persiapan installing sudah selesai.

Urutan Installing
Urutan installing adalah seperti berikut ini.
1. Apache
2. mod_perl atau php

Install Apache
ekstrak source file seperti berikut ini dan lakukan compile dengna option di bawah ini.
Option silakan dilihat dengan perintah ./configure –help

# tar xvfz httpd-2.2.8.tar.gz
# cd httpd-2.2.8
# ./configure --with-layout=Apache \
--prefix=/usr/local/apache \
--enable-so \
--enable-shared=yes \
--enable-mime_magic \
--enable-auth_anon \
--enable-auth_db \
--enable-usertrack \
--enable-rewrite \
--enable-unique_id \
--enable-max \
--with-perl=/usr/bin/perl \
--enable-perl \
--enable-cgi \
--enable-cgid \
--enable-dav \
--enable-dav-fs \
--enable-dav-lock \
--enable-vhost-alias \
--enable-modules=all \
--enable-ssl \
--with-ssl=/usr/share/ssl

Apache akan terinstall di direktori /usr/local/apache.
Apache dapat kita jalankan seperti berikut ini,

# /usr/local/apache/bin/apachectl start
# /usr/local/apache/bin/apachectl stop
# /usr/local/apache/bin/apachectl restart

Sudah tentu kalau anda mempunyai Apache yang masih jalan, perlu distop terlebih dahulu, sehingga apache yang baru dapat memakai port 80.

Anda cek dengan browser anda, apakah terlihat http://ipaddress_anda/.
Kalau terlihat ok berarti.

Install mod_perl
ekstrak file mod_perl-2.0-current.tar.gz dengan perintah berikut ini,

# tar xvfz mod_perl-2.0-current.tar.gz

Untuk menginstall mod_perl anda dapat lakukan seperti berikut ini,

# cd mod_perl-2.0.4
# perl Makefile.PL MP_APXS=/usr/local/apache/bin/apxs
# make
# make install

Ingat !! Kalau anda mempunyai rpm mod_perl-devel atau mod_perl, maka terlebih dahulu harus dihapus.
Hapus dengan perintah berikut ini,

Periksa versi paket mod_perlnya seperti berikut,

# rpm -qa | grep mod_perl

Untuk ES 4, biasanya versi rpmnya adalah dihapus dengan perintah seperti ini.

# rpm -e mod_perl-devel-1.99_16-4.5 mod_perl-1.99_16-4.5

Kalau mod_perl sudah terinstall dengan baik, masukkan loadmodule di bawah ini di /usr/local/apache/httpd.conf.

LoadModule perl_module modules/mod_perl.so

Restart apache anda, periksa di file error_log apakah ada module [ mod_perl/2.0.4 ] di lognya.

[Tue Jun 17 05:55:24 2008] [notice] Apache/2.2.8 (Unix) mod_ssl/2.2.8 OpenSSL/0.9.7a DAV/2 mod_perl/2.0.4 Perl/v5.8.5 configured -- resuming normal operations

Kalau ada, berarti sukses.

Install PHP 5.2.6

Untuk menginstall php, anda sebelumnya harus dapat menentukan letak database dan library yang anda miliki. Dalam percobaan ini, letak mysql dan postgresql adalah di direktori /usr. Dan library pun terletak di /usr.
Ekstrak php sourcenya dengan perintah berikut ini, dan lakukan installing.

# tar xvfz php-5.2.6.tar.gz
# cd php-5.2.6
# ./configure --prefix=/usr/local \
--bindir=/usr/local/bin/ \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-mysql=/usr \
--with-pgsql=/usr \
--enable-mbstr-enc-trans \
--enable-mbstring \
--enable-mbregex \
--enable-track-vars \
--with-freetype-dir=/usr \
--with-png-dir=/usr \
--with-gd \
--enable-gd-native-ttf \
--with-ttf \
--with-gettext \
--with-ncurses \
--with-gmp \
--with-iconv \
--with-jpeg-dir=/usr \
--with-openssl \
--with-png-dir=/usr \
--with-pspell \
--with-regex \
--with-xml \
--with-libxml-dir=/usr \
--with-expat-dir=/usr \
--with-zlib \
--with-layout=GNU \
--enable-bcmath \
--enable-exif \
--enable-ftp \
--enable-magic-quotes \
--enable-safe-mode \
--enable-sockets \
--enable-sysvsem \
--enable-sysvshm \
--enable-discard-path \
--enable-track-vars \
--enable-trans-sid \
--enable-yp \
--enable-wddx \
--enable-mbstring \
--enable-mbstr-enc-trans \
--enable-mbregex \
--without-oci8 \
--with-pear=/usr/local/share/pear \
--with-kerberos=/usr/kerberos \
--with-ldap \
--enable-memory-limit \
--enable-bcmath \
--enable-shmop \
--enable-calendar \
--enable-dbx \
--enable-dio \
--with-pdo-mysql=/usr \
--with-pdo-pgsql=/usr \
--enable-mcal
# make
# make install

Kalau tidak ada masalah atau error masukkan setting php di bawah ini di httpd.conf.

AddType application/x-httpd-php .php

Restart Apache dan periksa error_log di bawah ini.

[Tue Jun 17 05:55:24 2008] [notice] Apache/2.2.8 (Unix) mod_ssl/2.2.8 OpenSSL/0.9.7a DAV/2 PHP/5.2.6 mod_perl/2.0.4 Perl/v5.8.5 configured -- resuming normal operations

Kalau module PHP/5.2.6 terdekteksi dengan baik, maka module php telah terpasang di Apache.

Langkah berikutnya adalah mengkopi php.ini-dist di /usr/local/etc/php.ini dan restart kembali proses Apache.

Silakan mencoba !!!

Tags: , , , , ,

3 Responses to “Linux: Install Apache 2.2.8, mod_perl, php 5.2.6”

  1. ganool says:

    hmm..
    thx neh tutorial nya..
    agak mumet seh..
    tapi akhirnya selese juga..

  2. one says:

    Tutotialnya berguna banget, thanks untuk yg buat.

    Klo bisa mohon tutorialnya, cara instalasi BugZilla.
    TIA …. :)

    Best regards,
    One

  3. Yusuf says:

    Next time ya ..

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>