First off, you might be wondering why PrestaShop when there are many solutions easier to start with and setup including ones offered by hosting providers? Well, quite simple, hosting your own relieves you of your monthly hosting fee’s. Also, many providers give a limit of items sold, or a limit of sales volume and charge extra to expand your limits. Also, PrestaShop has support for multivendor setup built in which is not an easy task to do with WordPress ecommerce plugins. If you can install WordPress on your own server, PrestaShop is not that trivial of a task to setup.
First off, follow the guide to setting up a LAMP server here. Please note, in this example, I am using TTOS Linux Version 1.0 PR4 (It is a 64-bit Debian GNU/Linux 8.x distribution, any modern Debian, Linux Mint, or Ubuntu will work). After this, you want to instll phpmyadmin with the following command as root…
“# apt-get install phpmyadmin”
During the install, it will ask a few setup questions. You want to choose Apache2 as the web server, and say yes to setup with dbconfig-common. You will be prompted for your MySQL username / password as well. You will then be asked to enter the password that you would like to log into phpmyadmin with.
After the install completed, you need to add it to Apache2 configuration. Using the command line, type the following as root user…
” # nano /etc/apache2/apache2.conf “
then add an include memo for phpmyadmin
” Include /etc/phpmyadmin/apache.conf “
save and exit, then restart Apache2 with the following command…
” # service apache2 restart “
The next step is to setup .htaccess file to secure phpmyadmin with Apache2’s native implementation. First, edit the config file with the following command as root…
” # nano /etc/phpmyadmin/apache.conf “
Under directory section, add “AllowOverride All” under “DirectoryIndex index.php”
Next, type the following as root…
” # nano /usr/share/phpmyadmin/.htaccess “
Type in the following to setup user authorization…
” AuthType Basic
AuthName “Restricted Files”
Now we can create a password file with the following command…
” # htpasswd -c /path/to/passwords/.htpasswd username ”
After saving the username and password, you must restart Apache2 for changes to take effect…
” # service apache restart”
Now you can log in to phpmyadmin with using “http://yourdomain/phpmyadmin” in your web browser. Login to your server using root account, and your password. In the listview to the left of the screen, click new+, give the database a name, then click create. Find your new database listed in the list view, select it, then click in “new” group, “add user”. Don’t select global privileges for the user, just grant all on your specific database. Write down your database name, username, and password. Click “go”
TIP: don’t use the name presta, prestashop, shop, or any name hinting what it is for. This makes it harder to exploit the database. Search the web for tips on securing databases in MySQL.
Now we need to make sure we have all the php modules required for prestashop before we can begin the install…
“# apt-get install php5-cli php5-mysql php5-gd php5-mcrypt php5-memcache “
Next, issue the following set of commands to download and unpack prestashop…
” # cd /var/www/
# wget http://www.prestashop.com/download/old/prestashop_220.127.116.11.zip
# uzip prestashop_18.104.22.168.zip”
This will create the directory /var/www/prestashop with the webstore contents inside. From here, we need to create a config file for the web server, and activate it. First we create a prestashop config file.
“# nano /etc/apache2/sites-available/prestashop.conf”
and type in the following as the contents (using your own email address, and domain name)….
Options FollowSymLinks Indexes MultiViews
CustomLog /var/log/apache2/your-domain.com-access_log common
Save the file and activate the configuration by issuing the following commands…
“# a2ensite prestashop.conf”
“# service apache2 restart”
Next, give permissions to the directory with the following…
“# chown www-data:www-data -R /var/www/prestashop”
Now we login “http://yourdomain.com” and follow the setup using the database, username, and password created from phpmyadmin.
When setup is complete, delete the install directory for security reasons with the following command as root…
“# rm -frv /var/www/prestashop/install”
And that’s it! If you set up a secure prestashop using this tutorial, please post a link in the comments below. Also include any issues you had, and how you solved them for other readers. Your site link serves us as a demo of the outcome of this tutorial, and provides you with a source of free marketing! Our site was created with this set of procedures and can be checked out at the following link…