Wednesday 10 December 2014

Installing PortaShop locally on ubuntu 14.04

These are the steps I took:
  1. Install apache2, mysql, php5 and other requirements: php5-mysql, php5-mcrypt, and php5-gd.
  2. Create a database called "prestashop" and a database user qith all permissions on it.
  3. Download the site files at: http://www.prestashop.com/en/download. Mine were "prestashop_1.6.0.9.zip"
  4. Uncompress it and copy the top directory called "prestashop" to where the web application will be stored. I'll use "/path/to/prestashop" from now on.
  5. Make sure the permissions in the directory allow the web server user "www-data" to have full access to it. As root run:
    1. chgrp -R www-data /path/to/prestashop
    2. chmod -R g+rwx /path/to/prestashop
  6. Create a new virtual host with the name "dev.prestashop.local"
    1. Add the new host name to the hosts file, adding the line "127.0.0.1  dev.prestashop.local"
    2. Copy the file /etc/apache2/sites-available/000-default.conf to /etc/apache2/sites-available/prestashop.conf
    3. Modify its content to:
    4. <VirtualHost *:80>
      
       ServerName dev.prestashop.local
      
       DocumentRoot /path/to/prestashop
      
        <Directory /path/to/prestashop >
      
         Options Indexes FollowSymLinks MultiViews
      
         AllowOverride all
      
         Require all granted
      
        </Directory>
      
        ...
      
      </VirtualHost>
      
      
  7. Reload apache, running as root: service apache2 reload
When you browse to dev.prestashop.local you should be able to pass all the compatibility tests:

PrestaShop compatibility test passed