This guide will explain how to get up and running with Magento CE 2.x on LiteSpeed Web Server.
The easiest way to install PHP for LiteSpeed is through our CentOS repository. If the LiteSpeed Repository was not installed and enabled during the web server installation, follow this guide to install and enable the LiteSpeed Repository.
You can install some of the most commonly-used PHP 7.0 packages and modules for LiteSpeed. Use the following command:
sudo yum install lsphp70 lsphp70-mysqlnd lsphp70-common lsphp70-gd lsphp70-pdo lsphp70-process lsphp70-mbstring lsphp70-mcrypt lsphp70-opcache lsphp70-bcmath lsphp70-xml lsphp70-soap lsphp70-json lsphp70-intl -y
Visit http://your_server_IP:7080
. Navigate to Server Configuration > External app, then click the second icon Edit on the right hand side in order to edit this application.
Modify:
lsphp70
$SERVER_ROOT/lsphp70/bin/lsphp
Magento 2: You will need to set the value of “always_populate_raw_post_data” to -1 in the related php.ini file. In this example, this file would be /usr/local/lsws/lsphp70/etc/php.ini. You should also make any memory configuration changes here if your version of Magento requires it.
memory_limit = 768M max_execution_time = 18000 session.auto_start = 0
For Example:
When you are finished, click the Save icon to save your changes, then click the Graceful Restart button.
Visit http://your_server_IP/phpinfo.php
and make sure PHP Version shows 7.0.x
.
Install MYSQL 5.6:
CentOS 6:
yum install https://repo.mysql.com//mysql57-community-release-el6-11.noarch.rpm yum install mysql-community-server systemctl start mysqld
CentOS 7:
yum install http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm yum install mysql-community-server systemctl start mysqld
Ubuntu/Debian
sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu trusty universe' sudo apt-get update sudo apt install mysql-server-5.6 sudo apt install mysql-client-5.6
Create the Magento CE database and your Magento CE user/password:
mysql -u root -p (Press enter because we've not set the password) create database magento; grant all privileges on magento.* to magento@localhost identified by 'magento'; exit;
Note: For security purposes, you should use a Magento CE DB username and password that are different than our example.
An index file needs to be set in the LiteSpeed Web Admin Console. Navigate to Virtual Hosts > Select Virtual Host from List > General > Index Files, click Edit in the top right corner, and enter index.html,index.php in the Index Files box.
To illustrate setting up Magento CE on a vhost we'll use the default virtual host, “Example”. You can download Magento CE from their official download page.
Please note that the document root of 'Example' virtual host is /usr/local/lsws/Example/html/
If you have downloaded in zip format, use following:
unzip Magento-CE-x.x.zip
Or if you have downloaded in tar.gz
tar zxf Magento-CE-x.x.tar.gz
Change owernship:
chown -R nobody:nobody /usr/local/lsws/Example/html
Open the browser with URL http://server_IP:8088/
Once you open the url in browser you will see this window:
Accept terms and conditions by clicking 'Accept and Setup Magento'.
Magento CE installer needs to check if all the requirements are met, if you have followed all the guidelines above, all requirements should meet, just click 'Start Readiness Check'.
If you see something like this after requirements checks you are good to go, else check which one you are missing and make sure they are met.
Leave everything default unless you want to change anything.
New Username: litespeed
New Email: example@example.com
New Password: litespeed@123
After completing all these steps and click install, so that Magento CE installer can install Magento for you, after successful installation you can visit your store at: http://server_IP:8088/