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
litespeed_wiki:cache:litemage2:installation [2017/01/04 16:52]
Jackson Zhang [Installation]
litespeed_wiki:cache:litemage2:installation [2020/07/08 19:32] (current)
Lisa Clarke Redirect to new Documentation Site
Line 1: Line 1:
-===== LiteMage for Magento 2 Installation Guide ===== +~~REDIRECT>​https://​docs.litespeedtech.com/​lscache/​litemage/​installation/​~~
- +
-==== Prerequisites ==== +
- +
-LiteSpeed Web Server Enterprise Edition with Magento 2 should be set up and working already. +
- +
-=== PHP === +
- +
-Magento 2 requires PHP versions 7.0.2+, 5.6.x, or 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 the server. If the version number does not match the one used within the server, there may be some compatibility issues. +
- +
-Run the command ''​which php''​ to get the directory of the php binary. Then, change the current binary name to something different as a backup (e.g. ''​mv php php-orig''​). Lastly, symbolic link or copy the binary installed in the LSWS directory to the directory returned by the ''​which''​ command. If the ''​which''​ command doesn'​t return anything, we recommend using ''/​usr/​local/​bin/''​ or ''/​usr/​bin/''​. +
- +
-Example using PHP 7 with which returning /​usr/​bin/​php:​ +
- +
-  mv /​usr/​bin/​php /​usr/​bin/​php-orig +
-  ln -s /​usr/​local/​lsws/​lsphp70/​bin/​php /​usr/​bin/​php +
- +
-Run ''​php -v''​ afterwards. If the steps were done correctly, the version number should match the server'​s php version. +
- +
-==== Installation ==== +
- +
-The following steps assume that the Prerequisites mentioned above are met. +
- +
-  - Access a terminal as the Magento directory owner (e.g. "​user1"​) and cd to the Magento 2 root directory. If logged in as root, do ''​su user1''​ first. +
-  - If the current deploy mode is "​default"​ instead of "​production",​ you can install litemage2 without change it to "​production"​. If the current deploy mode is "​production",​ you have to set the store to developer mode before installation and change it back to production<​code> +
-  php bin/magento deploy:​mode:​set developer</​code>​ +
-  - There are two ways to get litemage2 packages: +
-    * Method 1: Using composer to get latest litemage2 package<​code>​ +
-    composer require litespeed/​module-litemage</​code>​ +
-    * Method 2: Download litemage2 package directly. +
-        * Download the zip package file from this repository: ​https://github.com/litespeedtech/​magento2-LiteSpeed_LiteMage/​archive/​master.zip. +
-        * Unzip the source package. The unzipped directory should be named magento2-LiteSpeed_LiteMage-master.  +
-        * In the Magento 2 root directory, run the following command to create the needed directories<​code>​mkdir -p app/​code/​Litespeed/​Litemage</​code>​ +
-        * Move the contents from the GitHub directory to the newly created directory:<​code>​mv /​path/​to/​magento2-LiteSpeed_LiteMage-master/​* app/​code/​Litespeed/​Litemage/</​code>​ +
-  - Confirm that the contents'​ owner is consistent with the other magento store files. +
-  - Enable LiteMage 2 in magento:<​code>​ +
-php bin/magento module:​enable Litespeed_Litemage +
-</​code>​ +
-  - Upgrade the Magento setup:<​code>​ +
-php bin/magento setup:​upgrade +
-</​code>​ +
-  - Recompile using the signal tenant compiler or multi-tenant compiler. The single-tenant compiler has some issues. [[http://​devdocs.magento.com/guides/v2.0/​config-guide/​cli/​config-cli-subcommands-compiler.html#​config-cli-subcommands-single|link]].If you have one website and store, please run:<​code>​ +
-php bin/magento setup:​di:​compile</​code>​ If you have multiple websites and stores, Please run:<​code>​ +
-php bin/magento setup:​di:​compile-multi-tenant</​code>​ +
-  - Once finished, delete var/​di/​relations.ser to work around a Magento bug for ealier version. [[https://​github.com/​magento/​magento2/​issues/​4070|link]]<​code>​ +
-rm var/​di/​relations.ser +
-</​code>​ +
-  - If desired, switch back to production mode. The previous step may need to be repeated after the mode switch.<​code>​ +
-php bin/magento deploy:​mode:​set production +
-  </​code>​ +
- +
-==== Enable LiteMage after Installation:​ ==== +
-  - In the Magento 2 root directory'​s .htaccess file, add the following lines:<​code>​ +
-<​IfModule LiteSpeed>​ +
-LiteMage on +
-</​IfModule>​ +
-</​code>​ +
-  - Log into the Magento admin page. +
-  - In Store -> Configuration -> Advanced -> System, make sure LiteMage is enabled and the Full Page Cache setting has LiteMage selected. +
-  - In System -> Cache Management, refresh configurations and page cache. +
-  - Visit and refresh a page that should be cache enabled. Look for the LiteMage related response headers. \\ Example:<​code>​ +
-X-LiteSpeed-Cache:​ hit,litemage +
-</code> +
- +
- +
-For related LiteSpeed Server setting configuration,​ please refer to: +
-[[https://​www.litespeedtech.com/​support/​wiki/​doku.php/​litespeed_wiki:​cache:​litemage:​installation#​litespeed_web_server_settings|litespeed web server settings for litemage]] +
- +
-  Tips: For dedicated VPS/server, although it's not "have to", to gain better performance with LiteMage, +
-        please make sure Check Public Cache setting in server cache policy part is set to Yes. +
- +
  • Admin
  • Last modified: 2017/01/04 16:52
  • by Jackson Zhang