Image does not exist: https://www.maketecheasier.com/assets/uploads/2015/10/apache_ssl_featured.jpg
1. Configure Apache to Support SSL
ກ່ອນອື່ນໃຫ້ເປີດໃຊ້ ssl ດ້ວຍຄຳສັ່ງ
sudo a2enmod ssl
ຫລັງຈາກນັ້ນແມ່ນໃຫ້ Restart Apache
sudo service apache2 restart
2. Generate a Self-signed Certificate
ສ້າງ Ca ດ້ວຍຕົນເອງ
sudo openssl genrsa -out ca.key 2048
sudo openssl req -nodes -new -key ca.key -out ca.csr
Image does not exist: https://www.maketecheasier.com/assets/uploads/2015/10/apache_ssl.jpg
ເຊັນຄີ ແລະ ກຳນົດອາຍຸໃສ່
sudo openssl x509 -req -days 365 -in ca.csr -signkey ca.key -out ca.crt
ສ້າງໂຟນເດີເພື່ອເກັບໄຟ certificate.
sudo mkdir /etc/apache2/ssl
ຕໍ່ມາໃຫ້ກອບປີໄຟລ certificate ໄວ້ທີ່ “/etc/apache2/ssl”
sudo cp ca.crt ca.key ca.csr /etc/apache2/ssl/
3. Configure Apache to Use the SSL Certificate
ແກ້ໄຂໄຟລ virtual host .
sudo nano /etc/apache2/sites-enable/000-default.conf
ເພີ່ມໂຄດນີ້
<VirtualHost *:443> ServerAdmin webmaster@localhost DocumentRoot /var/www/html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined SSLEngine on SSLCertificateFile /etc/apache2/ssl/ca.crt SSLCertificateKeyFile /etc/apache2/ssl/ca.key </VirtualHost>
ບັນທຶກ ແລະ restart Apache.
sudo /etc/init.d/apache2 restart
4. Testing Apache (HTTPS) Server
ລອງເຂົ້າເວັບໄຊທາງ IP Address (ກັບ“https://,” ຕົວຢ່າງ: “https://192.168.1.227”).
[tag]ssl, apache2, linux, ubuntu[/tag]