Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
litespeed_wiki:cache:litemage2:installation [2017/02/03 20:00]
Michael Alegre Edited for spelling/grammer. Improved accuracy of some information. Improved format of information. Improved clarity.
litespeed_wiki:cache:litemage2:installation [2020/04/06 16:00]
Jackson Zhang
Line 1: Line 1:
 ===== LiteMage for Magento 2 Installation Guide ===== ===== LiteMage for Magento 2 Installation Guide =====
 +==== Overview ====
 +LiteMage setup is easy for both dedicated and shared hosting environments. Here are the basic steps.
  
-==== Prerequisites ====+At the server level, you will need to: 
 +  - Get a LiteSpeed Enterprise 5.0+ License with the LiteMage Module (For more information on the available LiteMage tiers, visit **[[litespeed_wiki:​cache:​litemage:​understand_tiers|Difference Between LiteMage Tiers]]**) 
 +    * **[[https://​www.litespeedtech.com/​products/​litespeed-web-server/​download/​get-a-trial-license|Request Trial]]** 
 +    * **[[https://​store.litespeedtech.com/​store/​cart.php|Purchase New]]** 
 +    * **[[litespeed_wiki:​licenses:​add-lscache|Upgrade existing]]**  
 +  - **[[litespeed_wiki:​cache:​common_installation#​web_server_configuration|Configure your server level and virtual host level Cache Storage Path settings]]**
  
-LiteSpeed Enterprise with a working ​Magento 2 installation.+For each Magento 2 Store, you will need to: 
  
-=== PHP ===+  - Install the LiteMage extension for Magento 2 
 +  - Turn on LiteMage through .htaccess 
 +  - Change the LiteMage extension'​s configuration to enable LiteMage
  
-Magento 2 requires PHP version 7.0.2+, 5.6.xor 5.5.x. In the command line, type ''​php -v''​ to get the PHP version used by the command line interface. This version may be different than the one used by LiteSpeed. If the version number does not match the version used by LiteSpeed, you run the risk of compatibility issues.+==== Configure Server Level Cache Storage Settings ==== 
 +Server level cache storage needs to be configured properly for your environment. Select your server setup from the **Web Server Configuration** section of our **[[litespeed_wiki:​cache:​common_installation#​web_server_configuration|LiteSpeed Cache Installation Guide]]** and follow the instructions in the **Set Server Level Cache Root** section of your respective guide. 
 + 
 +==== PHP Prerequisites ==== 
 + 
 +LiteSpeed Enterprise with a working ​Magento 2 installation. Magento 2 works only with PHP 7 and hence requires PHP version 7.0.2+. ​ 
 + 
 +=== On Control panel === 
 +On control panelyou just need to select to the right PHP version 
 + 
 +=== LSWS Native Mode=== 
 +On LSWS native mode, you can run the following to check your PHP version. 
 + 
 +In the command line, type ''​php -v''​ to get the PHP version used by the command line interface. This version may be different than the one used by LiteSpeed. If the version number does not match the version used by LiteSpeed, you run the risk of compatibility issues.
  
 In the command line, run command ''​which php''​ to get the location of the command line PHP binary, for example ''/​usr/​local/​bin/​php'',​ and enter into that directory with command ''​cd /​usr/​local/​bin''​. If the ''​which''​ command doesn'​t return anything, we recommend using ''/​usr/​local/​bin/''​ or ''/​usr/​bin/''​. Next, change the current PHP binary name to something different as a backup using the ''​mv''​ command and create a symbolic link to the LiteSpeed PHP binary (or copy the binary itself into the current directory). In the command line, run command ''​which php''​ to get the location of the command line PHP binary, for example ''/​usr/​local/​bin/​php'',​ and enter into that directory with command ''​cd /​usr/​local/​bin''​. If the ''​which''​ command doesn'​t return anything, we recommend using ''/​usr/​local/​bin/''​ or ''/​usr/​bin/''​. Next, change the current PHP binary name to something different as a backup using the ''​mv''​ command and create a symbolic link to the LiteSpeed PHP binary (or copy the binary itself into the current directory).
Line 44: Line 66:
 php bin/magento deploy:​mode:​set production</​code>​**Note:​** The previous step may need to be repeated after switching deploy modes. php bin/magento deploy:​mode:​set production</​code>​**Note:​** The previous step may need to be repeated after switching deploy modes.
  
-**Note:** PHP 7.0.users may run into a [[https://​github.com/​magento/​magento2/​issues/​4070|PHP fatal error bug]]. A workaround for this is to delete file ''​var/​di/​relations.ser''​ with command:<​code>​+**Note:** PHP 7.0.users running a version below 7.0.6 may run into a [[https://​github.com/​magento/​magento2/​issues/​4070|PHP fatal error bug]]. A workaround for this is to delete file ''​var/​di/​relations.ser''​ with command:<​code>​
 rm var/​di/​relations.ser</​code>​ rm var/​di/​relations.ser</​code>​
  
Line 55: Line 77:
   - Log in to the Magento admin page.   - Log in to the Magento admin page.
   - In **Store > Configuration > Advanced > System**, make sure LiteMage is enabled and selected under the "Full Page Cache" setting.   - In **Store > Configuration > Advanced > System**, make sure LiteMage is enabled and selected under the "Full Page Cache" setting.
-  - In **System > Cache Management**,​ refresh the "​Configuration"​ and "Page Cache" cache types.+  - In **System > Cache Management**,​ refresh the **"​Configuration"​** and **"Page Cache"** cache types. **"​Page Cache"​** should be enabled, if not, then LiteMage can not work and LiteMage Cache Management stats won't show up.
   - To ensure that LiteMage is working correctly, visit a page that should be cache enabled and open your browser'​s inspector by right clicking the page and selecting "​inspect"​. Then select the "​Network"​ tab and refresh the page. Now select the item from the list corresponding to your current HTML page (usually the first item ending in ''​.html''​). Under "​Headers",​ check the response header for the following LiteMage related info.<​code>​   - To ensure that LiteMage is working correctly, visit a page that should be cache enabled and open your browser'​s inspector by right clicking the page and selecting "​inspect"​. Then select the "​Network"​ tab and refresh the page. Now select the item from the list corresponding to your current HTML page (usually the first item ending in ''​.html''​). Under "​Headers",​ check the response header for the following LiteMage related info.<​code>​
 X-LiteSpeed-Cache:​ hit,​litemage X-LiteSpeed-Cache:​ hit,​litemage
Line 66: Line 88:
 ==== Updating LiteMage 2 ====  ==== Updating LiteMage 2 ==== 
  
-The steps involved in updating LiteMage 2 to a newer version should be almost ​identicl ​to the steps performed during installation. The only difference occurs when downloading a new package. At this point if you installed LiteMage 2 using the GitHub method, you must remove the old package files and download the new package files through GitHub. (Composer update steps are identical to installation)+The steps involved in updating LiteMage 2 to a newer version should be almost ​identical ​to the steps performed during installation. The only difference occurs when downloading a new package. At this pointif you installed LiteMage 2 using the GitHub method, you must remove the old package files and download the new package files through GitHub. (Composer update steps are identical to installation)
  
 **Important:​** Please be consistent when installing and upgrading LiteMage 2. Whether you installed LiteMage 2 using GitHub files or through Composer, always use the same method when updating to a newer version. If you do not do this you will generate a duplicate copy of LiteMage 2 and run into the following error: <​code>​Autoload error: '​Litespeed_Litemage'​ component already exist</​code> ​ **Important:​** Please be consistent when installing and upgrading LiteMage 2. Whether you installed LiteMage 2 using GitHub files or through Composer, always use the same method when updating to a newer version. If you do not do this you will generate a duplicate copy of LiteMage 2 and run into the following error: <​code>​Autoload error: '​Litespeed_Litemage'​ component already exist</​code> ​
 +
 +==== Testing ====
 +You can use [[litespeed_wiki:​cache:​litemage:​installation#​testing|similar way as Litemage 1 testing]] to check the “X-LiteSpeed-Cache:​ hit,​litemage” header.
 +
  • Admin
  • Last modified: 2020/07/08 19:32
  • by Lisa Clarke