Best place to Force SSL, password protect directories.
Posted: Wed Feb 01, 2017 8:43 am
Hi,
I'm still going through the learning curve of setting up Vesta CP, having just moved from ISPconfig. I'd like to make a couple of alterations to the apache config, but I'm not sure of the best place to do it, so I thought I'd ask here. I've been running apache and nginx servers for about ten years, so I'm familiar with the configuration process, I'm just not sure where the best place to put it is.
I see there are the following options.
1) .htaccess file in the webserver directory.
2) /home/admin/web/conf/apache2.conf and sapache2.conf
3) Additional files specified in IncludeOptional /home/admin/conf/web/apache2.domain.conf*
4) Making templates in /usr/local/vesta/data/templates/web/apache2
So, here are the things I'd like to do, and where I think I should be doing them. Please correct me if there is a better way!
Forcing SSL for a whole domain
Use approach 4), copy default.tpl and remove most of the content. Add "Redirect permanent / https://secure.example.com/" in that file. Copy default.stpl and leave unchanged.
OR ... I have nginx proxy enabled. Should I be using the nginx forceSSL template instead?
Forcing the webmail directory to SSL
In .htaccess or IncludeOptional for each site? Or can I do it globally?
Password protecting webmail / phpmyadmin directory
In .htaccess?
Removing phpmyadmin directory from a single site
Erm ... can't find which config sets this ... any clues?
Renaming phpmyadmin directory for all sites
I'd prefer not to have the default name. There are a lot of web-crawling bots poking around in /phpmyadmin and if there's a zero-day, its not pretty. How to change this across all websites on the server?
Thanks for any pointers!
I'm still going through the learning curve of setting up Vesta CP, having just moved from ISPconfig. I'd like to make a couple of alterations to the apache config, but I'm not sure of the best place to do it, so I thought I'd ask here. I've been running apache and nginx servers for about ten years, so I'm familiar with the configuration process, I'm just not sure where the best place to put it is.
I see there are the following options.
1) .htaccess file in the webserver directory.
2) /home/admin/web/conf/apache2.conf and sapache2.conf
3) Additional files specified in IncludeOptional /home/admin/conf/web/apache2.domain.conf*
4) Making templates in /usr/local/vesta/data/templates/web/apache2
So, here are the things I'd like to do, and where I think I should be doing them. Please correct me if there is a better way!
Forcing SSL for a whole domain
Use approach 4), copy default.tpl and remove most of the content. Add "Redirect permanent / https://secure.example.com/" in that file. Copy default.stpl and leave unchanged.
OR ... I have nginx proxy enabled. Should I be using the nginx forceSSL template instead?
Forcing the webmail directory to SSL
In .htaccess or IncludeOptional for each site? Or can I do it globally?
Password protecting webmail / phpmyadmin directory
In .htaccess?
Removing phpmyadmin directory from a single site
Erm ... can't find which config sets this ... any clues?
Renaming phpmyadmin directory for all sites
I'd prefer not to have the default name. There are a lot of web-crawling bots poking around in /phpmyadmin and if there's a zero-day, its not pretty. How to change this across all websites on the server?
Thanks for any pointers!