Difference between revisions of "Enable/Disable Magento2 Maintenance Page"
From Brian Nelson Ramblings
(Created page with "==Enable/Disable Magento2 Maintenance Page== Log in to the Magento server as, or switch to, a user who has permissions to write to the Magento file system. su <Magento fil...") |
(→Enable/Disable Magento2 Maintenance Page) |
||
Line 7: | Line 7: | ||
Magento uses maintenance mode to disable bootstrapping; for example, while you’re maintaining, upgrading, or reconfiguring your site. | Magento uses maintenance mode to disable bootstrapping; for example, while you’re maintaining, upgrading, or reconfiguring your site. | ||
− | Magento detects maintenance mode as follows: | + | ===Magento detects maintenance mode as follows:=== |
If var/.maintenance.flag does not exist, maintenance mode is off and Magento operates normally. | If var/.maintenance.flag does not exist, maintenance mode is off and Magento operates normally. | ||
+ | |||
Otherwise, maintenance mode is on unless var/.maintenance.ip exists: | Otherwise, maintenance mode is on unless var/.maintenance.ip exists: | ||
var/.maintenance.ip can contain a list of IP addresses. If an entry point is accessed using HTTP and the client IP address corresponds to one of the entries in that list, then maintenance mode is off. | var/.maintenance.ip can contain a list of IP addresses. If an entry point is accessed using HTTP and the client IP address corresponds to one of the entries in that list, then maintenance mode is off. | ||
− | Command usage: | + | ===Command usage:=== |
magento maintenance:enable [--ip=<ip address> ... --ip=<ip address>] | [ip=none] | magento maintenance:enable [--ip=<ip address> ... --ip=<ip address>] | [ip=none] | ||
Line 22: | Line 23: | ||
magento maintenance:status | magento maintenance:status | ||
− | + | ====For example, to enable maintenance mode with no IP address exemptions:==== | |
− | + | ||
− | + | ||
− | + | ||
− | For example, to enable maintenance mode with no IP address exemptions: | + | |
magento maintenance:enable | magento maintenance:enable |
Latest revision as of 16:47, 23 January 2018
Contents
Enable/Disable Magento2 Maintenance Page
Log in to the Magento server as, or switch to, a user who has permissions to write to the Magento file system.
su <Magento file system owner> -s /bin/bash -c <command>
Magento uses maintenance mode to disable bootstrapping; for example, while you’re maintaining, upgrading, or reconfiguring your site.
Magento detects maintenance mode as follows:
If var/.maintenance.flag does not exist, maintenance mode is off and Magento operates normally.
Otherwise, maintenance mode is on unless var/.maintenance.ip exists:
var/.maintenance.ip can contain a list of IP addresses. If an entry point is accessed using HTTP and the client IP address corresponds to one of the entries in that list, then maintenance mode is off.
Command usage:
magento maintenance:enable [--ip=<ip address> ... --ip=<ip address>] | [ip=none]
magento maintenance:disable [--ip=<ip address> ... --ip=<ip address>] | [ip=none]
magento maintenance:status
For example, to enable maintenance mode with no IP address exemptions:
magento maintenance:enable
To enable maintenance mode for all clients except 192.0.2.10 and 192.0.2.11:
magento maintenance:enable --ip=192.0.2.10 --ip=192.0.2.11