Setup dan konfigure apache2, mysql, php5, dan phpmyadmin

lakukan update repo :



apt-get update && apt-get upgrade



Install Apache2.

Lakukan perintah berikut untuk install apache2:



apt-get install apache2



Setelah terinstall apache bisa dicek status nya dengan :



service apache2 status

service apache2 start

service apache2 stop

service apache2 restart



Install PHP

Intalasi php5 dan modul pendukung dengan perintah berikut :



apt-get install php5 libapache2-mod-php5 php5-mcrypt



sekrang edit file /etc/apache2/mods-enabled/dir.conf dan ubah urutan eksekusi file agar apache mengeksekusi file php terlebih dahulu :



vi /etc/apache2/mods-enabled/dir.conf



Ubah urutan index.php ke urutan pertama menjadi :



<IfModule mod_dir.c>

        DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm

</IfModule>



simpan file dan restart apache2



service apache2 restart



beberapa command modul php tambahan yang bisa di tambahkan



apt-cache search php5-



php5-cgi - server-side, HTML-embedded scripting language (CGI binary)

php5-cli - command-line interpreter for the php5 scripting language

php5-common - Common files for packages built from the php5 source

php5-curl - CURL module for php5

php5-dbg - Debug symbols for PHP5

php5-dev - Files for PHP5 module development

php5-gd - GD module for php5

php5-gmp - GMP module for php5

php5-json - JSON module for php5

php5-ldap - LDAP module for php5

php5-mysql - MySQL module for php5

php5-odbc - ODBC module for php5

php5-pgsql - PostgreSQL module for php5

php5-pspell - pspell module for php5

php5-readline - Readline module for php5

php5-recode - recode module for php5

php5-snmp - SNMP module for php5

php5-sqlite - SQLite module for php5

php5-tidy - tidy module for php5

php5-xmlrpc - XML-RPC module for php5

php5-xsl - XSL module for php5

libphp5-embed - HTML-embedded scripting language (Embedded SAPI library)

php5-adodb - Extension optimising the ADOdb database abstraction library

php5-apcu - APC User Cache for PHP 5

php5-enchant - Enchant module for php5

php5-exactimage - fast image manipulation library (PHP bindings)

php5-fpm - server-side, HTML-embedded scripting language (FPM-CGI binary)

php5-gdcm - Grassroots DICOM PHP5 bindings

php5-gearman - PHP wrapper to libgearman

php5-geoip - GeoIP module for php5

php5-gnupg - wrapper around the gpgme library

php5-imagick - ImageMagick module for php5

php5-imap - IMAP module for php5

php5-interbase - interbase/firebird module for php5

php5-intl - internationalisation module for php5

php5-lasso - Library for Liberty Alliance and SAML protocols - PHP 5 bindings

php5-librdf - PHP5 language bindings for the Redland RDF library

php5-mapscript - php5-cgi module for MapServer

php5-mcrypt - MCrypt module for php5

php5-memcache - memcache extension module for PHP5

php5-memcached - memcached extension module for PHP5, uses libmemcached

php5-midgard2 - Midgard2 Content Repository - PHP5 language bindings and module

php5-ming - Ming module for php5

php5-mongo - MongoDB database driver

php5-msgpack - PHP extension for interfacing with MessagePack

php5-mysqlnd - MySQL module for php5 (Native Driver)

php5-mysqlnd-ms - MySQL replication and load balancing module for PHP

php5-oauth - OAuth 1.0 consumer and provider extension

php5-pinba - Pinba module for PHP 5

php5-ps - ps module for PHP 5

php5-radius - PECL radius module for PHP 5

php5-redis - PHP extension for interfacing with Redis

php5-remctl - PECL module for Kerberos-authenticated command execution

php5-rrd - PHP bindings to rrd tool system

php5-sasl - Cyrus SASL Extension

php5-stomp - Streaming Text Oriented Messaging Protocol (STOMP) client module for PHP 5

php5-svn - PHP Bindings for the Subversion Revision control system

php5-sybase - Sybase / MS SQL Server module for php5

php5-tokyo-tyrant - PHP interface to Tokyo Cabinet's network interface, Tokyo Tyrant

php5-vtkgdcm - Grassroots DICOM VTK PHP bindings

php5-xcache - Fast, stable PHP opcode cacher

php5-xdebug - Xdebug Module for PHP 5

php5-xhprof - Hierarchical Profiler for PHP5



Test Konfigurasi PHP :

buat file info.php di root directory website



vi /var/www/html/info.php



dan isi dengan :



<?php

phpinfo();

?>



simpan dan test hasilnya dengan akses



http://namadomain.com/info.php



INstall MySQL

install modul freebsd dengan command :



apt-get install bsdutils



lakukan perintah berikut untuk install mysql:



apt-get install mysql-server php5-mysql



isi password yang muncul dengan password user database yang di inginkan.



Lakukan command secure instalasi mysql:



mysql_secure_installation



Install PHPMyadmin



apt-get install phpmyadmin



agar phpmyadmin bisa di akses melalui web edit file config vhost nya



vi /etc/apache2/sites-available/default.conf

tambahkan line :

<Directory /phpmyadmin >
                Options FollowSymLinks
                AllowOverride None
</Directory> 

Simpan dan keluar.
Lalu symlink kan phpmyadmin nya

ln -s /usr/share/phpmyadmin/ /var/www/html/

simpan dan keluar.
restart apache2 dan cek akses:

http://namadomain.com/phpmyadmin
