-
Upgrading the server
-
Applying patches
-
Troubleshooting issues
During these situations it is preferable to run FileCloud in maintenance mode.
-
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
|
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 |
|---|---|---|
|
|
WWWROOT/resources/ui/maintenance/maintenance.enable
|
This can be an empty file. |
|
maintanence.html |
WWWROOT/resource/ui/maintenance/maintenance.html
|
File containing custom html messages for maintenance mode |
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