Chrome Pointer

Cara Install Linux Apache MySQL PHP (LAMP) Centos 6

Pengertian LAMP

Cara Install Linux Apache MySQL PHP (LAMP) Centos 6 - LAMP kepanjangan dari Linux Apache MySQL PHP/Perl/Phyton, yaitu standart server yang biasanya untuk menjalankan sebuah aplikasi / service berbasis Web secara lengkap.
Komponen LAMP adalah:
  • Linux sebagai Sistem Operasi
  • Apache sebagai Web Server
  • MySQL sebagai Sistem Basisdata
  • Perl/PHP/Phyton sebagai bahasa pemrograman yang dipakai

 Konfigurasi LAMP

1. Install Apache
Apache adalah opensource dari web server yang biasa dipakai di server di dunia. Untuk install Apache menggunakan perintah:

sudo yum install httpd
sudo service httpd start

Untuk cek apakah apache sudah terinstall dengan baik tuliskan di browser http://ipaddress (contoh: http://192.168.1.1)

2. Install MySQL
MySQL adalah system basis data yang sangat bagus untuk manajemen database. Untuk install MySQL menggunakan perintah:

sudo yum install mysql-server
sudo service mysqld start

Setelah selesai proses installasi selanjutnya adalah setting password root mysql:

sudo /usr/bin/mysql_secure_installation

Pertama kali MySQL terinstall password tidak terisi atau kosong maka langsung tekan enter saja:

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Kemudian muncul pernyataan apakah anda ingin setting password anda, jika ya kembali ke tampilan konsole dan ketik "Y" lalu ikuti langkah selanjutnya.
CentOS akan memberikan beberapa pertanyaan  yang meminta jawaban ya atau tidak, untuk mempermudah pilih ya semua.

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!



3. Install PHP
PHP adalah bahasa pemrograman biasanya berbasis web yang sangat multiguna. Untuk menginstall PHP gunakan perintah:

sudo yum install php php-mysql

Kemudian buat otomatis menjalankan service ketika server kita hidup
chksudo chkconfig httpd on
sudo chkconfig mysqld on

Dan server Anda telah terinstall LAMP.
Semoga membantu..

Tutorial - Cara Install SSL Certificate Apache Centos 6

Apa itu SSL Certificate?

 Pengertian

Cara Install SSL Certificate Apache Centos 6 - SSL Certificate adalah sebuat cara untuk mengengkripsi informasi situs shingga membuat situs tersebut lebih aman.
Transmisi data seperti kartu kredit, username dan password adalah informasi yang sensitif yang harus diamankan untuk mencegah pencurian data secara online.
SSL Certificate itu sendiri adalah code rahasia besar, yaitu mulai dari 1024 bit, 2048 hingga 4096bit.
indikasi bahwa terhubung ke situs web aman adalah terdapat https diawal URL-nya.

Sekarang , langsung saja ke Konfigurasinya:

1. Install Mod SSL

Pastikan Apache dan mod_ssl terinstall di server , kemudian install dengan perintah:

yum install mod_ssl

2. Buat Direktori untuk Certificate dan Key

Selanjutnya buat direktori untuk menyimpan Certificate dan Key

mkdir /etc/httpd/ssl

3. Buat Signed Certificate

Ketika kita meminta Certificate baru, kita bisa meminta berapa lama Certificate itu bisa aktif. Disini saya akan menggunakan 365 / 1 tahun artinya jika lebih dari 365hari / 1 tahun maka Certificate tersebut sudah hangus.

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/httpd/ssl/apache.key -out /etc/httpd/ssl/apache.crt

Dengan perintah diatas kita sedang membuat self-signed SSL Certificate dan Server key untuk melindungi server kita dan menempatkan file tersebut ke direktori yang telah kita buat.

Kemudian akan muncul sebuah tampilan beberapa pertanyaan untuk mengumpulkan informasi.
Isi sesuai data yang ada, jangan lupa domain diisi sesuai domain yang akan kita beri keaman.
contoh:
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:US
State or Province Name (full name) [Some-State]:New York
Locality Name (eg, city) []:NYC
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Awesome Inc
Organizational Unit Name (eg, section) []:Dept of Merriment
Common Name (e.g. server FQDN or YOUR name) []:example.com
Email Address []:webmaster@awesomeinc.com

4. Konfigurasi Virtualhosts

Tambahkan virtual hosts agar secara otomatis ketika kita memasukan domain langsung masuk di https bukan http.

nano /etc/httpd/conf/httpd.conf

Tambahkan file ini

ServerAdmin webmaster@
domainmu
DocumentRoot /var/www/dimana direktori rootnya
ServerName
domainmu
SSLEngine On
SSLCertificateFile /etc/httpd/ssl/apache.crt
SSLCertificateKeyFile /etc/httpd/ssl/apache.key
ErrorLog /var/log/httpd/domainsatu.com-error_log
CustomLog /var/log/httpd/domainsatu.com-access_log common

5. Restart Apache


/etc/ini.d/httpd restart


Kemudian cek di browser tuliskan domain anda, apakah langsung masuk di https atau tidak. Jika iya maka konfigurasi berhasil.
Semoga membantu...

Powered by Blogger.