0
Answered

How do I enable https in filerun

Stephanie G 4 weeks ago • updated by Vlad R 2 weeks ago 10

As the question asks - How do I enable https in filerun? I see the option to force users to use HTTPS but is that what I want to enable? I've also seen the link https://docs.filerun.com/php_configuration?s[]=https#httpsssl_support but I'm not trying to connect to other servers.

I've purchased and installed the SSL but I now need to enable HTTPS via the site or code so I'm curious how to go about doing this.

Answer

Answer

Well I would just do it with the .htaccess if all the other things not work. I would even prefer to set up FileRun fresh with https.

But here you go:



ORIGINAL:

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
</IfModule>
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1 <IfModule mod_php5.c>
   php_value error_reporting 22519
   php_flag allow_url_include 0
   php_flag allow_webdav_methods 1
   php_value memory_limit 256M
   php_value max_execution_time 300
   php_flag output_buffering 0
   php_flag zlib.output_compression 0
   php_flag file_uploads 1
   php_value max_file_uploads 10
   php_value upload_max_filesize 20M
   php_value post_max_size 20M
   php_flag enable_dl 0
   php_value default_charset 'UTF-8'
</IfModule>
<IfModule mod_php7.c>
    php_value error_reporting 22519
    php_flag allow_url_include 0
    php_flag allow_webdav_methods 1
    php_value memory_limit 256M
    php_value max_execution_time 300
    php_flag output_buffering 0
    php_flag zlib.output_compression 0
    php_flag file_uploads 1
    php_value max_file_uploads 10
    php_value upload_max_filesize 20M
    php_value post_max_size 20M
    php_flag enable_dl 0
    php_value default_charset 'UTF-8'
</IfModule> <IfModule mod_dir.c>
  DirectoryIndex index.php index.html
</IfModule> AddDefaultCharset utf-8
Options -Indexes

MODIFIED:

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]     RewriteCond %{HTTPS} !=on     RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=302]
</IfModule>
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1 <IfModule mod_php5.c>
   php_value error_reporting 22519
   php_flag allow_url_include 0
   php_flag allow_webdav_methods 1
   php_value memory_limit 256M
   php_value max_execution_time 300
   php_flag output_buffering 0
   php_flag zlib.output_compression 0
   php_flag file_uploads 1
   php_value max_file_uploads 10
   php_value upload_max_filesize 20M
   php_value post_max_size 20M
   php_flag enable_dl 0
   php_value default_charset 'UTF-8'
</IfModule>
<IfModule mod_php7.c>
    php_value error_reporting 22519
    php_flag allow_url_include 0
    php_flag allow_webdav_methods 1
    php_value memory_limit 256M
    php_value max_execution_time 300
    php_flag output_buffering 0
    php_flag zlib.output_compression 0
    php_flag file_uploads 1
    php_value max_file_uploads 10
    php_value upload_max_filesize 20M
    php_value post_max_size 20M
    php_flag enable_dl 0
    php_value default_charset 'UTF-8'
</IfModule> <IfModule mod_dir.c>
  DirectoryIndex index.php index.html
</IfModule> AddDefaultCharset utf-8
Options -Indexes

I tried that and I'm getting the "Failed to test HTTPS connection! The settings have not been saved."  I read this thread https://feedback.filerun.com/communities/1/topics/205-failed-to-test-https-connection-the-settings-have-not-been-saved but it doesn't offer much information as to what might be preventing the connection. 

Can you access your FileRun installation with https?

Any errorlogs?

I can if I go directly to https://mydomain.com - I get the circle with the i in it but not the full secure lock icon saying it's secure.

I then checked my logs and no error logs relating to the time period I tried.

Under review

Do you see FileRun loading when you access the same URL but with HTTPS instead of HTTP?

I think I know what you mean. You have installed a SSL Certificate but if some content still gets loaded over http (instead of httpS) it will 'break' the Certificate untill all of the content is beeing loaded over https.


I dont know if this is the Problem but it could be.

For me everything worked after installing the SSL Certificate and re-register the Installation.

+1

I would implement a Serverside redirect to https, maybe something like this:


(belongs to the .htaccess)


RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=302]

Should redirect all traffic from http to https


If it works change the "302" to "301"

302 = temporary

301 = permanent


Pls test first woth 302

Hi M4rt1n,

could you show an example of what should contain a .htaccess file, whole file?

Thanks.

Answer

Well I would just do it with the .htaccess if all the other things not work. I would even prefer to set up FileRun fresh with https.

But here you go:



ORIGINAL:

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
</IfModule>
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1 <IfModule mod_php5.c>
   php_value error_reporting 22519
   php_flag allow_url_include 0
   php_flag allow_webdav_methods 1
   php_value memory_limit 256M
   php_value max_execution_time 300
   php_flag output_buffering 0
   php_flag zlib.output_compression 0
   php_flag file_uploads 1
   php_value max_file_uploads 10
   php_value upload_max_filesize 20M
   php_value post_max_size 20M
   php_flag enable_dl 0
   php_value default_charset 'UTF-8'
</IfModule>
<IfModule mod_php7.c>
    php_value error_reporting 22519
    php_flag allow_url_include 0
    php_flag allow_webdav_methods 1
    php_value memory_limit 256M
    php_value max_execution_time 300
    php_flag output_buffering 0
    php_flag zlib.output_compression 0
    php_flag file_uploads 1
    php_value max_file_uploads 10
    php_value upload_max_filesize 20M
    php_value post_max_size 20M
    php_flag enable_dl 0
    php_value default_charset 'UTF-8'
</IfModule> <IfModule mod_dir.c>
  DirectoryIndex index.php index.html
</IfModule> AddDefaultCharset utf-8
Options -Indexes

MODIFIED:

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]     RewriteCond %{HTTPS} !=on     RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=302]
</IfModule>
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1 <IfModule mod_php5.c>
   php_value error_reporting 22519
   php_flag allow_url_include 0
   php_flag allow_webdav_methods 1
   php_value memory_limit 256M
   php_value max_execution_time 300
   php_flag output_buffering 0
   php_flag zlib.output_compression 0
   php_flag file_uploads 1
   php_value max_file_uploads 10
   php_value upload_max_filesize 20M
   php_value post_max_size 20M
   php_flag enable_dl 0
   php_value default_charset 'UTF-8'
</IfModule>
<IfModule mod_php7.c>
    php_value error_reporting 22519
    php_flag allow_url_include 0
    php_flag allow_webdav_methods 1
    php_value memory_limit 256M
    php_value max_execution_time 300
    php_flag output_buffering 0
    php_flag zlib.output_compression 0
    php_flag file_uploads 1
    php_value max_file_uploads 10
    php_value upload_max_filesize 20M
    php_value post_max_size 20M
    php_flag enable_dl 0
    php_value default_charset 'UTF-8'
</IfModule> <IfModule mod_dir.c>
  DirectoryIndex index.php index.html
</IfModule> AddDefaultCharset utf-8
Options -Indexes