To install PrestaShop on an Ubuntu VPS
At the time of writing this tutorial, the latest stable version of PrestaShop is v22.214.171.124 and it requires:
- PHP >= 5.1 with the following PHP extensions enabled: cURL, GD, GZIP, PDO, DOM, SimpleXML and SOAP. Also, using MemCached and mycrpt PHP extensions is highly recommended for better site performance.
- Apache Web Server >= 2.0 compiled with mod_gzip and mod_rewrite modules.
- MySQL >= 5.0 installed on your virtual server.
Update the server’s OS packages using the following commands:
apt-get update apt-get upgrade
Install PHP, MySQL and PHP modules required by PrestaShop:
apt-get install mysql-server php5 php5-cli php5-mysql php5-gd php5-mcrypt php5-memcache
Download the latest version of PrestaShop available at http://www.prestashop.com/en/download to the server and extract it using the following commands:
cd /root/ wget http://www.prestashop.com/download/old/prestashop_126.96.36.199.zip unzip prestashop_188.8.131.52.zip
Create a new MySQL database for PrestaShop on your server:
mysql -u root -p mysql> CREATE DATABASE prestashopdb; mysql> GRANT ALL PRIVILEGES ON prestashopdb.* TO 'prestashop'@'localhost' IDENTIFIED BY 'your-password' WITH GRANT OPTION; mysql> FLUSH PRIVILEGES; mysql> quit
Create a new virtual host directive in Apache. For example, create a new Apache configuration file ‘prestashop.conf’:
Then, add the following lines:
<VirtualHost *:80> ServerAdmin email@example.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>
Run the following command:
ln -s /etc/apache2/sites-available/prestashop.conf /etc/apache2/sites-enabled/prestashop.conf
Edit the ‘/etc/php5/apache2/php.ini’ PHP configuration file and add/modify the following lines:
memory_limit = 128M upload_max_filesize = 16M max_execution_time = 60 file_uploads = On allow_url_fopen = On magic_quotes_gpc = Off register_globals = Off
Restart the Apache web server for the changes to take effect:
service apache2 restart
Move the PrestaShop installation files to the document root directory defined in the virtual host directive above:
mv /root/prestashop/ /var/www/prestashop/
Also, the webserver user (www-data) needs to be able to write to files and directories inside the ‘/var/www/prestashop’ directory, so it can easily be accomplished by executing the following command:
chown www-data:www-data -R /var/www/prestashop/
Open http://your-domain.com/ in your popular web browser and follow the easy instructions.
For security reasons, it is recommended to delete the install directory (‘/var/www/prestashop/install’) once you are done with the installation process. That is it. The PrestaShop installation is now complete.
Of course you don’t have to do any of this if you use one of our Linux VPS Hosting services, in which case you can simply ask our expert Linux admins to install PrestaShop for you. They are available 24×7 and will take care of your request immediately.
PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.