Zentyal Forum, Linux Small Business Server
Zentyal Server => Installation and Upgrades => Topic started by: schoots on May 31, 2014, 06:22:38 pm
-
Zentyal 3.4
Ubuntu Server 13.10
Latest Updates as of Today 5/31/14
I've searched the forums and it doesn't seem like this has been answered.
I am aware this can be done in the Virtual hosts section in Zentyal Admin, but I would prefer doing this through .htaccess
I have a new install of Zentyal and would like to add a .htaccess file to the root of my web server so that when I navigate to a subdomain it redirects to https:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^(sub1|sub2|sub3)\. [NC]
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
To test that the .htaccess was working I added:
deny from all
It doesn't show the error, so I went into the apache2.conf and noticed that the webroot looks like this:
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride none
Require all granted
</Directory>
I changed AllowOverride to 'All' and restarted apache and that gives me a 500 error.
Anyone else had this problem? Or ideas on how to fix it?
-
In the future, for anyone who sees this:
Zentyal uses Stubs to maintain it's configuration. If you add the <Directory> configuration to the default.conf.mas you'll be able to have access.
Here's the code, it's easiest to just do this in SU:
cd /usr/share/zentyal/stubs/webserver
cp default.conf.mas default.conf.mas.bak
At the bottom you can add your directory code, in my case this was:
<Directory /var/www>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
Hope this helps someone in the future!