ubuntu系统Apache开启SSL

安装启动 ssl 模块

a2enmod ssl
apt-get install openssl

复制到相应目录

cp domain.crt /etc/ssl/certs
cp domain.key /etc/ssl/private

修改配置文件

cp /etc/apache2/sites-enabled/000-default.conf /etc/apache2/sites-enabled/001-ssl.conf

vi /etc/apache2/sites-enabled/001-ssl.conf


SSLEngine On
SSLOptions +StrictRequire
SSLCertificateFile /etc/ssl/certs/domain.com.crt
SSLCertificateKeyFile /etc/ssl/private/domain.com.key
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

 

重启apache

/etc/init.d/apache2 force-reload

/etc/init.d/apache2 restart

 

你可能感兴趣的:(运维)