LinMinquan's Blog

Experience technology to change life

apache2 ssl configulation subdomain

Environment: Ubuntu 16.04, Apache 2.4.18, 主域名已经配置好了 ssl ,想给一个二级域名配置 ssl ,证书从 sslforfree.com 那配置下载后,上传到 /etc/apache2/ssl ,在 /etc/apache2/sites-available 里复制主域名已经配置好的 conf 进行修改,见下图。 <IfModule mod_ssl.c> <VirtualHost _default_:443> ServerAdmin account@gl-inet.com ServerName docs.gl-inet.com ServerAlias docs.gl-inet.com DocumentRoot /var/www/newdocs ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined SSLEngine on SSLCertificateFile /etc/apache2/ssl/docs_gl-inet_com_certificate.crt SSLCertificateKeyFile /etc/apache2/ssl/docs_gl-inet_com_private.key SSLCertificateChainFile /etc/apache2/ssl/docs_gl-inet_com_ca_bundle.crt DirectoryIndex index.php index.html <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/gl-inet.com/public_html/docs/> Options -ExecCGI AllowOverride None RemoveHandler .cgi .pl .py .php4 .pcgi4 .php .php3 .phtml .pcgi .php5 . Read more →