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.

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 3. Restart LSWS

When you are finished, click the Save icon to save your changes, then click the Graceful Restart button.

Step 4. PHP Verification

Visit http://your_server_IP/phpinfo.php and make sure PHP Version shows 7.0.x.

Install MariaDB:

sudo yum install mariadb-server
sudo systemctl start mariadb

Set new password:

/usr/bin/mysql_secure_installation

Enter $yourpassword

Create the Wordpress database and your Wordpress user/password:

 mysql -u root -p$yourmysqlpassword
 create database wordpress; grant all privileges on wordpress.* to wordpress@localhost identified by 'wordpress'; exit;

Note: For security purposes, you should use a Wordpress 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 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/* .

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

  • Admin
  • Last modified: 2017/09/16 09:28
  • by Usman Nasir