# Installing and configuring LiteMage

> Install and activate the LiteMage full-page cache for Magento on LiteSpeed servers to speed up your store, then check it is working.

Source: https://helpcenter.ruachost.com/apps/magento/installing-and-configuring-litemage/

**LiteMage** is a full‑page caching solution designed specifically for Magento when running on LiteSpeed servers. It delivers faster page loads, reduces server load, and improves customer experience. On **ruachost.com**, LiteMage can be installed and configured for both Magento 1 and Magento 2.

## Why Use LiteMage?

- Provides **full‑page caching** optimized for Magento.
- Reduces server response times and improves scalability.
- Works seamlessly with LiteSpeed Web Server.
- Supports **ESI (Edge Side Includes)** for dynamic content caching.

## Installing LiteMage on Magento 2

1. **Access your account via SSH**.
2. Navigate to your Magento installation directory:

   ```bash
   cd ~/public_html/magento
   ```
3. Set Magento to developer mode:

   ```bash
   php bin/magento deploy:mode:set developer
   ```
4. Download the LiteMage plugin files:

   ```bash
   wget https://github.com/litespeedtech/magento2-LiteSpeed_LiteMage/archive/master.zip
   ```
5. Extract the files:

   ```bash
   unzip master.zip
   ```
6. Create the directory for LiteMage:

   ```bash
   mkdir -p app/code/Litespeed/Litemage
   ```
7. Move the plugin files:

   ```bash
   mv magento2-LiteSpeed_LiteMage-master/* app/code/Litespeed/Litemage/
   ```

   ```
   ```
8. Ensure correct file ownership:

   ```bash
   chown -R username:username app/code/Litespeed/Litemage/
   ```
9. Enable the LiteMage module:

   ```
   php bin/magento module:enable Litespeed_Litemage
   php bin/magento setup:upgrade
   php bin/magento setup:di:compile
   php bin/magento deploy:mode:set production
   ```
10. Edit `.htaccess` in the Magento root directory and add:

    ```
    
      LiteMage on
    
    ```

## Activating LiteMage on Magento 2

1. Log in to Magento Admin.
2. Go to **Stores → Configuration → Advanced → System → Full Page Cache**.
3. Select **LiteMage Cache within LiteSpeed Server**.
4. Save configuration.
5. Go to **System → Cache Management**.
6. Refresh **Configuration** and **Page Cache**.

## Installing LiteMage on Magento 1

1. Download the LiteMage package from LiteSpeedTech.
2. Upload and install via **Magento Connect Manager**.
3. Edit `.htaccess` in the Magento root directory:

   ```
   
     LiteMage on
   
   ```
4. Log in to Magento Admin.
5. Go to **System → Configuration → LITEMAGE CACHE → LiteMage Configuration**.
6. Enable LiteMage Cache.
7. Refresh cache under **System → Cache Management**.

## Verifying LiteMage

- Open your site in a browser.
- Use **Inspect → Network tab**.
- Refresh the page.
- Look for response headers:

  - `X-LiteSpeed-Cache: hit,litemage` → LiteMage is working.
  - `X-LiteSpeed-Cache: miss,litemage` → Refresh again to confirm.

## Important Notes

- LiteMage requires a **LiteSpeed server license** (available on a Managed VPS).
- Not available on shared hosting accounts.
- Always back up your site before installing new modules.
