news image
news 29 Agustus 2017

LAMP merupakan singkatan dari Linux, Apache, MySQL dan PHP adalah sebuah set instalasi yang sangat populer untuk sebuah web server yang mendukung PHP dan MySQL.

Untuk masuk ke dalam root dan mengakses SSH pada VM CentOS VM anda, silahkan mengikuti tutorial kami berikut :

http://faq.biznetgiocloud.com/index.php?action=artikel&cat=11&id=104&artlang=id&highlight=ssh

Langkah Pertama – Install Apache

Apache adalah open source software gratis yang berjalan pada lebih dari 50 % web server di dunia.Untuk menginstall Apache, buka terminal dan ketikkan command berikut:

yum install httpd -y Setelah menginstall itu , anda dapat mulai menjalanka service apache dengan command berikut:

service httpd start Untuk memeriksa apakah apache sudah terinstall dengan baik, buka browser dengan IP publik VM anda (contoh:http://103.58.100.123). Berikut tampilan yang akan tampil jika apache berhasil terinstall:

IMAGES

Anda melihat IP publik yang digunakan oleh VM anda, jalankan command berikut:

curl ifconfig.co

Langkah Kedua – Install MySQL

MySQL adalah sistem manajemen database yang kuat digunakan untuk mengatur dan mengambil data pada server virtual. Untuk menginstal MySQL, buka terminal dan ketik perintah ini :

yum install mysql-server -y service mysqld start Setelah itu, jalankan perintah ini:

_sudo /usr/bin/mysql_secureinstallation Jika anda baru pertama kali menginstal MySQL, silahkan klik enter.

Enter current password for root (enter for none):

OK, successfully used password, moving on... Kemudian pilih y lalu masukkan password untuk MySQL anda.

Set root password? [Y/n] y

New password: Pada proses selanjutnya, tekan enter hingga proses selesai.

By default, a MySQL installation has an anonymous user, allowing anyone

to log into MySQL without having to have a user account created for

them. This is intended only for testing, and to make the installation

go a bit smoother. You should remove them before moving into a

production environment.

Remove anonymous users? [Y/n] y

... Success!

Normally, root should only be allowed to connect from 'localhost'. This

ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y

... Success!

By default, MySQL comes with a database named 'test' that anyone can

access. This is also intended only for testing, and should be removed

before moving into a production environment.

Remove test database and access to it? [Y/n] y

  • Dropping test database...

    ... Success!

  • Removing privileges on test database...

    ... Success!

Reloading the privilege tables will ensure that all changes made so far

will take effect immediately.

Reload privilege tables now? [Y/n] y

... Success!

Cleaning up...

All done! If you've completed all of the above steps, your MySQL

installation should now be secure.

Thanks for using MySQL!

Langkah Ketiga – Install PHP

PHP merupakan open source web dengan bahasa script yang banyak digunakan untuk membangun halaman web dinamis. Untuk menginstal PHP pada VM, ketik perintah ini:

yum install php php-mysql -y PHP juga memiliki berbagai library yang berguna dan modul yang dapat ditambahkan ke server Anda . Anda dapat melihat library yang tersedia dengan mengetik :

yum search php- Terminal kemudian akan menampilkan daftar modul PHP yang sudah terinstall. Maka akan terlihat seperti ini:

php-bcmath.x86_64 : A module for PHP applications for using the bcmath library

php-cli.x86_64 : Command-line interface for PHP

php-common.x86_64 : Common files for PHP

php-dba.x86_64 : A database abstraction layer module for PHP applications

php-devel.x86_64 : Files needed for building PHP extensions

php-embedded.x86_64 : PHP library for embedding in applications

php-enchant.x86_64 : Human Language and Character Encoding Support

php-fpm.x86_64 : PHP FastCGI Process Manager

php-gd.x86_64 : A module for PHP applications for using the gd graphics library

php-imap.x86_64 : A module for PHP applications that use IMAP

php-intl.x86_64 : Internationalization extension for PHP applications

php-ldap.x86_64 : A module for PHP applications that use LDAP

php-mbstring.x86_64 : A module for PHP applications which need multi-byte string

                : handling

php-mysql.x86_64 : A module for PHP applications that use MySQL databases

php-odbc.x86_64 : A module for PHP applications that use ODBC databases

php-pdo.x86_64 : A database access abstraction module for PHP applications

php-pear.noarch : PHP Extension and Application Repository framework

php-pecl-apc.x86_64 : APC caches and optimizes PHP intermediate code

php-pecl-apc-devel.i686 : APC developer files (header)

php-pecl-apc-devel.x86_64 : APC developer files (header)

php-pecl-memcache.x86_64 : Extension to work with the Memcached caching daemon

php-pgsql.x86_64 : A PostgreSQL database module for PHP

php-process.x86_64 : Modules for PHP script using system process interfaces

php-pspell.x86_64 : A module for PHP applications for using pspell interfaces

php-recode.x86_64 : A module for PHP applications for using the recode library

php-snmp.x86_64 : A module for PHP applications that query SNMP-managed devices

php-soap.x86_64 : A module for PHP applications that use the SOAP protocol

php-tidy.x86_64 : Standard PHP module provides tidy library support

php-xml.x86_64 : A module for PHP applications which use XML

php-xmlrpc.x86_64 : A module for PHP applications which use the XML-RPC protocol

php-zts.x86_64 : Thread-safe PHP interpreter for use with the Apache HTTP Server Untuk mengatur proses secara otomatis saat booting Server (php akan berjalan secara otomatis setelah Apache dimulai), jalankan perintah berikut:

sudo chkconfig httpd on sudo chkconfig mysqld on Langkah Keempat Untuk membuat sebuah file php, buatlah file baru:

vi /var/www/html/info.php Tambahkan perintah berikut :

<?php

phpinfo();

?> Setelah itu simpan dan keluar.

Restart apache dan semua perubahan sudah tersimpan pada server Anda :

service httpd restart Setelah itu, akses ip publik anda melalui browser http://ippublik/info.php

IMAGES

Demikian langkah – langkah untuk menginstall LAMP pada CentOS 6.