Thursday, January 18, 2007

Log Instalasi Apache

Posting berikut adalah log instalasi apache secara modular ketika saya mencoba menginstall mapserver. OS yang digunakan adalah Fedora 5. Requirement yang diperlukan untuk sistem pada saat itu adalah kompatibel dengan PHP 5, PDFLib-Lite, Postgis dan Mapserver. Dokumen manual instalasi yang menjadi acuan disini dapat dibaca pada http://mapserver.gis.umn.edu/docs. Sedangkan untuk apachenya sendiri bisa didownload dari http://httpd.apache.org. Pilih file berekstensi '.tar.gz'.

1. Masuk kedalam sistem (menggunakan putty)
Login as: root
root@192.168.228.23's password:
Last login: Sat Dec 30 13:01:00 2006

2. File source apache terletak di folder /usr/local/package_install_frsource
[root@localhost ~]# cd /usr/local/package_install_frsource/
[root@localhost package_install_frsource]#

3. Bersihkan sistem dari instalasi server sebelumnya
[root@localhost ]# rpm -qa | grep httpd
system-config-httpd-1.3.3-1.1
httpd-2.2.0-5.1.2
httpd-manual-2.2.0-5.1.2
[root@localhost package_install_frsource]# rpm -qa | grep httpd | xargs rpm -e
error: Failed dependencies:
httpd-mmn = 20051115 is needed by (installed) php-5.1.2-5.i386
httpd-mmn = 20051115 is needed by (installed) mod_perl-2.0.2-5.1.i386
httpd-mmn = 20051115 is needed by (installed) mod_ssl-2.2.0-5.1.2.i386
httpd-mmn = 20051115 is needed by (installed) mod_python-3.2.8-3.i386
webserver is needed by (installed) webalizer-2.01_10-29.2.1.i386
httpd >= 2.2.0 is needed by (installed) gnome-user-share-0.9-3.i386
httpd = 0:2.2.0-5.1.2 is needed by (installed) mod_ssl-2.2.0-5.1.2.i386
httpd >= 2.0.40 is needed by (installed) mod_python-3.2.8-3.i386
[root@localhost package_install_frsource]# rpm -qa | grep httpd | xargs rpm -e --nodeps
[root@localhost package_install_frsource]# rpm -qa | grep postgresql
postgresql-8.1.3-1
postgresql-libs-8.1.3-1
postgresql-server-8.1.3-1
postgresql-python-8.1.3-1
[root@localhost package_install_frsource]# rpm -qa | grep postgresql | xargs rpm -e
error: Failed dependencies:
libpq.so.4 is needed by (installed) apr-util-1.2.2-4.2.i386
libpq.so.4 is needed by (installed) perl-DBD-Pg-1.43-2.2.2.i386
[root@localhost package_install_frsource]# rpm -qa | grep postgresql | xargs rpm -e --nodeps
[root@localhost package_install_frsource]# rpm -qa | grep php
php-pear-1.4.6-2
php-ldap-5.1.2-5
php-5.1.2-5
[root@localhost package_install_frsource]# rpm -qa | grep php | xargs rpm -e
[root@localhost package_install_frsource]#
[root@localhost package_install_frsource]# rpm -qa | grep php
[root@localhost package_install_frsource]# rpm -qa | grep postgresql
[root@localhost package_install_frsource]# rpm -qa | grep httpd

4. Ekstrak file source
[root@localhost package_install_frsource]#tar -xvzf http-2.2.3.tar.gz
.
.
httpd-2.2.3/Makefile.in
httpd-2.2.3/config.layout
httpd-2.2.3/INSTALL
[root@localhost package_install_frsource]#

5. konfigurasi web server
[root@localhost package_install_frsource]# cd httpd-2.2.3
[root@localhost httpd-2.2.3]# ./configure \
> --prefix=/usr/local/apache2 \
> --enable-deflate \
> --enable-info \
> --enable-mime-magic \
> --enable-rewrite \
> --enable-so \
> --enable-speling \
> --enable-ssl \
> --enable-unique_id \
> --enable-usertrack \
> --with-mpm=prefork
.
.
.
config.status: creating build/rules.mk
config.status: creating build/pkg/pkginfo
config.status: creating build/config_vars.sh
config.status: creating include/ap_config_auto.h
config.status: executing default commands

6. Compiling
[root@localhost httpd-2.2.3]# make
.
.
so.la server/mpm/prefork/libprefork.la os/unix/libos.la -lm /usr/local/package_install_frsource/httpd-2.2.3/srclib/pcre/libpcre.la /usr/local/package_install_frsource/httpd-2.2.3/srclib/apr-util/libaprutil-1.la -lsqlite3 -lexpat /usr/local/package_install_frsource/httpd-2.2.3/srclib/apr/libapr-1.la -luuid -lrt -lcrypt -lpthread -ldl
make[1]: Leaving directory `/usr/local/package_install_frsource/httpd-2.2.3'

6. Installing apache
[root@localhost httpd-2.2.3]# make install
.
.
Installing build system files
Installing man pages and online manual
mkdir /usr/local/apache2/man
mkdir /usr/local/apache2/man/man1
mkdir /usr/local/apache2/man/man8
mkdir /usr/local/apache2/manual
make[1]: Leaving directory `/usr/local/package_install_frsource/httpd-2.2.3'
[root@localhost httpd-2.2.3]#

7. Test hasil instalasi
[root@localhost httpd-2.2.3]# /usr/local/apache2/bin/apachectl start
[root@localhost httpd-2.2.3]#
===
note: ok "It Works!" showed
====

8. Masukkan apachectl dalam service chkconfig
[root@localhost httpd-2.2.3]# cp /usr/local/apache2/bin/apachectl /etc/init.d/.

9. Edit apachectl. Tambahkan tulisan yang bergaris miring
[root@localhost httpd-2.2.3]# vi /etc/init.d/apachectl
#!/bin/sh
#
#chkconfig: - 85 15
#description: Apache is a Web server used to serve HTML and CGI
#processname: httpd
#pidfile: /usr/local/apache2/logs/httpd.pid
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
:wq
[root@localhost httpd-2.2.3]# /sbin/chkconfig --add apachectl

10. Cek chkconfig
[root@localhost httpd-2.2.3]# chkconfig --list | grep apachectl
apachectl 0:off 1:off 2:off 3:off 4:off 5:off 6:off

11. Otomatisasi service apachectl, sehingga pada sistem restart apache daemon akan start secara otomatis
[root@localhost httpd-2.2.3]# chkconfig apachectl on
[root@localhost httpd-2.2.3]# service apachectl restart
[root@localhost httpd-2.2.3]#
====
note: ok "It Works!" still showed
=====

No comments: