Skip to content

Instantly share code, notes, and snippets.

@MarkJr94
Forked from halfsight5000/cloud-ssl.conf
Created January 2, 2017 10:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MarkJr94/24e4cabaa159e564b9fbdf3b1b753925 to your computer and use it in GitHub Desktop.
Save MarkJr94/24e4cabaa159e564b9fbdf3b1b753925 to your computer and use it in GitHub Desktop.
owncloud vhost subdomain
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerName sub.domain.com
ServerAlias sub.domain.com
# Next line puts ownCloud at the domain root instead of a /cloud/ subdirectory (e.g. example.com vs. example.com/owncloud/)
Alias /cloud "/var/www/cloud/"
DocumentRoot /var/www/cloud
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLCertificateFile /etc/letsencrypt/live/sub.domain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/sub.domain.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
<Location />
Order allow,deny
Allow from all
</Location>
<Directory /var/www/owncloud/>
Options +FollowSymlinks
AllowOverride All
SetEnv HOME /var/www/cloud
SetEnv HTTP_HOME /var/www/cloud
</Directory>
<IfModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
</IfModule>
</VirtualHost>
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment