Welcome

Welcome, thanks to look my blog

Tuesday 18 March 2014

Install LAMP di centos 6.4 dan 5.5

Apaan sih LAMP??
pastinya agan-agan sudah pada tahu..apa itu LAMP? yupz LAMP itu singkatan dari (Linux,Apache,Mysql,PHP) merupakan sebuah paket perangkat lunak bebas yang di gunakan untuk menjalankan sebuah aplikasi secara lengkap adapun komponen-komponen dari LAMP ;

- Linux sebagai operating system
- Apache Http server sebagai web server
- Mysql sebagai system basis data
- Perl atau PHP atau Phyton sebagai bahasa pemrogaman yang di pakai

ok cukup untuk penjelasan nya,kita langsung cara installasi nya

1.Install Mysql

[root@kulinuxer ~]#yum install mysql mysql-server -y

Setelah penginstallan selesai lalu jalankan lagi perintah

[root@kulinuxer ~]#/etc/init.d/mysqld start
[root@kulinuxer ~]#chkconfig mysqld on

Perintah di atas adalah untuk menjalankan mysql secara otomatis setiap kali restart
Lalu kita setting password untuk Mysql nya dengan cara

[root@kulinuxer ~]#/usr/bin/mysql_secure_installation

dan tampilan nya akan seperti ini ;

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):     ## Tekan Enter ## 
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

Set root password? [Y/n]     ## Tekan Enter ##
New password:                ## Password untuk Mysql ##
Re-enter new password:       ## ulangi password ##
Password updated successfully!
Reloading privilege tables..
 ... Success!

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]     ## Tekan Enter ##
 ... 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]     ## Tekan Enter ## 
... 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]     ## Tekan Enter ##
 - 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]     ## Tekan Enter ##
 ... 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!


nah untuk tahap penginstalan Mysql udah selesai gan,lanjutt :D

2.Install Apache

[root@kulinuxer ~]#yum install httpd -y

tunggu sampe penginstallan selesai...biarin aj gan :P
nah seperti biasa,lakukan lagi

[root@kulinuxer ~]#/etc/init.d/httpd start
[root@kulinuxer ~]#chkconfig httpd on

tau kan gan perintah di atas untuk apa,yang tadi saya jelaskan .....
sebelum agan test apakah apache ini berjalan apa tidak via browser dengan mengetik "http://IPaddress" yang agan pakek 'Contoh http://192.168.1.200'

nah di sini agan harus menonaktifkan dulu SELINUX dan Firewall nya (disini sih biasanya yang sering saya temukan error) pada saat kita mau test apache nya.
cara nya dengan ;

[root@kulinuxer ~]#vi /etc/selinux/config

lalu agan cukup merubah

# This file controls the state of SELinux on the system.

# SELINUX= can take one of these three values:

# enforcing – SELinux security policy is enforced.

# permissive – SELinux prints warnings instead of enforcing.

# disabled – No SELinux policy is loaded.

SELINUX= # dari enforcing menjadi disable#

# SELINUXTYPE= can take one of these two values:

# targeted – Targeted processes are protected,

# mls – Multi Level Security protection.

SELINUXTYPE=targeted

Lalu disable Firewall nya :

eiitt sebentar,biar lebih mudah nya menonaktifkan firewall kita bisa gunakan cara menginstall dlu konfigurasi firewall nya,

[root@kulinuxer ~]#yum install system-config-securitylevel
[root@kulinuxer ~]#system-config-firewall

Atau

[root@kulinuxer ~]#system-config-firewall-tui

dan akan tampil seperti ini;


agan cukup tekan spasi untuk menghilangkan tanda * lalu Tab untuk memindahkan kursor ke ok dan setelah itu tekan Enter.Nah silahkan agan test apache via browser dengan mengetik "http://IPaddress" yang agan pake.dan pasti tampilan nya akan seperti ini.


ok.lanjut

3.Install PhP

[root@kulinuxer ~]#yum install php -y

lalu restart apache nya

[root@kulinuxer ~]#/etc/init.d/httpd restart

dan Test membuat file di Apache Documents

[root@kulinuxer ~]#vi /var/www/html/testphp.php

isikan code ini ;

<?php
phpinfo();
?>

didalam testphp.php tersebut.
Lalu buka lagi browser agan dan mengetik lagi http://IPaddres/testphp.php


dan untuk tambahan nya di sini saya akan meginstallkan phpmyadmin nya ;
tapi sebelum nya kita download dan install dulu EPEL Repository first
dengan cara ;

[root@kulinuxer ~]#wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
[root@kulinuxer ~]#rpm -ivh epel-release-6-8.noarch.rpm

Install phpmyadmin

[root@kulinuxer ~]#yum install phpmyadmin -y

Setting Konfigure phpmyadmin

[root@kulinuxer ~]#vi /etc/httpd/conf.d/phpMyAdmin.conf

Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin

###Tambahkan tanda (#) dibagian depan nya dengan cara seperti dibawah ini ; ###
#<Directory /usr/share/phpMyAdmin/>
#   <IfModule mod_authz_core.c>
#     # Apache 2.4
#     <RequireAny>
#       Require ip 127.0.0.1
#       Require ip ::1
#     </RequireAny>
#   </IfModule>
#   <IfModule !mod_authz_core.c>
#     # Apache 2.2
#     Order Deny,Allow
#     Deny from All
#     Allow from 127.0.0.1
#     Allow from ::1
#   </IfModule>
#</Directory>

Save dan seteleh itu agan buka lagi “config.inc.php”  untuk merubah “cookie” menjadi “http”
buat copy an nya dahulu

[root@kulinuxer ~]# cp /usr/share/phpMyAdmin/config.sample.inc.php /usr/share/phpMyAdmin/config.inc.php
[root@kulinuxer ~]#vi /usr/share/phpMyAdmin/config.inc.php
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'http';

setelah itu restart dahulu Apache nya

[root@kulinuxer ~]#/etc/init.d/httpd restart

dan sekartang buka lagi browser akang lalu ketikan lagi http://IPaddress atau domain/phpmyadmin


akan muncul tampilan diatas dan akan meminta username dan password mysql yang agan tadi masukan
selanjut nya jikan username dan password agan benar pasti akan ada tampilan seperti ini ;



Ok untuk installasi LAMP di Centos 6.4 cukup sampai disini dlu,berhubung mata saya sudah 5watt juga.mudah-mudahan tutorial ini berguna dan bermanfaat.
sumber : http://www.unixmen.com/install-lamp-server-in-centos-6-4-rhel-6-4/

salam hangat

Kulinuxer

No comments:

Post a Comment