Wednesday, February 01, 2017

Apache SSL configuration

/etc/apache2/conf/subdomain.conf

<VirtualHost 1.2.3.4:443>
       ServerName subdomain.domain.net
       ServerAdmin webmaster@domain.net
     
       CustomLog /var/logs/subdomain_access_log combined
       ErrorLog /var/logs/subdomain_error_log
DocumentRoot /home/subdomain
LogLevel warn
<Directory "/home/chapters/subdomain">
  Options Includes ExecCGI FollowSymlinks
AllowOverride All
Order allow,deny
Allow from all
AuthType Basic
AuthName "Restricted Content"
AuthUserFile /etc/apache2/.htpasswd
Require valid-user
</Directory>
SSLEngine on
SSLCertificateFile /tmp/fullchain.pem
SSLCertificateKeyFile /tmp/privkey.pem
SSLCertificateChainFile  /tmp/chain.pem
SSLCACertificateFile  /tmp/cert.pem 
</VirtualHost>