Install: Quick Install PrestaShop on OpenLiteSpeed
After you install OpenLiteSpeed, follow the instructions below to get your PrestaShop 1.7 site working.
- Install PHP modules
- MariaDB Installation
- Create PrestashopDB Account
- Set Index File and rewrite rules
- Download and Extract Prestashop
- Run the Prestashop install script
Install PHP modules
The easiest way to install PHP for OpenLiteSpeed (without ols1clk) 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
Use the following command to install PHP with the modules required:
yum install lsphp70 lsphp70-intl lsphp70-xml-7.0 lsphp70-json-7.0 lsphp70-common lsphp70-mysqlnd lsphp70-bcmath lsphp70-soap lsphp70-opcache lsphp70-mcrypt lsphp70-pdo lsphp70-process lsphp70-gd lsphp70-mbstring
Note: There are multi versions of LSPHP (lsphp53, lsphp54, lsphp55, lsphp56, lsphp70, lsphp71, lsphp72) available.
Step 2. Set up 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
Address: uds://tmp/lshttpd/lsphp.sock → uds://tmp/lshttpd/lsphp70.sock
Command: $SERVER_ROOT/fcgi-bin/lsphp5 → $SERVER_ROOT/lsphp70/bin/lsphp
If you are not using RPM/APT, or you prefer to build PHP by yourself, see our instructions for building PHP here.
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 (Optional)
Visit http://your_server_IP:8088/phpinfo.php
and make sure PHP Version shows 7.0.x
.
MariaDB Installation
Install MariDB:
yum install mariadb-server
systemctl start mariadb
Set new password:
/usr/bin/mysql_secure_installation
Enter $yourpassword
Create Prestashop DB Account
mysql -u root -p$yourmysqlpassword
create database prestashop;
grant all privileges on prestashop.* to prestashop@localhost identified by 'prestashop';
exit;
Set Index File
An index file needs to be set in 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 Prestashop
To illustrate setting up Prestashop on a vhost we’ll use the default virtual host, “Example”. You can download Prestashop from command or their official download page. Please note that the document root of ‘Example’ virtual host is /usr/local/lsws/Example/html/.
cd /usr/local/lsws/Example/html
mkdir prestashop; cd prestashop
## Move prestashop_1.7.3.3.zip to here
unzip prestashop_*.zip
Grant the web server user write permission to create wp-config.php during installation
chown -R nobody:nobody prestashop
Graceful restart
When you are finished, click the Save icon to save your changes, then click the Graceful Restart button.
Run the Prestashop install script
Step 1. Run installation script
Point your browser with default port to http://server_ip:8088/prestashop
Step 2. Choose language
This will start the Prestashop web installer and it will look something like this:
Step 3. Verify requirements
Once the requirements are met you will be directed to enter Configure site information.
Step 4. Configure site
On this step, the installer will let you configure settings for your site. Example settings are:
- Site name:
Litespeedtech
- Site email address:
prestashop@example.com
- Username:
litespeedtech
- Password:
litespeedtech
Step 5. Set up database
We’ve created the database above. Just enter the database details and click Save and continue. If the Prestashop installer is successfully able to connect to the database, it will start the installation process.
Step 6. Remove install file
rm -rf install
This is how Front store look like:
PrestaShop is now successfully installed, you can browse at:
- Front page: http://server_IP:8088/prestashop
- Admin page: http://server_IP:8088/prestashop/admin