Breadcrumbs

Run FileCloud In Maintenance Mode

icons8-maintenance-filled-50.png You might need to run FileCloud server in maintenance mode when:

  • Upgrading the server

  • Applying patches

  • Troubleshooting issues

During these situations it is preferable to run FileCloud in maintenance mode.

https://fileclouddocs.atlassian.net/wiki/s/1623602073/6452/05f502871a457750e4d6a5e1f585bce5603b62b2/_/images/icons/emoticons/warning.png   When run in maintenance mode, the following conditions apply:

  • User interactions with the site are not allowed

  • Admin interactions can still be performed

 

To run FileCloud Server in maintenance mode:

 

1. Setup Rules

Setup Maintenance Mode Rules

Step 1:

Edit the following htaccess file in your FileCloud installation and add the following lines to the top of the file (right after the line RewriteEngine On ).

HTAccess File

Location

Main .htaccess file

WWWROOT/.htaccess
For example,

  • in Windows, C:\xampp\htdocs\.htaccess

  • in Linux, /var/www/.htaccess

 

In versions of FileCloud prior to 20.2 do the same for the sub .htaccess file under core folder:

Open the file WWWROOT/core/.htaccess

  • in Windows, C:\xampp\htdocs\core\.htaccess

  • in Linux, /var/www/core/.htaccess

HTAccess rules
# maintenance rule 1: web browser, allow only admin portal
RewriteCond %{DOCUMENT_ROOT}/resources/ui/maintenance/maintenance.html -f
RewriteCond %{DOCUMENT_ROOT}/resources/ui/maintenance/maintenance.enable -f
RewriteCond %{REQUEST_URI} !^/resources/ui/maintenance/.*
RewriteCond %{REQUEST_URI} !public/index.php
RewriteCond %{REQUEST_URI} !favicon.ico
RewriteCond %{REQUEST_URI} !^/ui/admin/
RewriteCond %{REQUEST_URI} !^/ui/admin2/
RewriteCond %{REQUEST_URI} !^/core/.*
RewriteCond %{REQUEST_URI} !^/admin.*
RewriteRule ^.*$ /resources/ui/maintenance/maintenance.html [B,END]
RewriteRule ^resources/ui/maintenance/(.+)$ resources/ui/maintenance/$1 [B,END]
# maintenance rule 2: block all apps
RewriteCond %{DOCUMENT_ROOT}/resources/ui/maintenance/maintenance.html -f
RewriteCond %{DOCUMENT_ROOT}/resources/ui/maintenance/maintenance.enable -f
RewriteCond %{HTTP_USER_AGENT} !^.*(mozilla|chrome|safari|applewebkit).*$ [NC]
RewriteRule ^.*$ /resources/ui/maintenance/maintenance.html [B,END]
RewriteRule ^resources/ui/maintenance/(.+)$ resources/ui/maintenance/$1 [B,END]

Note: Since the .htaccess file may be replaced when updating FileCloud, after update, check if maintenance mode is still active and add the rules again if required before starting the web server.

2. Enable Maintenance Mode

Enabling Maintenance Mode

Now that the rules for maintenance mode has been setup, FileCloud can be switched to maintenance mode, by creating the following files.


File

Location

Remarks

maintenance.enable

WWWROOT/resources/ui/maintenance/maintenance.enable


For example,

  • in Windows, C:\xampp\htdocs\resources\ui\maintenance\maintenance.enable

  • in Linux, /var/www/resources/ui/maintenance/maintenance.enable

This can be an empty file.

maintanence.html

WWWROOT/resource/ui/maintenance/maintenance.html


For example,

  • in Windows, C:\xampp\htdocs\resources\ui\maintenance\maintenance.html

  • in Linux, /var/www/resources/ui/maintenance/maintenance.html

    The customized message can be specified in the maintenance.html file

File containing custom html messages for maintenance mode


https://fileclouddocs.atlassian.net/wiki/s/1623602073/6452/05f502871a457750e4d6a5e1f585bce5603b62b2/_/images/icons/emoticons/lightbulb_on.png Customizing the Maintenance Mode Notification Page

FileCloud maintenance mode notification page can be customized by editing the file WWWROOT/resource/ui/maintenance/maintenance.html. Any logos and css files that needs to be used in the html page can be placed under the same folder and referenced.


FileCloud maintenance mode can be switched off by deleting the file following you created:

$ WWWROOT/resource/ui/maintenance/maintenance.enable