OWNCLOUD http to https redirect

Linux/Unix related issues

OWNCLOUD http to https redirect

Postby darkwiz » 08 Feb 2016 16:57

Edit httpd.conf

Code: Select all
#Listen 443
#uncomment and change the above only for other ports

<VirtualHost 192.168.0.250:80>
RewriteEngine on
ReWriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
</VirtualHost>

<VirtualHost 192.168.0.250:443>
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/owncloud.pem
SSLCertificateKeyFile /etc/apache2/ssl/owncloud.key
DocumentRoot /var/www/owncloud/

Alias /owncloud "/var/www/owncloud/"
<Directory "/var/www/owncloud">
    Options +FollowSymLinks
    AllowOverride All

    <IfModule mod_dav.c>
      Dav off
    </IfModule>

    SetEnv HOME /var/www/owncloud
    SetEnv HTTP_HOME /var/www/owncloud
</Directory>

<Directory "/var/www/owncloud/data/">
  # just in case if .htaccess gets disabled
  Require all denied
</Directory>
</VirtualHost>
pain is nothing a downpour won't erase
User avatar
darkwiz
Site Admin
 
Posts: 52
Joined: 14 Sep 2012 08:50

Return to Linux/Unix

Who is online

Users browsing this forum: No registered users and 1 guest

cron