{"id":425,"date":"2018-10-17T10:35:10","date_gmt":"2018-10-17T10:35:10","guid":{"rendered":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/10\/17\/how-to-install-prestashop-on-debian-9-%e2%80%a2-linuxcloudvps-blog\/"},"modified":"2018-10-17T13:47:25","modified_gmt":"2018-10-17T13:47:25","slug":"prestashopondebian9","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/10\/17\/prestashopondebian9\/","title":{"rendered":"How to Install PrestaShop on Debian 9 \u2022 LinuxCloudVPS Blog"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2018\/09\/How-to-Install-PrestaShop-on-Debian-9.jpg\" alt=\"How to Install PrestaShop on Debian 9\" width=\"600\" height=\"300\" \/><\/p>\n<p>In this article, we will show you how to install PrestaShop on a <a href=\"https:\/\/www.linuxcloudvps.com\/debian-cloud-vps.html\" target=\"_blank\" rel=\"noopener\">Debian 9 VPS<\/a>. Prestashop is an easy to use open source shopping cart application written in PHP used by website developers to build and run a successful online store. To install PrestaShop on a Debian 9 VPS follow the very easy steps described below.<\/p>\n<h2>Requirements<\/h2>\n<p>At the time of writing this tutorial, the latest stable version of PrestaShop is v1.7.4.2 and it requires:<\/p>\n<ul>\n<li>Nginx or Apache Web Server<\/li>\n<li>MySQL 5.5 or later is recommended, or MariaDB installed on your Linux virtual server.<\/li>\n<li>PHP 5.4 or higher with the following PHP extensions enabled: mcrypt, cURL, GD, GZIP and PDO.<\/li>\n<li>Full SSH root access or a user with sudo privileges is also required<\/li>\n<\/ul>\n<h2>Step 1: Log in via SSH on the Ubuntu server:<\/h2>\n<p>Log in to the VPS via SSH as user root<\/p>\n<p>ssh roo@IP_Address -p Port_number<\/p>\n<h2>Step 2: Update all OS packages<\/h2>\n<p>Once you are logged, run the following command to make sure that all installed OS packages are up to date:<\/p>\n<p>apt-get update<br \/>\napt-get upgrade<\/p>\n<h2>Step 3: Install Nginx, MariaDB and PHP 7<\/h2>\n<p>Stop and disable Apache service:<\/p>\n<p>systemctl stop apache2<br \/>\nsystemctl disable apache2<\/p>\n<p>Install Nginx from Debian package repository. Simply, run the following command to install Nginx on your server:<\/p>\n<p>apt-get install nginx<\/p>\n<p>After the installation is complete, Nginx will automatically start.<br \/>\nTo verify that Nginx is running on the server, you can use the following command:<\/p>\n<p>systemctl status nginx<\/p>\n<p>Make sure that Nginx server is configured to automatically start upon a server boot:<\/p>\n<p>systemctl enable nginx<\/p>\n<p>Install MariaDB and PHP 7 on your server using the following commands:<\/p>\n<p>apt-get install mysql-server<br \/>\napt-get install php7.0 php7.0-cli php7.0-common php7.0-fpm php7.0-curl php7.0-zip php7.0-gd php7.0-mysql php7.0-xml php7.0-mcrypt php7.0-mbstring<\/p>\n<p>Enable MariaDB and php-fpm to automatically start upon a server boot:<\/p>\n<p>systemctl enable mariadb.service<br \/>\nsystemctl enable php7.0-fpm.service<\/p>\n<h2>Step 4: Install PrestaShop<\/h2>\n<p>Download the latest stable version of PrestaShop in the \/opt directory on your server and extract it in the \/var\/www\/html\/ directory:<\/p>\n<p>cd \/opt<br \/>\nwget https:\/\/download.prestashop.com\/download\/releases\/prestashop_1.7.4.2.zip<br \/>\nunzip prestashop_1.7.4.2.zip<br \/>\nunzip prestashop.zip -d \/var\/www\/html\/prestashop\/<\/p>\n<h2>Step 5: Modify the PHP configuration<\/h2>\n<p>Edit the \u2018\/etc\/php\/7.0\/fpm\/php.ini\u2019 PHP configuration file.<br \/>\nModify the memory_limit value to 128MB or higher:<\/p>\n<p>memory_limit = 256M<\/p>\n<p>Also, set upload_max_filesize to 32 MB (or more):<\/p>\n<p>upload_max_filesize = 32M<\/p>\n<p>Also, modify the following settings:<\/p>\n<p>file_uploads = On<br \/>\nallow_url_fopen = On<\/p>\n<p>Restart the php-fpm service for the changes to take effect:<\/p>\n<p>systemctl restart php7.0-fpm.service<\/p>\n<h2>Step 6: Set file permissions<\/h2>\n<p>The web server user (www-data) needs to be able to write to files and directories inside the \u2018\/var\/www\/html\/prestashop\u2019 directory, so it can easily be accomplished by executing the following command:<\/p>\n<p>chown www-data:www-data -R \/var\/www\/html\/prestashop\/<\/p>\n<h2>Step 7: Configure Nginx to serve PrestaShop<\/h2>\n<p>Create a new Nginx server block:<\/p>\n<p>vi \/etc\/nginx\/sites-available\/your-domain.com<\/p>\n<p>and add the following content:<\/p>\n<p>server {<br \/>\nserver_name your-domain.com;<br \/>\nlisten 80;<br \/>\nroot \/var\/www\/html\/prestashop\/;<br \/>\naccess_log \/var\/log\/nginx\/your-domain.com_access.log;<br \/>\nerror_log \/var\/log\/nginx\/your-domain.com_error.log;<\/p>\n<p>index index.php;<\/p>\n<p>rewrite ^\/api\/?(.*)$ \/webservice\/dispatcher.php?url=$1 last;<br \/>\nrewrite ^\/([0-9])(-[_a-zA-Z0-9-]*)?\/[_a-zA-Z0-9-]*.jpg$ \/img\/p\/$1\/$1$2.jpg last;<br \/>\nrewrite ^\/([0-9])([0-9])(-[_a-zA-Z0-9-]*)?\/[_a-zA-Z0-9-]*.jpg$ \/img\/p\/$1\/$2\/$1$2$3.jpg last;<br \/>\nrewrite ^\/([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?\/[_a-zA-Z0-9-]*.jpg$ \/img\/p\/$1\/$2\/$3\/$1$2$3$4.jpg last;<br \/>\nrewrite ^\/([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?\/[_a-zA-Z0-9-]*.jpg$ \/img\/p\/$1\/$2\/$3\/$4\/$1$2$3$4$5.jpg last;<br \/>\nrewrite ^\/([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?\/[_a-zA-Z0-9-]*.jpg$ \/img\/p\/$1\/$2\/$3\/$4\/$5\/$1$2$3$4$5$6.jpg last;<br \/>\nrewrite ^\/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?\/[_a-zA-Z0-9-]*.jpg$ \/img\/p\/$1\/$2\/$3\/$4\/$5\/$6\/$1$2$3$4$5$6$7.jpg last;<br \/>\nrewrite ^\/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?\/[_a-zA-Z0-9-]*.jpg$ \/img\/p\/$1\/$2\/$3\/$4\/$5\/$6\/$7\/$1$2$3$4$5$6$7$8.jpg last;<br \/>\nrewrite ^\/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?\/[_a-zA-Z0-9-]*.jpg$ \/img\/p\/$1\/$2\/$3\/$4\/$5\/$6\/$7\/$8\/$1$2$3$4$5$6$7$8$9.jpg last;<br \/>\nrewrite ^\/c\/([0-9]+)(-[_a-zA-Z0-9-]*)\/[_a-zA-Z0-9-]*.jpg$ \/img\/c\/$1$2.jpg last;<br \/>\nrewrite ^\/c\/([a-zA-Z-]+)\/[a-zA-Z0-9-]+.jpg$ \/img\/c\/$1.jpg last;<br \/>\nrewrite ^\/([0-9]+)(-[_a-zA-Z0-9-]*)\/[_a-zA-Z0-9-]*.jpg$ \/img\/c\/$1$2.jpg last;<br \/>\ntry_files $uri $uri\/ \/index.php?$args;<\/p>\n<p>location ~* .(jpg|jpeg|gif|css|png|js|ico|html)$ {<br \/>\naccess_log off;<br \/>\nexpires max;<br \/>\n}<\/p>\n<p>location ~ .php {<br \/>\nfastcgi_index index.php;<br \/>\nfastcgi_split_path_info ^(.+.php)(.*)$;<br \/>\ninclude \/etc\/nginx\/fastcgi_params;<br \/>\nfastcgi_pass unix:\/var\/run\/php7-fpm.sock;<br \/>\nfastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;<br \/>\n}<br \/>\n}<\/p>\n<p>Create a symbolic link:<\/p>\n<p>ln -s \/etc\/nginx\/sites-available\/your-domain.com \/etc\/nginx\/sites-enabled\/your-domain.com<\/p>\n<p>Restart the Nginx service for the changes to take effect:<\/p>\n<p>systemctl restart nginx<\/p>\n<h2>Step 8: Create a MariaDB database for PrestaShop<\/h2>\n<p>Login to the MariaDB console with the root account:<\/p>\n<p>mysql -u root -p<\/p>\n<p>Create a MariaDB database, user and grant permissions to the user using the following command:<\/p>\n<p>MariaDB [(none)]&gt; CREATE DATABASE prestashop;<br \/>\nMariaDB [(none)]&gt; GRANT ALL PRIVILEGES ON prestashop.* TO &#8216;prestashop&#8217;@&#8217;localhost&#8217; IDENTIFIED BY &#8216;Str0ngPa55w0rd&#8217;;<br \/>\nMariaDB [(none)]&gt; FLUSH PRIVILEGES;<br \/>\nMariaDB [(none)]&gt; q<\/p>\n<p>Do not forget to replace \u2018Str0ngPa55w0rd\u2019 with an actual strong password.<\/p>\n<p>Open your favorite web browser and type in the following URL to access the PrestaShop web interface and start the setup:<\/p>\n<p>http:\/\/your-domain.com\/<\/p>\n<p>From here you can finish the setup by selecting the installation language and entering the information about your PrestaShop store. Then, create an administrator account and enter the following information to configure the database:<\/p>\n<p>Database server address: 127.0.0.1<\/p>\n<p>Database name: prestashop<\/p>\n<p>Database login: prestashop<\/p>\n<p>Database password: enter the MariaDB password for the PrestaShop MariaDB user.<\/p>\n<p>For security reason, you must delete the \u2018install\u2019 directory:<\/p>\n<p>rm -rf \/var\/www\/html\/prestashop\/install\/<\/p>\n<p>Once you deleted the installation directory, login to the PrestaShop back-end by clicking on the \u2018Manage your store\u2019 button.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2018\/09\/installing-prestashop-on-debian-9.jpg\" alt=\"installing prestashop on debian 9\" width=\"600\" height=\"301\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Congratulations! PrestaShop has been successfully installed on your server. You can now start using PrestaShop and customize it according to your needs.<\/p>\n<p>Of course, you don\u2019t have to Install <a href=\"https:\/\/www.linuxcloudvps.com\/debian-cloud-vps.html\">PrestaShop on a Debian 9 VPS<\/a> if you use our Managed PrestaShop Hosting services, in which case you can simply ask our expert Linux admins to install PrestaShop on Debian 9, for you. They are available 24\u00d77 and will take care of your request immediately.<\/p>\n<p>PS. If you liked this post, on how to Install PrestaShop on Debian 9, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.<\/p>\n<p><a href=\"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-prestashop-on-debian-9\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we will show you how to install PrestaShop on a Debian 9 VPS. Prestashop is an easy to use open source shopping cart application written in PHP used by website developers to build and run a successful online store. To install PrestaShop on a Debian 9 VPS follow the very easy steps &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/10\/17\/prestashopondebian9\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to Install PrestaShop on Debian 9 \u2022 LinuxCloudVPS Blog&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-425","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/425","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=425"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/425\/revisions"}],"predecessor-version":[{"id":488,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/425\/revisions\/488"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=425"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=425"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=425"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}