Deploying a Prestashop ecommerce: the cloud friendly way — Part 2 — Server set-up 🤓

Configure the server for Prestashop

Pol Guixé
Origen Studio
2 min readApr 3, 2017

--

This article is a continuation of Deploying a Prestashop ecommerce: the cloud friendly way — Part 1

Once our server is up and running, is time to:

Configure the Ubuntu server for Prestashop

First SSH into the EC2 instance.

If it prompts with undefined locales fix that.

Locales not configured properly

To understand where the problem is just run locale. Check which values are missing:

To fixt we will add the missing values. To access the locales config file do:

sudo nano /etc/default/locale

Add the missing values:

LANG=”en_US.UTF-8”
LC_ALL=en_US.UTF-8
LANGUAGE=en_US:en

If you want to change the locale of your server you can also do that in this step by modifying the values above.

Then exit the server and SSH back in. Run locale and ensure that no values are missing.

Next step, is to ensure that everything is up-to-date. Run:

  1. sudo apt-get update
  2. sudo apt-get upgrade
  3. sudo reboot

Now we start the real configuration!

After the server is restarted, SSH back in.

Install a LAMP — Linux, Apache, MySQL, PHP — server by running:

sudo apt-get install lamp-server^

If you are planning on using an external DB you don’t need to install MySQL locally. You can install Apache and PHP only.

Then install PHP dependencies for Prestashop:

sudo apt-get install php5-curl php5-gd php5-mcrypt php5-memcache php5-intl

Then enable module php5-mcrypt with:

sudo php5enmod mcrypt

Then we need to edit the PHP configuration file. To access the config file run

sudo nano /etc/php5/apache2/php.ini

There find and add or modify the following lines:

memory_limit = 1024M
upload_max_filesize = 16M
max_execution_time = 60
file_uploads = On
allow_url_fopen = On
register_globals = Off

At the end just run

sudo service apache2 restart

Then we need change the order on which Apache serves files. To modify the file run :

sudo /etc/apache2/mods-enabled/dir.conf

Make sure index.php is first:

<IfModule mod_dir.c>
DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm
</IfModule>

The next step is to configure a database for our Prestashop

See Deploying a Prestashop ecommerce: the cloud friendly way — Part 3

--

--

Pol Guixé
Origen Studio

Aerospace engineer working on software development.☺️ Building great products at @theorigenstudio. 🍕and 🚵‍♂️⛷ passionate