> ## Documentation Index
> Fetch the complete documentation index at: https://kb.hosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Installing and configuring LiteMage

> Boost your site's performance with our step-by-step guide to installing and configuring LiteMage, the Magento caching solution.

This article describes how to install and configure [LiteMage](https://www.litespeedtech.com/solutions/magento-acceleration), the caching solution for Magento on Turbo servers. Follow the procedures in the section below for your version of Magento.

<Warning>
  **Important**

  LiteMage requires the **Ultra VPS License with LiteMage** server license to function correctly. For Managed VPS, this license is only available for Soar 16 and Soar 32 Turbo servers. You cannot run LiteMage on Soar 8 or Takeoff Managed VPS servers.
</Warning>

## Magento 2

First you must install LiteMage, and then activate it in the Magento administration panel.

### Installing LiteMage

To install LiteMage on Magento 2, follow these steps:

1. Access your account [using SSH](/docs/using-ssh-secure-shell).

2. Change to the directory where Magento is installed. For example, type `cd ~/public_html/magento`.

3. At the command prompt, to set Magento to developer mode, type the following command:

```bash theme={null}
php bin/magento deploy:mode:set developer
```

4. To download the LiteMage plugin files, type the following command:

```bash theme={null}
wget https://github.com/litespeedtech/magento2-LiteSpeed_LiteMage/archive/master.zip
```

5. To extract the files in the *.zip* file, type the following command:

```bash theme={null}
unzip master.zip
```

6. To create a directory for the LiteMage plugin files, type the following command:

```bash theme={null}
mkdir -p app/code/Litespeed/Litemage
```

<Warning>
  **Important**

  You must create this directory path relative to the Magento 2 root directory. Otherwise, Magento cannot detect that the plugin is installed.
</Warning>

7. To move the unpacked LiteMage plugin files to the new directory, type the following command:

```bash theme={null}
mv magento2-LiteSpeed_LiteMage-master/* app/code/Litespeed/Litemage/
```

<Note>
  After you move the files, make sure that they have the same ownership as all of the other Magento files. If they do not, use the *chown* command to set the correct ownership. For example, you can type **chown -Rusername:username\*** , where ***username*** represents your account username.
</Note>

8. To enable the LiteMage plugin, type the following command:

```bash theme={null}
php bin/magento module:enable Litespeed_Litemage
```

9. To make the plugin settings available to the Magento Admin panel, type the following command:

```bash theme={null}
php bin/magento setup:upgrade
```

10. To recompile Magento, type **one** of the following commands:

* If you are running Magento version 2.0.6 or later **and** have only one Magento store, type the following command:

```bash theme={null}
php bin/magento setup:di:compile
```

* Alternatively, if you are running Magento version 2.0.5 or earlier **or** have multiple Magento stores, type the following command:

```bash theme={null}
php bin/magento setup:di:compile-multi-tenant
```

11. To set Magento back to production mode, type the following command:

```bash theme={null}
php bin/magento deploy:mode:set production
```

<Note>
  If you receive an error message running this command, repeat step 10, and then try again.
</Note>

12. Using the [cPanel File Manager](/docs/cpanel-file-manager) or the SSH command prompt, open the *.htaccess* file in the Magento root directory in your preferred text editor, and then:

* Copy the following text and paste it at the top of the *.htaccess* file:

```xml theme={null}
<IfModule Litespeed>
    LiteMage on
</IfModule>
```

* Save your changes to the *.htaccess* file.

### Activating LiteMage

To activate LiteMage on Magento 2, follow these steps:

1. Log in to Magento as the administrator.

2. In the left sidebar, click **STORES**, and then click **Configuration**.

3. Click **ADVANCED**, and then click **System**.

4. Click **Full Page Cache**.

5. In the **Caching Application** list box, confirm that **LiteMage Cache within LiteSpeed Server** is selected. If **LiteMage Cache within LiteSpeed Server** is not selected, select it in the **Caching Application** list box, and then click **Save Config**.

6. In the left sidebar, click **SYSTEM**, and then click **Cache Management**.

7. Select the **Configuration** and **Page Cache** check boxes.

8. In the list box above the table, select **Refresh**, and then click **Submit**.
   > 👍 Tip
   >
   > To verify that the LiteMage installation is working correctly, follow the **Verifying LiteMage** procedure below.

## Magento 1

First you must download and install LiteMage, and then activate it in the Magento administration panel.

### Downloading and installing LiteMage

To download and install LiteMage on Magento 1, follow these steps:

1. Download the LiteMage package file to your local computer. To do this, go to [https://www.litespeedtech.com/products/cache-plugins/magento-acceleration/download](https://www.litespeedtech.com/products/cache-plugins/magento-acceleration/download). Under **Step 3**, download the latest file for Magento 1.x.

2. Using the [cPanel File Manager](/docs/cpanel-file-manager) or the SSH command prompt, on the web server open the *.htaccess* file in the Magento root directory in your preferred text editor, and then:

* Copy the following text and paste it at the top of the *.htaccess* file:

```
<IfModule Litespeed>
    LiteMage on
</IfModule>
```

* Save your changes to the *.htaccess* file.

3. Log in to Magento as the administrator.

4. On the top menu bar, click **System**, and then click **Configuration**.

5. In the left sidebar, under **GENERAL**, click **Web**.

6. Click **Session Validation Settings**, and then in the **Use SID on Frontend** list box, select **No**, and then click **Save Config**.

<Warning>
  **Important**

  If you currently have compilation enabled, you must disable it. To do this, on the top menu bar click **System** , click  **Tools** , and then click  **Compilation** . Click  **Disable** at the top right.
</Warning>

7. On the top menu bar, click **System**, click **Magento Connect**, and then click **Magento Connect Manager**. This step takes you away from the administrator interface and you must type the Magento administrator username and password again.

8. Under **Direct package file upload**, next to **Upload package file**, click **Choose File**.

9. Select the location where you downloaded the package file in step 1, and then click **Upload**.

### Activating LiteMage

To activate LiteMage on Magento 1, follow these steps:

1. Log in to Magento as the administrator.

2. On the top menu bar, click **System**, and then click **Configuration**.

3. In the left sidebar, under **LITEMAGE CACHE**, click **LiteMage Configuration**.
   > 📘 Note
   >
   > If you receive a 404 Not Found error message, log out of Magento and then log back in.

4. Click **General Settings**, and then in the **Enable LiteMage Cache** list box, select **Yes**.

5. Click **Save Config**.

6. On the top menu bar, click **System**, and then click **Cache Management**.

7. Under **Cache Storage Management**, select the **Configuration** check box, and then click **Submit**. This refreshes the configuration cache.
   > 👍 Tip
   >
   > To verify that the LiteMage installation is working correctly, follow the **Verifying LiteMage** procedure below.

## Verifying LiteMage

To ensure that LiteMage is working correctly for your site, follow these steps:

1. Use your web browser to visit a page that is cache-enabled.

2. Open the web browser inspector by right-clicking the page, and then click **Inspect**.
   > 📘 Note
   >
   > The exact wording for the **Inspect** option, as well as the options in the following steps, may vary depending on the browser you are using.

3. Select the **Network** tab, and then refresh the page.

4. Select the item from the list that corresponds to the current HTML page (this is usually the first item ending in *.html* ).

5. Under **Headers**, if you see the following response header, then LiteMage is working correctly:

```
X-LiteSpeed-Cache: hit,litemage 
```

<Note>
  Alternatively, if you see the following header, refresh the page and check again:
</Note>

```
X-LiteSpeed-Cache: miss,litemage
```

## More information

* For general information about LiteMage, please visit [https://www.litespeedtech.com/solutions/magento-acceleration](https://www.litespeedtech.com/solutions/magento-acceleration).

## Related articles

* [Optimizing Magento](/docs/optimizing-magento)
