Random Post

Two col-left

Home » , » Install Apache2 PHP dan MySQL pada OpenSUSE 11.1 x86_64

Install Apache2 PHP dan MySQL pada OpenSUSE 11.1 x86_64

Written By Unknown on Minggu, 13 November 2011 | 20.51

Download dan Extract semua paket beserta dependency-nya
cd /root

vi files.sh
### isi file file.sh ###
#/bin/bash
#download packages and dependencies

wget http://apache.the.net.id/httpd/httpd-2.2.15.tar.gz
wget http://id.php.net/distributions/php-5.3.1.tar.gz
wget http://downloads.mysql.com/archives/mysql-5.1/mysql-5.1.43.tar.gz
wget ftp://xmlsoft.org/libxml2/libxml2-2.7.7.tar.gz
wget http://www.ijg.org/files/jpegsrc.v8a.tar.gz
wget http://curl.haxx.se/download/curl-7.20.0.tar.gz
wget http://ftp.twaren.net/Unix/NonGNU/freetype/freetype-2.3.12.tar.gz
wget http://www.sfr-fresh.com/unix/privat/openca-base-1.1.0.tar.gz:a/openca-base-1.1.0/src/ext-modules/DBI-1.609.tar.gz
wget http://files.directadmin.com/services/custombuild/libpng-1.2.43.tar.gz
wget http://google-desktop-for-linux-mirror.googlecode.com/files/zlib-1.2.3.tar.gz
wget http://www.libgd.org/releases/gd-2.0.35.tar.gz
wget ftp://ftp.cac.washington.edu/imap/imap-2007e.tar.gz
wget http://openssl.org/source/openssl-0.9.7g.tar.gz

echo "Extracting All Packages"

tar -zxvf httpd-2.2.15.tar.gz
tar -zxvf php-5.3.1.tar.gz
tar -zxvf mysql-5.1.43.tar.gz
tar -zxvf libxml2-2.7.7.tar.gz
tar -zxvf jpegsrc.v8a.tar.gz
tar -zxvf curl-7.20.0.tar.gz
tar -zxvf freetype-2.3.12.tar.gz
tar -zxvf DBI-1.609.tar.gz
tar -zxvf libpng-1.2.43.tar.gz
tar -zxvf zlib-1.2.3.tar.gz
tar -zxvf gd-2.0.35.tar.gz
tar -zxvf imap-2007e.tar.gz
tar -zxvf openssl-0.9.7g.tar.gz

chmod dan eksekusi file.sh
cd /root
chmod 755 files.sh
./files.sh

install c compiler dan dependency-nya
yast -i gcc gcc-c++ ncurses-devel pam-devel automake gettext-tools libtool

buat user mysql
yast

>> Security and Users >> User and Group Management
>>  In Users Section >> tekan tab to ADD a new user
>>>  Input User Full Name "mysql", Username "mysql", Password and Confirm  Password >> OK
>> In Group section >> tekan tab to  ADD a Group
>>> Input Group Name "mysql" >> OK
>>  In users Section >> Edit user "mysql"
>>> In Existing  Local User Choose Details Section
>>> Login Shell Change it  to "/bin/false"
>>> Default Group Change it to "mysql"  >> OK >> OK
>> press f9 to quit yast

Compiling mysql
cd /root/mysql-5.1.43
./configure --prefix=/usr/local/mysql \
--localstatedir=/usr/local/mysql/var  \
--with-pthread --with-big-tables

make && make install

ubah permission mysql dir
chown -R mysql.mysql /usr/local/mysql

Copy mysql cnf files dari direktori  di bawah ke /etc/ dan ubah file ke my.cnf
cd /usr/local/mysql/share/mysql

cp my-small.cnf /etc/my.cnf

Install mysql DB
/usr/local/mysql/bin/mysql_install_db --user=mysql

starting mysql server
/usr/local/mysql/bin/mysqld_safe --user=mysql &

buat mysql root password
/usr/local/mysql/bin/mysqladmin -u root password 'new-password'

kompile OpenSSL 0.9.7g
cd /root/
cd openssl-0.9.7g
./config -fPIC
make depend
make install

tambahkan /usr/local/include di dalam ld.so.conf
vi /etc/ld.so.conf

## tambahkan baris di bawah ##
/usr/local/include

Reload ld.so.conf
ldconfig

Compiling Apache/ HTTPD Web Server
cd /root

cd httpd-2.2.15

./configure --prefix=/usr/local/apache2 \
--enable-so  --enable-mods-shared=most \
--enable-ssl=static  --with-ssl=/usr/local/ssl

make && make install

Compiling Zlib, FreeType, GD, LibXML2,LIBJPEG, LIBPNG, CURL, DBI
cd /root
cd zlib-1.2.3/1.2.3
./configure --shared && make && make install

cd ..
cd freetype-2.3.12
./configure && make && make install

cd ..
cd jpeg-8a
./configure --prefix=/usr/local  --enable-shared
make && make install

cd ..
cd libpng-1.2.43
./configure && make && make install

cd ..
cd curl-7.20.0
./configure && make && make install

cd ..
cd libxml2-2.7.6
./configure && make && make install

cd ..
cd gd-2.0.35

./configure --with-freetype=/usr/local \
--with-jpeg=/usr/local/lib \
--with-png=/usr/local/lib

aclocal

autoreconf -fvi

make && make install

cd ..
cd DBI-1.609
perl Makefile.PL
make && make install

cd /root
mv imap-2007e /usr/local/
cd /usr/local/imap-2007e
make lnp EXTRACFLAGS="-fPIC"
mkdir include lib
cp src/c-client/*.h include/
cp c-client/c-client.a lib/libc-client.a
cp c-client/osdep.h include/
cp c-client/env_unix.h include/
cp c-client/linkage.h include/

Compiling PHP
cd /root

cd php-5.3.1

./configure --with-apxs2=/usr/local/apache2/bin/apxs \
--with-mysql=/usr/local/mysql  \
--with-gd=/usr/local \
--with-jpeg-dir=/usr/local/lib \
--with-zlib-dir=/usr/local  \
--enable-ftp \
--with-png-dir=/usr/local/lib \
--with-freetype-dir=/usr/local  \
--with-curl=/usr/local \
--with-imap=/usr/local/imap-2007e \
--with-imap-ssl=/usr/local/ssl  \
--enable-mbstring

make && make install

Copy php.ini
cp php.ini-production /usr/local/lib/php.ini

Konfigurasi php.ini

### pastikan ###

open_short_tag = On

konfigurasi httpd.conf agar support PHP
cd /usr/local/apache2/conf/

vi httpd.conf

### pastikan baris di bawah ini ada ###
LoadModule  php5_module        modules/libphp5.so

### tambahkan baris berikut ###
AddType application/x-httpd-php  .php

### pastikan direktory indexnya sebagai berikut ###
DirectoryIndex index.php index.html

matikan service httpd yang sedang berjalan
cek dengan ps aux lihat noPID httpd yang sedang berjalan
kill [no PID]

uninstall apache default
rpm -qa |grep apache

rpm -e apache2-2.2.10-2.9.1 apache2-utils-2.2.10-2.9.1 apache2-prefork-2.2.10-2.9.1 --nodeps

jalankan httpd
/usr/local/apache2/bin/apachectl  start

tambahkan Apache and MySQL  pada Boot.local Init Script
vi /etc/init.d/boot.local

### tambahkan baris di bawah pada boot.local ###
/usr/local/apache2/bin/apachectl  start
/usr/local/mysql/bin/mysqld_safe --user=mysql &

buat file info.php
cd /usr/local/apache2/htdocs

vi info.php

### isikan baris berikut ###

## save this file ##

akses dari web browser client

http://yourdomain/info.php

atau cek dari console
smkdt:~ # php -v
PHP 5.3.1 (cli) (built: Jul  8 2010 00:11:26)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies
Share this article :

0 komentar:

Posting Komentar

 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Blog SMK DARUT TAQWA - All Rights Reserved
Template Modify by Creating Website
Proudly powered by Blogger