virtual server SSL root directory

5 posts / 0 new
Last post
#1 Thu, 10/25/2012 - 17:24
adrian.stockall

virtual server SSL root directory

Hello

The web sites I build have been designed on keeping http and https content in different root folders

e.g http /home/username/public_html https /home/username/secure_html

I can see on the Webmin -> Servers -> Apache Webserver that ther are two entries, one for port 80 and one for port 443, and they both point to /home/username/public_html

is is possible to change within Virulamin the 443 root directory from within Virtualmin/Webmin, or is it a hack using vi and the Apache config file.

I have only been using Virtualmin for 1 week, as I am looking to move all my system away from Plesk.

Your help will be appreciated

Regards Adrian

Thu, 10/25/2012 - 22:16
andreychek

Howdy,

Hmm, there may be some gotchas in doing that... that's not a setup most folks try, in most cases the directory for http and https would be the same.

That said, it may work just fine :-)

If you'd like to tinker with that, you could try doing so by going into Services -> Configure Website for SSL. There, you could start by changing the option at the bottom named "Options apply to". There, you can change the path being used.

Let us know if that does the trick for you!

-Eric

Fri, 10/26/2012 - 02:23 (Reply to #2)
adrian.stockall

Hello again

I did look at the setting you mentioned Virtualmin -> Site -> Services -> Configure Website for SSL

If you change the Directory in this option it rewrites the apache directive, but not the DocumentRoot directive

I have since discovered that by going into Virtualmin -> Site -> Services -> Configure Website for SSL -> Edit directives (icon) you can change the DocumentRoot Directive and once apache has restarted, I get the result I was looking for. Just wondered if this is the correct way of doing this.

That all http docs are in the normal folder and all the https documents are in a different root folder.

I understand this is not the normal way of doing this, but for those of us migrating from Plesk, Plesk used different root folders for http and https up until version 10. The sites I have written used this separate folder for a reason and re-writing will be a pain.

It would be good to know how some of you make sure that users are forced into https using a single folder structure, as the only way I know of is either coding in browser redirects, or using

RewriteRule ^path_to_ssl_content/(.*) https://www.example.com/path_to_ssl_content/$1 [R=301,L,NC]

Or you can do this:

RewriteCond %{HTTPS} !=on RewriteRule ^path_to_ssl_content/(.*) https://%{SERVER_NAME}/path_to_ssl_content/$1 [R,L]

But I understand (possible incorrectly) that this creates more work for apache to do when you are accessing the site, as it has to check every object severed up

Any views welcome, as I want to get this correct from the start, and not cause myself upgrade issues in the future.

Fri, 10/26/2012 - 08:42
andreychek

I understand this is not the normal way of doing this, but for those of us migrating from Plesk, Plesk used different root folders for http and https up until version 10

I'm not sure if this is what you used or not -- but there's an option for migrating Plesk backups into Virtualmin in Add Servers -> Migrate Virtual Server.

I'd be curious if that automatically handles the separate DocumentRoot's that Plesk uses... Jamie may have already accounted for all that during the migration process. But maybe not :-)

you can change the DocumentRoot Directive and once apache has restarted, I get the result I was looking for. Just wondered if this is the correct way of doing this.

Probably :-)

You really can do a lot of tweaking to the Apache config without causing problems. Changing the DocumentRoot comes up so infrequently though that I'm not sure what gotchas to expect.

If it works (ie, if you're serving content out of your https DocumentRoot), it's not likely to cause problems during an upgrade

It would be good to know how some of you make sure that users are forced into https using a single folder structure, as the only way I know of is either coding in browser redirects, or using

I'd use a redirect like one of those that you posted. I'd make a .htaccess file containing that.

-Eric

Thu, 02/25/2016 - 07:07
MackieRSA

Hi Guys.. I too have a need to split port 80 http: = /home/[mysite]/public_http and port 443 https: = /home/[mysite]/public_ssl ?? Have you manage to come up with a solution?

Topic locked