This is an old revision of the document!
Magento CE 2.x Installation
This guide will explain how to get up and running with Magento CE 2.x on LiteSpeed Web Server.
Install PHP modules
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.
Step 1. Install PHP
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
Step 2. Setup PHP
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:
- Name: lsphp →
lsphp70
- Command: $SERVER_ROOT/fcgi-bin/lsphp5 →
$SERVER_ROOT/lsphp70/bin/lsphp
Step 3. Configure PHP
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:
Step 4. Restart LSWS
When you are finished, click the Save icon to save your changes, then click the Graceful Restart button.
Step 5. PHP Verification
Visit http://your_server_IP/phpinfo.php
and make sure PHP Version shows 7.0.x
.
MYSQL 5.6 Installation:
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 Magento CE DB Account
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 Wordpress username and password that are different than our example.
Set Index File
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.
Download and Extract Wordpress
To illustrate setting up Wordpress on a vhost we'll use the default virtual host, “Example”. You can download Wordpress from their official download page.
Please note that the document root of 'Example' virtual host is /usr/local/lsws/Example/http/
unzip latest.zip mv wordpress/* .
Wordpress Installation
Open the browser with URL http://server_IP:8088/
wp-config.php file
Once you open the url in browser you will see this window:
As you can see, WordPress will ask all database related information on next step and will create wp-config.php
file using this information. If for some reasons (mostly permissions issues) WordPress is not able to create this file, it will provide you with data which you can copy and manually create wp-config.php
file inside your WordPress home.
Database Details
We've created the database above. Just enter the database details and click 'Submit'. If the WordPress installer is successfully able to connect to the database, it will start the installation process.
Run WordPress Install
If everything works out great, just click 'Run the install' and WordPress will perform the installation.
Enter General Website details
WordPress will now ask you information regarding your blog/site, like whats the blog name, username you want to use and password, example configurations:
- Site Title: litespeedtech
- Username: litespeedtech
- Password: litespeedtech
- Your email: example@example.com
If you are satisfied with the details click 'Install WordPress'.
WordPress is now successfully installed, you can browse the home at http://server_IP:8088/ and wordpress admin at http://server_IP:8088/wp-admin