Latest News

Membangun Webserver Linux, Apache, Mysql, Php Di Ubuntu Server



Cara gampang Membangun WebServer Linux dengan Ubuntu Server, adapun beberapa hal yang harus dilakukan ialah sbb :
  • Install Apache dan MySQL
  • Install PHP
  • Install PHP-Module
  • Pengetesan

Step 1. Install Apache dan MySQL


 sudo apt-get update    sudo apt-get install apache2 libapache2-mod-php5  sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql 

Pada ketika melaksanakan installasi Mysql, akan diminta memasukan password Root-MySQL, namun kalau kita melewatinya, dapat mengubahnya memakai command sbb :

 sudo mysql_install_db   

Jalankan command MySQL secure installation.

 sudo /usr/bin/mysql_secure_installation 

Jawab "y" kalau ada pertanyaan.

 Enter current password for root (enter for none):     OK, successfully used password, moving on...    Remove anonymous users? [Y/n] y                           ... Success!    Disallow root login remotely? [Y/n] y    ... Success!    Remove test database and access to it? [Y/n] y     - Dropping test database...     ... Success!     - Removing privileges on test database...     ... Success!    Reload privilege tables now? [Y/n] y     ... Success!    Cleaning up...   

Step 2. Install PHP


Selanjutnya melaksanakan install PHP, yang akan mengeksekusi file-file koding php, yang nantinya akan ditampilkan oleh Apache kedalam webbrowser.

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

Tambahkan file index.php pada file.

 sudo nano /etc/apache2/mods-enabled/dir.conf   


 <IfModule mod_dir.c>         DirectoryIndex index.php index.html index.cgi index.pl index.php index.xhtml index.htm    </IfModule>   


Step 3. Install PHP-Module

Ada banyak php-module yang tersedia, dan hal ini dimaksudkan untuk mendukung koding yang ada pada website yang nantinya akan kita upload.

 apt-cache search php5-   

Berikut daftar module yang dapat diinstall.

 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-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-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    php5-adodb - Extension optimising the ADOdb database abstraction library    php5-auth-pam - A PHP5 extension for PAM authentication    [...]   

Untuk melaksanakan installnya, cukup apt-get install nama-module, contoh :

 apt-get install php5-memcache php5-apcu php5-curl php5-mcrypt


Cara cek module yang sudah diinstall :

 # dpkg -l |grep php5  ii  libapache2-mod-php5                 5.5.9+dfsg-1ubuntu4.14              amd64        server-side, HTML-embedded scripting language (Apache 2 module)  ii  php5                                5.5.9+dfsg-1ubuntu4.14              all          server-side, HTML-embedded scripting language (metapackage)  ii  php5-apcu                           4.0.2-2build1                       amd64        APC User Cache for PHP 5  ii  php5-cgi                            5.5.9+dfsg-1ubuntu4.14              amd64        server-side, HTML-embedded scripting language (CGI binary)  ii  php5-cli                            5.5.9+dfsg-1ubuntu4.14              amd64        command-line interpreter for the php5 scripting language  ii  php5-common                         5.5.9+dfsg-1ubuntu4.14              amd64        Common files for packages built from the php5 source  ii  php5-curl                           5.5.9+dfsg-1ubuntu4.14              amd64        CURL module for php5  ii  php5-gd                             5.5.9+dfsg-1ubuntu4.14              amd64        GD module for php5  ii  php5-gmp                            5.5.9+dfsg-1ubuntu4.14              amd64        GMP module for php5  ii  php5-imap                           5.4.6-0ubuntu5                      amd64        IMAP module for php5  ii  php5-json                           1.3.2-2build1                       amd64        JSON module for php5  ii  php5-mcrypt                         5.4.6-0ubuntu5                      amd64        MCrypt module for php5  ii  php5-memcache                       3.0.8-4build1                       amd64        memcache extension module for PHP5  ii  php5-mysql                          5.5.9+dfsg-1ubuntu4.14              amd64        MySQL module for php5  ii  php5-readline                       5.5.9+dfsg-1ubuntu4.14              amd64        Readline module for php5  ii  php5-tidy                           5.5.9+dfsg-1ubuntu4.14              amd64        tidy module for php5  ii  php5-xmlrpc                         5.5.9+dfsg-1ubuntu4.14              amd64        XML-RPC module for php5  ii  php5-xsl                            5.5.9+dfsg-1ubuntu4.14              amd64        XSL module for php5  

Step 4. Melakukan Pengetesan PHP

Langkah terakhir ialah melaksanakan pengetesan server.

 sudo nano /var/www/info.php   

Tambahkan baris sbb :

 <?php    phpinfo();    ?>   

Akses webserver dengan URL http://ipaddress-ubuntuserver/info.php

0 Response to "Membangun Webserver Linux, Apache, Mysql, Php Di Ubuntu Server"

Total Pageviews