Knowledge Base
Knowledge Base / XFilesharing Pro / How to ...

Advanced Search

Running site under HTTPS
03/14/2017 06:16 AM
Printable Version | Email Article | Receive Email Updates

Question

I'm looking for a way to run my XFileSharing site under HTTPS. What exactly shall I do to run it smoothly?

Answer

It became possible to run HTTPS with XFileSharing since the version 2.3. Here is an instruction on what you have to do in order to do that:
  • Purchase a wildcard certificate and install it on your main server and all of your file servers
  • Ensure that you have the Perl modules named LWP::Protocol::https and Crypt::SSLeay installed on your main server and each of your file servers
  • Open XFileConfig.pm and ensure that your site_url and site_cgi are now prepended with 'https://'
  • Go into each server tab in admin_servers and replace all occurences of 'http' with 'https'
  • Setup a redirect from your site's plain HTTP links to HTTPS:
If you're using Cloudflare SSL: Create a Cloudflare page rule as suggested by Cloudflare support: https://support.cloudflare.com/hc/en-us/articles/200170536-How-do-I-redirect-all-visitors-to-HTTPS-SSL-

If you're not using Cloudflare SSL: Open the public_html/.htaccess on your main server and insert the following rule:
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Note: it is not possible to run the file servers on plain HTTP while your main server is getting accessed with HTTPS, so please ensure that all of your file servers are set up and accessible through HTTPS just as suggested by the points 2 and 3 of this instruction. A failure to do that will lead to uploading problems due to the security restrictions in major browsers.

Note 2: at this moment, it is not possible to run the site smoothly on plain HTTP once it's set up for HTTPS, so please ensure that nobody will access your with with plain HTTP just as specified in the point 4 of this instruction. A failure to do that will also lead to uploading problems due to the security restrictions in major browsers.