Belajar Membuat SSL Self Sign Certificate di Centos 7
Pada kesempatan kali ini kita akan belajar membuat SSL Self Sign Certificate di Centos 7. Artikel ini adalah lanjutan dari Artikel sebelumnya yaitu Cara Install Apache Web Server di Centos 7. Buat kalian yang belum install Apache Web Server silahkan lihat pada Artikel tersebut.
SSL atau Secure Socket Layer adalah teknologi yang digunakan untuk mengamankan proses transmisi data dari server ke browser yang berlangsung di dalam sebuah website. Jika sebelumnya kita mengakses sebuah Website menggunakan protokol HTTP maka dengan menggunakan SSL kita dapat menggunakan HTTPS, dengan menggunakan SSL website lebih secure.
Self Sign Certificate merupakan sertifikat yang dibuat sendiri dan kemudian menyetujuinya (signed) sendiri juga. Self Signed Certificate bermanfaat misalnya untuk keperluan internal atau proses development website yang kedepannya akan menggunakan SSL.
Pada tutorial kali ini kita akan belajar bagaimana cara Install dan konfigurasi SSL Certificate di Centos 7 server menggunakan webserver Apache. Oke langsung saja ikuti step by step cara installasinya.
Install OpenSSL
Silahkan jalankan perintah dibawah ini untuk Install paket module ssl dan openssl.
[root@centos ~]# yum install -y mod_ssl openssl
[root@centos ~]# cd /etc/pki/tls/certs/
[root@centos certs]# openssl genrsa -aes128 > server.key
Generating RSA private key, 2048 bit long modulus
...................+++
....+++
e is 65537 (0x10001)
Enter pass phrase:[Masukan Password]
Verifying - Enter pass phrase:[Masukan Password]
[root@centos certs]# openssl rsa -in server.key -out server.key
Enter pass phrase for server.key:
writing RSA key
[root@centos certs]# openssl req -utf8 -new -key server.key -out server.csr
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) [XX]:IN
State or Province Name (full name) []:Jawa Barat
Locality Name (eg, city) [Default City]:Jakarta
Organization Name (eg, company) [Default Company Ltd]:PT.Contoh
Organizational Unit Name (eg, section) []:IT
Common Name (eg, your name or your server's hostname) []:contoh.com
Email Address []:admin@contoh.com
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []: [ENTER]
An optional company name []: [ENTER]
[root@centos certs]# openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 3650
Signature ok
subject=/C=IN/ST=Jawa Barat/L=Jakarta/O=PT.Contoh/OU=IT/CN=contoh.com/emailAddress=admin@contoh.com
Getting Private key
[root@centos certs]# chmod 600 server.key
[root@centos certs]# cp server.key /etc/pki/tls/private/
[root@centos certs]# nano /etc/httpd/conf.d/ssl.conf
# Server Certificate:
# Point SSLCertificateFile at a PEM encoded certificate. If
# the certificate is encrypted, then you will be prompted for a
# pass phrase. Note that a kill -HUP will prompt again. A new
# certificate can be generated using the genkey(1) command.
SSLCertificateFile /etc/pki/tls/certs/server.crt
# Server Private Key:
# If the key is not combined with the certificate, use this
# directive to point at the key file. Keep in mind that if
# you've both a RSA and a DSA private key you can configure
# both in parallel (to also allow the use of DSA ciphers, etc.)
SSLCertificateKeyFile /etc/pki/tls/private/server.key
[root@centos certs]# nano /etc/httpd/conf.d/contoh.conf
<VirtualHost *:443>
SSLEngine on
SSLCertificateFile /etc/pki/tls/certs/server.crt
SSLCertificateKeyFile /etc/pki/tls/private/server.key
DocumentRoot /var/www/html/website1
ServerName www.contoh.com
ServerAlias contoh.com
ServerAdmin root@contoh.com
ErrorLog logs/virtual.host_log
CustomLog logs/virtual.host-access_log combined
</VirtualHost>
[root@centos certs]# systemctl restart httpd
[root@centos ~]# firewall-cmd --add-service=https --permanent
success
[root@centos ~]# firewall-cmd --reload
success
Pengetesan
Setelah kita selesai mengkonfigurasi SSL Certificate saatnya kita akan melakukan pengetesan. Untuk pengetesan silahkan akses website Anda menggunakan browser pada PC Client lalu masukan pada url menggunakan https://www.domainanda.com jika muncul peringatan pada browser abaikan saja kemudian Klik Advanced lalu Klik pada bagian Accept the Risk and Continue.
Demikian kira-kira tutorial Belajar Membuat SSL Self Sign Certificate di Centos 7 Server ini saya buat. Semoga bermafaat untuk kita semua. Silahkan Share Jika Kalian merasa postingan ini bermanfaat. Sekian & Terimakasih Salam.
Terima kasih pak materinya, saya sedang belajar konfigurasi linux server menggunakan centos dan terbantu dengan adanya artikel ini. Terima kasih pak.
BalasHapusThe customers might be on the lookout for encryption software program as well. Your private 우리카지노 info is effective, and hackers shouldn't have access to it. Before a on line casino can seem on our website, our specialists study it utilizing the five pillars listed under. Our specialists use hard details to guide their assessments, studying the phrases and conditions and half in} with the on line casino.
BalasHapus