Skip to content

Instantly share code, notes, and snippets.

@halfsight5000
Created November 3, 2016 03:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save halfsight5000/879eb302b76faca62f2422877f583fba to your computer and use it in GitHub Desktop.
Save halfsight5000/879eb302b76faca62f2422877f583fba 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