In this tutorial, we will install PrestaShop cms on CentOS 7 server. PrestaShop is a 100% free, open-source e-commerce solution which allows you to maintain your own online shop.
It is written in PHP with support for the MySQL database management system. According to Prestashop’s official website, more than 250,000 eCommerce sites run on PrestaShop.
The installation process is really simple. I will be performing all the operations as root user and if you’re not running as root user then please use sudo before commands.
What we need to have before installing PrestaShop server.
- LAMP Stack
- A database and user for PrestaShop.
- PrestaShop installation & Configuration
Install LAMP Stack.
To know how to install LAMP stack on CentOS 7, you can follow this post.
Set up a Database and User for PrestaShop.
Make sure MariaDB/MySQL is running.
[root@debyum ~]# systemctl status mysql.service ● mysql.service - LSB: start and stop MySQL Loaded: loaded (/etc/rc.d/init.d/mysql) Active: active (running) since Sun 2016-10-16 18:43:06 UTC; 14min ago Docs: man:systemd-sysv-generator(8) Process: 10815 ExecStop=/etc/rc.d/init.d/mysql stop (code=exited, status=0/SUCCESS) Process: 10830 ExecStart=/etc/rc.d/init.d/mysql start (code=exited, status=0/SUCCESS) CGroup: /system.slice/mysql.service ├─10836 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/debyum.pid └─10908 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --us... Oct 16 18:43:05 debyum systemd: Starting LSB: start and stop MySQL... Oct 16 18:43:05 debyum mysql: Starting MySQL.161016 18:43:05 mysqld_safe Logging to '/var/lib/mysql/debyum.err'. Oct 16 18:43:06 debyum mysql: SUCCESS! Oct 16 18:43:06 debyum systemd: Started LSB: start and stop MySQL. Hint: Some lines were ellipsized, use -l to show in full.
Create a database and user.
We will create a Database and user for Database.
I will be using these values for this procedure.
- Database Name: store_db ( change it with your own PrestaShop database name.)
- Database User: owner_of_store ( change it with your PrestaShop database user.)
- Database User’s Password: prestashop_user_pwd ( change it with the password you want to assign to you Prestashop database user.)
[root@debyum ~]# mysql -uroot -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 16 Server version: 10.1.18-MariaDB MariaDB Server Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> CREATE DATABASE store_db; Query OK, 1 row affected (0.00 sec) mysql> GRANT ALL PRIVILEGES ON store_db.* to 'owner_of_store'@'localhost' identified by 'prestashop_user_pwd'; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.01 sec) mysql> quit Bye [root@debyum ~]#
You will need to enter these details later while configuring PrestaShop database.
- Database name.
- User name.
- User’s Password.
Now we have a database and a user for Prestashop.
Download Prestashop 126.96.36.199 and extract it in /var/www/html directory.
[root@debyum ~]# wget https://download.prestashop.com/download/releases/prestashop_188.8.131.52.zip [root@debyum ~]# unzip prestashop_184.108.40.206.zip -d /var/www/html/
Give Proper ownership to /var/www/html directory
[root@debyum ~]# chown -R apache:apache /var/www/html
Editing php.ini for optimal performance.
[root@debyum ~]# sed -i '/memory_limit/c\memory_limit = 128M' /etc/php.ini [root@debyum ~]# sed -i '/upload_max_filesize/c\upload_max_filesize = 16M' /etc/php.ini [root@debyum ~]# sed -i '/max_execution_time/c\max_execution_time = 60' /etc/php.ini
Now the Last thing to do is configure the PrestaShop.
Install & Configure PrestaShop.
In order to install PrestaShop, Next .web interface, open a web browser and navigate to the following:
you will see something like this.
Agree with terms and conditions and click Next,
In Installation Assistant, you need to enter your Store Name Description, Your Account info. Remember your E-mail address will be used as your login account.
Fill out the info and click Next.
In Next page, you need to enter your Prestashop database and user info.
Fill out that details carefully and you can Test your database connection to check whether you entered everything carefully.
Testing database connection.
Everything is fine, click Next.
wait for the installation to finish.
Now we need to delete install folder because of security reasons, otherwise, you will see an error page like this when you will click The BACK OFFICE link.
To avoid this error you need to delete install folder.
Now if you have followed all the steps carefully this single command will be enough to delete the install folder.
shell> rm -rf /var/www/html/prestashop/install
Now everything is fine and you can visit FRONT OFFICE and BACK OFFICE by clicking the links.
PrestaShop is really easy to install and has lots of features to help users in managing their online shop.
If you want a simple script to install PrestaShop in CentOS 7 (test environments) then you can visit Page 2 of this article.
Finally, I have tried to cover all the basic to advance concepts with their examples. Still, if I have missed anything please update us through comment box. I will keep updating the same based on feedback’s received.
Thanks for visiting this page and have a great day.