Table of Contents

Magento 2 Installation

This guide will explain how to get up and running with Magento 2 on LiteSpeed Web Server.

Prerequisites

The following are required and should already be set up before proceeding:

LIteSpeed Web Server https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:installation

LSPHP https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:php

A LSWS Virtual Host https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:config#virtual_hosting

MySQL There are many different variations of MySQL and each variation and distro do things differently. There are many guides online to install MySQL for the specific distro where Magento 2 will be installed.

Step by Step Instructions

  1. Make sure .htaccess is enabled for the VHost Magento 2 will be installed on.
    1. Inside the LSWS WebAdmin Console, go to Configuration → Virtual Hosts and select the Virtual Host that will be used.
    2. Then go to General → HTAccess and click Edit.
      1. In Allow Override, check everything except for the None option and set .htaccess as the Access Name.
  2. Next extract the Magento archive file into the Doc Root of the VHost.
  3. Once the files are extracted, open a (command line || terminal), cd into the Doc Root, and run the following commands:
    • find var vendor pub/static pub/media app/etc -type f -exec chmod u+w {} \;
      find var vendor pub/static pub/media app/etc -type d -exec chmod u+w {} \;
      chmod u+x bin/magento
    • These commands will update file permissions to match those recommended by Magento. These permissions are required for Magento 2 to work properly.
  4. Make sure the xml package for LSPHP is installed for the LSPHP version assigned to the VHost. (Replace XX with the version number 56, 70, 71, etc, depending on what is being used)
    • CentOS: yum install lsphpXX-xml
    • Debian: apt-get install lsphpXX-xml
  5. Using a web browser, visit the VHost via its URL and follow the on screen instructions to setup Magento 2.

Now that Magento 2 is all set up, be sure to check out our LiteMage Cache extension to speed it up even more!