Minggu, 20 September 2015

Membuat Server Web dengan Linux Apache2 MySQL5.1 PHP5 - disable SOAP on PHP5

(Original tested on Ubuntu 12.04, Also TESTED ON Ubuntu 15.04 with upgrade dependencies)

Download paket – paket aplikasi yang akan digunakan pada server adalah sebagai berikut :
  1. httpd-2.4.3.tar.gz (Apache2) –> http://apache.tradebit.com/pub//httpd/httpd-2.4.3.tar.gz
  2. mysql-5.0.83.tar.gz –> http://mirror.provenscaling.com/mysql/community/source/5.0/mysql-5.0.83.tar.gz
  3. php-5.4.11.tar.gz –> http://www.php.net/get/php-5.4.11.tar.gz/from/id1.php.net/mirror
  4. zlib-1.2.7.tar.g –> http://zlib.net/zlib-1.2.7.tar.gz
  5. libpng-1.2.50.tar.gz –> http://prdownloads.sourceforge.net/libpng/libpng-1.2.50.tar.gz?download
  6. GD_2_0_33.tar.gz –> https://bitbucket.org/pierrejoye/gd-libgd/get/GD_2_0_33.tar.gz
  7. apr-util-1.5.1.tar.gz –> http://mirror.symnds.com/software/Apache//apr/apr-util-1.5.1.tar.gz
  8. apr-1.4.6.tar.gz –> http://mirror.symnds.com/software/Apache//apr/apr-1.4.6.tar.gz
  9. pcre-8.32.tar.gz –> http://sourceforge.net/projects/pcre/files/pcre/8.32/pcre-8.32.tar.gz/download
Download dapat menggunakan perintah :
# wget link
Rename nama paket untuk memudahkan pengenalan paket :
# mv mirror php-5.4.11.tar.gz
# mv libpng-1.2.50.tar.gz?download libpng-1.2.50.tar.gz
# mv pcre-8.32.tar.gz/download pcre-8.32.tar.gz

Ekstrak paket – paket yang telah di download :
# tar -zxvf httpd-2.4.3.tar.gz
# tar -zxvf mysql-5.0.83.tar.gz
# tar -zxvf zlib-1.2.7.tar.gz
# tar -zxvf php-5.4.11.tar.gz
# tar -zxvf libpng-1.2.50.tar.gz
# tar -zxvf GD_2_0_33.tar.gz
# tar -zxvf apr-util-1.5.1.tar.gz
# tar -zxvf apr-1.4.6.tar.gz
# tar -zxvf pcre-8.32.tar.gz


Install Compiler C, C++ :

# apt-get install build-essential
Install paket libncurses5-dev jika terjadi >> error: No curses/termcap library found :
# apt-get install libncurses5-dev
Install paket checkinstall untuk memudahkan uninstall paket :
# apt-get install checkinstall

Install paket APR & PCRE yang diperlukan pada saat instalasi apache :
# cd apr-1.4.6/
# ./configure
# make
# make install
# cd ..

# cd apr-util-1.4.1/
# ./configure –with-apr=/usr/local/apr
# make
# make install
# cd ..

# ./configure –prefix=/usr/local/pcre
# make
# make install
# cd ..

Install paker libxml2-dev yang diperlukan pada saat instalasi PHP5 :
# apt-get install libxml2-dev
Instalasi mysql server :
# cd mysql-5.0.83/


# make
# make install
# cd ..


Konfigurasi MySQL :
# useradd -d /usr/local/mysql/var mysql
# chown -R mysql:mysql /usr/local/mysql/
# cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/
# chmod a+x /usr/local/mysql/share/mysql/mysql.server
# /usr/local/mysql/bin/mysql_install_db
# chown -R mysql:mysql /var/lib/mysql/*

Instalasi Paket mysql-client untuk login ke mysql server :
# apt-get install mysql-client

Konfigurasi mysql client >> edit file my.cnf

# nano /etc/mysql/my.cnf
#[client] <– Cari baris ini*
socket = /var/lib/mysql/mysql.sock <– Ubah nilai*
#[mysqld_safe]
socket = /var/lib/mysql/mysql.sock <– Ubah nilai*
#[mysqld] <– Cari baris ini*
#
# * Basic Settings
#
user = mysql
pid-file = /var/lib/mysql/mysql.pid <– Ubah nilai*
socket = /var/lib/mysql/mysql.sock <– Ubah nilai*
port = 3306
basedir = /usr/local/mysql <– Ubah nilai*
datadir = /var/lib/mysql <– Ubah nilai*
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql

tekan ctrl+x -> y -> enter
Setting Password root mysql
# /usr/local/mysql/bin/mysqladmin -u root password ‘[PASS]‘

Instalasi paket Apache2 :
# cd httpd-2.4.3/
# ./configure --prefix=/usr/local/apache2 --enable-module=so --enable-module=log_agent --enable-module=log_referer --enable-module=proxy --enable-module=rewrite --enable-module=speling --enable-module=usertrack --enable-module=vhost_alias --with-pcre=/usr/local/pcre --with-arp=/usr/local/apr
# make
# make install
# cd ..

Instalasi Paket Library
# cd zlib-1.2.7/
# ./configure
# make
# make install
# cd ..

# cd libpng-1.2.50/
# cp scripts/makefile.linux makefile
# make
# make install
# cd ..

# cd pierrejoye-gd-libgd-5551f61978e3/src/
# ./configure
# make
# make install
# cd ..
# cd ..

Instalasi PHP5 :
# cd php-5.4.11/
# ./configure --with-config-file-path=/etc/php5/cli --with-config-file-scan-dir=/etc/php5/cli/conf.d --with-apxs2=/usr/local/apache2/bin/apxs --with-gd --with-zlib --with-mysql=shared,/usr/local/mysql --with-mysqli=shared,/usr/local/mysql/bin/mysql_config --disable-soap

# make
# make install
# cd ..
# echo AddType application/x-httpd-php .php >> /usr/local/apache2/conf/httpd.conf
# echo AddType application/x-httpd-php-source .phps >> /usr/local/apache2/conf/httpd.conf

Membuat startup MySQL dan Apache2
# echo /etc/init.d/mysql.server start >> /etc/rc.local
# echo /usr/local/apache2/bin/apachectl start >> /etc/rc.local

Edit file startup
# nano /etc/rc.local
pindah ‘exit 0′ ke baris paling bawah

Start Program
# /etc/init.d/mysql.server start
# /usr/local/apache2/bin/apachectl start
 

Jika apache berhasil, akses IP Server di Browser dan tampil tulisan ‘It’s Work’
Jika terjadi Error timezone >> ‘It is not safe to rely on the system’s timezone settings’

buat file ‘.htaccess’ di direktori root website, lalu tambahkan baris berikut
php_value date.timezone “Asia/Makassar”

Jika tidak dapat mengakses direktori website pada settingan virtual host ’403 Forbidden’ :
# nano /usr/local/apache/conf/httpd.conf
<Directory /> <– Cari baris ini*
Options FollowSymLinks <– Tambahkan*
AllowOverride ALL <– Tambahkan*
Order deny,allow <– Tambahkan*
Allow from all <– Tambahkan*
</Directory>

<Directory “/usr/local/apache2/htdocs”> <– Cari baris ini*
#
# Possible values for the Options directive are “None”, “All”,
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that “MultiViews” must be named *explicitly* — “Options All”
# doesn’t give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be “All”, “None”, or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride ALL <– Tambahkan*

#
# Controls who can get stuff from this server.
#
Order allow,deny <– Tambahkan*
Allow from all <– Tambahkan*
</Directory>

<IfModule dir_module> <– Cari baris ini*
DirectoryIndex index.php index.html <– Tambahkan*
</IfModule>

<Files “.ht*”> <– Cari baris ini*
Order allow,deny <– Tambahkan*
Allow from all <– Tambahkan*
Satisfy All <– Tambahkan*
</Files>

<Directory “/usr/local/apache2/cgi-bin”> <– Cari baris ini*
AllowOverride ALL <– Tambahkan*
Options None <– Tambahkan*
Order allow,deny <– Tambahkan*
Allow from all <– Tambahkan*
</Directory>

Membuat Server Web dengan Linux Apache2 MySQL5.1 PHP5 - disable SOAP on PHP5 Rating: 4.5 Diposkan Oleh: loliktry

0 komentar:

Posting Komentar

Entri yang Diunggulkan

How To Use Git on oh-my-zsh version

Popular Posts