How to Install and Configure PrestaShop on Ubuntu 14.04

January 21, 2015 | By
| Reply More

PrestaShop is a free and open source e-commerce solution which supports payment gateways such as  Google Checkout, Direct,  Skrill, PayPal, PayPal Payments Pro (Direct), Authorize.Net and EBANX Checkout via their respective APIs. Further payment modules are offered commercially.

prestashop

It is available under the Open Software License and officially launched in August 2007. The software is written in PHP and based on the Smarty template engine, is currently used by 165,000 shops worldwide. It uses MySQL as its default database software.

Today, in this tutorial we'll go through "How to install PrestaShop in your Ubuntu Server 14.04 LTS (Trusty)". Here is the step wise tutorial on it:

1. Installing LAMP Stack

Before you install PrestaShop, you'll need to ensure that you have LAMP (Apache2, MySQL, PHP)server installed in your Ubuntu Server. Here is a quick tutorial on how to setup LAMP Stack. But you can hit the command below to install LAMP Stack:

Apache2 : $ sudo apt-get install apache2 apache2-utils

PHP5 : $ sudo apt-get install php5 php5-mysql php-pear php5-gd  php5-mcrypt php5-curl

MYSQL Server : $ sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql

2. Downloading PrestaShop

You can download the latest version from their official download site http://www.prestashop.com/download or can clone their git repository from their official github repo: https://github.com/PrestaShop/PrestaShop . If you need an old version of prestashop, you can goto this link http://www.prestashop.com/en/developers-versions

Here, we'll be downloading PrestaShop from the github site:

$ cd /tmp
$ wget https://github.com/PrestaShop/PrestaShop/archive/1.6.zip
downloading-prestashop
Extracting the zip file to /var/www/. Note: Here /var/www/ is the webroot for apache2 server and it depends on the web server used:
$ sudo apt-get install unzip
$ sudo unzip PrestaShop-1.6.zip -d /var/www/

Now, we'll need to appropriate permissions for the hosting directory:

$ sudo chown -R www-data:www-data /var/www/prestashop/

3. Database Initialization

We need a database for it, We will create the database as follows:

mysql -u root -p

Here we are adding database=prestashopdb user=prestashopuser and password=prestashoppassword, you can change them according to your requirement and please note that we'll need them later:

CREATE DATABASE prestashopdb;
CREATE USER linoxide@localhost IDENTIFIED BY 'prestashoppassword';
GRANT ALL PRIVILEGES on prestashopdb.* to linoxide@localhost

Further moving ahead:

FLUSH PRIVILEGES;
exit

Now we'll restart Apache2 and MySQl servers:

$ sudo service apache2 restart
$ sudo service mysql restart

 4. Configuring Apache Web Server

Now, we'll create a new virtual host directive in Apache. For example, create a new Apache configuration file ‘prestashop.conf’:

$ sudo nano /etc/apache2/sites-available/prestashop.conf

Then, add the following lines:

<VirtualHost *:80>
ServerAdmin admin@your-domain.com
DocumentRoot /var/www/prestashop/
ServerName your-domain.com
ServerAlias www.your-domain.com
<Directory /var/www/prestashop/>
    Options FollowSymLinks Indexes MultiViews
    AllowOverride All
</Directory>
    ErrorLog /var/log/apache2/your-domain.com-error_log
    CustomLog /var/log/apache2/your-domain.com-access_log common
</VirtualHost>

Here's a preview example on how it looks:

apache2 config prestashop

Run the following command:

$ sudo ln -s /etc/apache2/sites-available/prestashop.conf /etc/apache2/sites-enabled/prestashop.conf

Restart the Apache web server for the changes to take effect:

$ sudo service apache2 restart

Open http://your-domain.com/ or http://IP-Address/ in your  web browser and follow the easy instructions.

prestashop demo

For security reasons, it is recommended to delete the install directory (‘/var/www/prestashop/install’) once you are done with the installation process. Thats it, the installation is now complete. Hurray!

Filed Under : LINUX HOWTO, OPENSOURCE

Free Linux Ebook to Download

Leave a Reply

Commenting Policy:
Promotion of your products ? Comment gets deleted.
All comments are subject to moderation.