![]() |
Tạo https cho tên miền trên Ubuntu với web server Apache2 |
#Bật Secure Sockets Layer của apache2
a2enmod ssl
#Khởi động apache2
service apache2 restart
#Tạo thư mục chứa ssl
mkdir /etc/apache2/ssl
#Tạo tập tin xác thực
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/domain.key -out /etc/apache2/ssl/domain.crt
#Thêm vào /etc/apache2/sites-enabled/domain.conf
<VirtualHost *:443>
ServerName domain.com
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/domain.crt
SSLCertificateKeyFile /etc/apache2/ssl/domain.key
</VirtualHost *:443>
#Khởi động apache2
service apache2 restart
EmoticonEmoticon