{"id":7000,"date":"2018-10-11T15:19:58","date_gmt":"2018-10-11T12:19:58","guid":{"rendered":"https:\/\/www.howtoforge.com\/tutorial\/debian-zen-cart-installation\/"},"modified":"2018-10-11T15:19:58","modified_gmt":"2018-10-11T12:19:58","slug":"how-to-install-zen-cart-on-debian-9","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/how-to-install-zen-cart-on-debian-9\/","title":{"rendered":"How to Install Zen Cart on Debian 9"},"content":{"rendered":"<p>Zen Cart is a free open source e-commerce content management and shopping cart platform. The software is written in PHP programming language and often installed on Linux under Apache\/Nginx web servers, PHP and MySQL\/MariaDB database management system, also known as LAMP or LEMP stack.\u00a0 Zen Cart e-commerce\u00a0solution is used to easily create online shops for different businesses and advertise and sell services and merchandise.<\/p>\n<p>In this guide, I\u2019ll show you how to install and configure the latest version Zen Cart on Debian 9, in order to create a free online shopping store.<\/p>\n<h2 id=\"requirements\">Requirements<\/h2>\n<ul>\n<li><span\/>Minimal\u00a0Installation\u00a0of\u00a0Debian\u00a09\u00a0server\u00a0on\u00a0a\u00a0bare-metal\u00a0machine\u00a0or\u00a0on\u00a0a\u00a0virtual\u00a0private\u00a0server<\/li>\n<li><span\/>A\u00a0static\u00a0IP\u00a0address\u00a0configured\u00a0for\u00a0one\u00a0of\u00a0your\u00a0system\u00a0network\u00a0interfaces\u00a0cards<\/li>\n<li><span\/>sudo\u00a0root\u00a0privileges\u00a0for\u00a0a\u00a0local\u00a0or\u00a0remote\u00a0account\u00a0or\u00a0direct\u00a0access\u00a0to\u00a0root\u00a0account<\/li>\n<li><span>A domain name, private or public, depending on your deployment, with the proper DNS records configured for web services. If don\u2019t have a valid or a registered domain name you can perform the installation and access the website via your server IP address<\/span><\/li>\n<li><span>If you want to use website registration, comment moderation and other features, your should have a running mail server properly configured at your premises with remote access to its IMAP and SMTP services.<\/span><\/li>\n<\/ul>\n<h2 id=\"prerequirements\">Pre-Requirements<\/h2>\n<p>Before starting to install and configure Zen Cart from sources in your own server, first assure the system meets all the software requirements for compiling and installing the application.\u00a0 On the first step, update your system repositories and software packages by issuing the following command.<\/p>\n<p class=\"command\">apt\u00a0update<\/p>\n<p class=\"command\">apt\u00a0upgrade<\/p>\n<p><strong\/>Next,\u00a0set up\u00a0the\u00a0name\u00a0for\u00a0your\u00a0system\u00a0by\u00a0executing\u00a0the\u00a0following\u00a0command (replace\u00a0your\u00a0hostname\u00a0variable\u00a0accordingly).<\/p>\n<p class=\"command\">hostnamectl\u00a0set-hostname\u00a0zencart<\/p>\n<p>Verify\u00a0machine\u00a0hostname\u00a0and\u00a0hosts\u00a0file\u00a0by\u00a0issuing\u00a0the following commands.<\/p>\n<p class=\"command\">hostnamectl<strong><b>\u00a0<\/b><\/strong><\/p>\n<p class=\"command\">cat\u00a0\/etc\/hostname\u00a0<\/p>\n<p class=\"command\">hostname\u00a0\u2013s<\/p>\n<p class=\"command\">hostname\u00a0\u2013f<\/p>\n<p>On the next step, execute the following command in order to install some necessary utilities that will be used to further manage your system from command line.<\/p>\n<p class=\"command\">apt\u00a0install\u00a0wget\u00a0bash-completion\u00a0zip\u00a0unzip\u00a0curl<\/p>\n<p><strong><b>\u00a0<\/b><\/strong>Finally,\u00a0reboot\u00a0Debian\u00a0server\u00a0in\u00a0order\u00a0to\u00a0apply\u00a0kernel\u00a0updates\u00a0and\u00a0the\u00a0hostname\u00a0changes\u00a0properly.<\/p>\n<p class=\"command\">systemctl\u00a0reboot<\/p>\n<h2 id=\"install-apache-and-php\">Install Apache and PHP<\/h2>\n<p>Zen Cart is a web-based CMS e-commerce platform written mostly in PHP server-side programming language. In order to execute the PHP file scripts of the application, a web server, such as Apache HTTP server, and a PHP processing gateway must be installed and operational in the system.\u00a0 In order to install Apache web server and the PHP interpreter alongside with all required PHP modules needed by the application to run properly, issue the following command in your server console.<\/p>\n<p class=\"command\">apt\u00a0install\u00a0apache2\u00a0libapache2-mod-php7.0\u00a0php7.0\u00a0php7.0-curl\u00a0php7.0-gd\u00a0php7.0-mbstring\u00a0php7.0-xml<\/p>\n<p>After Apache and PHP have been installed, test if the web server is up and running and listening for network connections on port 80 by issuing the following command with root privileges.\u00a0<\/p>\n<p class=\"command\">netstat\u00a0\u2013tlpn<\/p>\n<p>In\u00a0case\u00a0netstat\u00a0network\u00a0utility\u00a0is\u00a0not\u00a0installed by\u00a0default\u00a0in\u00a0your\u00a0Debian\u00a0system,\u00a0execute\u00a0the following command\u00a0to\u00a0install\u00a0it.<\/p>\n<p class=\"command\">apt\u00a0install\u00a0net-tools<\/p>\n<p><strong\/>By inspecting the netstat command output you can see that the Apache web server is listening for incoming network connections on port 80. For the same task you can also use the ss command, which is automatically installed by default in Debian 9.<\/p>\n<p class=\"command\">ss-\u00a0tulpn<\/p>\n<h2 id=\"configure-the-firewall\">Configure the Firewall<\/h2>\n<p><strong\/>In case you have a firewall enabled in your system, such as UFW firewall application, you should add a new rule to allow HTTP traffic to pass through the firewall by issuing the following command.<\/p>\n<p class=\"command\">ufw\u00a0allow\u00a0WWW<\/p>\n<p>or<\/p>\n<p class=\"command\">ufw\u00a0allow\u00a080\/tcp<\/p>\n<p>If you\u2019re using iptables raw rules to manage Firewall rules in your Debian server, add the following rule to allow port 80 inbound traffic on the firewall so that visitors can browse the online shop.<\/p>\n<p class=\"command\">apt-get\u00a0install\u00a0-y\u00a0iptables-persistent<\/p>\n<p class=\"command\">iptables\u00a0-I\u00a0INPUT\u00a0-p\u00a0tcp\u00a0&#8211;destination-port\u00a080\u00a0-j\u00a0ACCEPT<\/p>\n<p class=\"command\">systemctl\u00a0iptables-persistent\u00a0save\u00a0<\/p>\n<p class=\"command\">systemctl\u00a0iptables-persistent\u00a0reload<\/p>\n<h2 id=\"configurae-apache-and-ssltls\">Configurae Apache and SSL\/TLS<\/h2>\n<p><strong\/>Next, enable and apply the following Apache modules required by the e-commerce application to run properly, by issuing the following command.<\/p>\n<p class=\"command\">a2enmod\u00a0rewrite\u00a0expires\u00a0env\u00a0alias\u00a0deflate\u00a0mime<\/p>\n<p class=\"command\">systemctl\u00a0restart\u00a0apache2<\/p>\n<p>Finally, test if Apache web server default web page can be displayed in your client&#8217;s browsers by visiting your Debian machine IP address or your domain name or server FQDN via the HTTP protocol, as shown in the following image. If you don\u2019t know your machine IP address, execute ifconfig or &#8216;ip a&#8217; commands to reveal the IP address of your server.<\/p>\n<p><em><strong><span>http:\/\/yourdomain.tld<\/span><\/strong><\/em><\/p>\n<p><a class=\"fancybox\" id=\"img-Picture1\" href=\"https:\/\/www.howtoforge.com\/images\/install_zen_cart_in_debian_92\/big\/Picture1.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/10\/how-to-install-zen-cart-on-debian-9.png\" alt=\"Apache default page\" width=\"550\" height=\"279\" title=\"\"><\/a><\/p>\n<p>In order to install and access Zen Cart web admin panel backed and the frontend website via HTTPS protocol that will secure the traffic for your clients, issue the following command to enable Apache web server SSL module and SSL site configuration file.<\/p>\n<p class=\"command\">a2enmod\u00a0ssl\u00a0<\/p>\n<p class=\"command\">a2ensite\u00a0default-ssl.conf<\/p>\n<p>Next, open Apache default SSL site configuration file with a text editor and enable URL rewrite rules by adding the following lines of code after DocumentRoot directive, as shown in the following sample:<\/p>\n<p class=\"command\"><em><i>nano\u00a0\/etc\/apache2\/sites-enabled\/default-ssl.conf<\/i><\/em><\/p>\n<p><strong><em\/><\/strong>SSL\u00a0site\u00a0configuration\u00a0file\u00a0excerpt:<\/p>\n<pre><em><i>&lt;Directory\u00a0\/var\/www\/html&gt;<br\/>\u00a0 Options\u00a0+FollowSymlinks<br\/>\u00a0 AllowOverride\u00a0All<br\/>\u00a0 Require\u00a0all\u00a0granted<br\/>&lt;\/Directory&gt;<\/i><\/em><\/pre>\n<p>\u00a0Also,\u00a0make\u00a0the\u00a0following\u00a0change\u00a0to\u00a0VirtualHost\u00a0line\u00a0to\u00a0look\u00a0like as shown\u00a0in\u00a0the following excerpt:<\/p>\n<pre><em><i>&lt;VirtualHost\u00a0*:443&gt;<\/i><\/em><\/pre>\n<p><a class=\"fancybox\" id=\"img-Picture2\" href=\"https:\/\/www.howtoforge.com\/images\/install_zen_cart_in_debian_92\/big\/Picture2.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/10\/how-to-install-zen-cart-on-debian-9-1.png\" alt=\"SSL Vhost\" width=\"550\" height=\"412\" title=\"\"><\/a><\/p>\n<p>Close the SSL Apache file and open the \/etc\/apache2\/sites-enabled\/000-default.conf file for editing and add the same URL rewrite rules as for SSL configuration file. Insert the lines of code after DocumentRoot statement as shown in the following example.<\/p>\n<pre>\u00a0<em><i>&lt;Directory\u00a0\/var\/www\/html&gt;<br\/>\u00a0 Options\u00a0+FollowSymlinks<br\/>\u00a0 AllowOverride\u00a0All<br\/>\u00a0 Require\u00a0all\u00a0granted<br\/>&lt;\/Directory&gt;<\/i><\/em><\/pre>\n<p><a class=\"fancybox\" id=\"img-Picture3\" href=\"https:\/\/www.howtoforge.com\/images\/install_zen_cart_in_debian_92\/big\/Picture3.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/10\/how-to-install-zen-cart-on-debian-9-2.png\" alt=\"Directory settings in vhost\" width=\"550\" height=\"413\" title=\"\"><\/a><\/p>\n<p>Finally, restart Apache daemon to apply all rules configured so far and visit your domain via HTTP protocol. Because you\u2019re using the automatically Self-Signed certificates pairs issued by Apache at installation, an error warning should be displayed in the browser.\u00a0<\/p>\n<p class=\"command\">systemctl\u00a0restart\u00a0apache2<\/p>\n<p><em><strong><span>https:\/\/yourdomain.tld<\/span><\/strong><\/em><\/p>\n<p><a class=\"fancybox\" id=\"img-Picture4\" href=\"https:\/\/www.howtoforge.com\/images\/install_zen_cart_in_debian_92\/big\/Picture4.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/10\/how-to-install-zen-cart-on-debian-9-3.png\" alt=\"SSL page\" width=\"550\" height=\"242\" title=\"\"><\/a><\/p>\n<p>Accept\u00a0the\u00a0warning\u00a0concerning\u00a0the\u00a0untrusted\u00a0certificate\u00a0in\u00a0order\u00a0to\u00a0continue\u00a0and\u00a0be\u00a0redirected\u00a0to\u00a0Apache\u00a0default\u00a0web\u00a0page.<\/p>\n<p><a class=\"fancybox\" id=\"img-Picture5\" href=\"https:\/\/www.howtoforge.com\/images\/install_zen_cart_in_debian_92\/big\/Picture5.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/10\/how-to-install-zen-cart-on-debian-9-4.png\" alt=\"Apache Default page\" width=\"550\" height=\"251\" title=\"\"><\/a><\/p>\n<p>In case the UFW firewall application blocks incoming network connections to HTTPS port, you should add a new rule to allow HTTPS traffic to pass through firewall by issuing the following command.<\/p>\n<p class=\"command\">ufw\u00a0allow &#8216;WWW\u00a0Full&#8217;<\/p>\n<p>or<\/p>\n<p class=\"command\">ufw\u00a0allow\u00a0443\/tcp<\/p>\n<p>If iptables is the default firewall application installed to protect your Debian system at network level, add the following rule to allow port 443 inbound traffic in the firewall so that visitors can browse your domain name.<\/p>\n<p class=\"command\">iptables\u00a0-I\u00a0INPUT\u00a0-p\u00a0tcp\u00a0&#8211;destination-port\u00a0443\u00a0-j\u00a0ACCEPT<\/p>\n<p class=\"command\">systemctl\u00a0iptables-persistent\u00a0save\u00a0<\/p>\n<p class=\"command\">systemctl\u00a0iptables-persistent\u00a0reload<\/p>\n<p>In the next step, we need to make some further changes to PHP default configuration file in order to assure that the following PHP variables are enabled and the PHP timezone setting is correctly configured and matches your system&#8217;s geographical location.\u00a0 Open the \/etc\/php\/7.0\/apache2\/php.ini file for editing and assure that the following lines are set up as follows. Also, initially, make a backup of PHP configuration file.<\/p>\n<p class=\"command\">cp\u00a0\/etc\/php\/7.0\/apache2\/php.ini{,.backup}<\/p>\n<p class=\"command\">nano\u00a0\/etc\/php\/7.0\/apache2\/php.ini<\/p>\n<p><strong\/>Search,\u00a0edit\u00a0and\u00a0change\u00a0the\u00a0following\u00a0variables\u00a0in\u00a0<strong><b>php.ini<\/b><\/strong>\u00a0configuration\u00a0file:<\/p>\n<pre><em><i>file_uploads\u00a0=\u00a0On<br\/>memory_limit\u00a0=\u00a0128\u00a0M<br\/>upload_max_file_size\u00a0=\u00a064M<br\/>post_max_size\u00a0=\u00a064M<br\/>date.timezone\u00a0=\u00a0Europe\/London<\/i><\/em><\/pre>\n<p>Increase post_max_size and upload_max_file_size variables as suitable to support large file attachments and replace the time.zone variable accordingly to your physical time by consulting the list of time zones provided by PHP docs at the following link http:\/\/php.net\/manual\/en\/timezones.php<\/p>\n<p>If you want to increase the load speed of your website pages via OPCache plugin available for PHP7, append the following OPCache settings at the bottom of the PHP interpreter configuration file, as detailed below:<\/p>\n<pre><em><i>opcache.enable=1 <br\/>opcache.enable_cli=1 <br\/>opcache.interned_strings_buffer=8 <br\/>opcache.max_accelerated_files=10000 <br\/>opcache.memory_consumption=128 <br\/>opcache.save_comments=1<br\/>opcache.revalidate_freq=1<\/i><\/em><\/pre>\n<p>Close the php.ini configuration file and verify the end of PHP configuration file to check if the variables have been correctly added by issuing the below command.<\/p>\n<p class=\"command\">tail\u00a0\/etc\/php\/7.0\/apache2\/php.ini<\/p>\n<p>After you\u2019ve made all the changes explained above, restart the apache daemon to apply the new changes by issuing the following command.<\/p>\n<p class=\"command\">systemctl\u00a0restart\u00a0apache2<\/p>\n<p><strong\/>Finally, create a PHP info file by executing the following command and check if the PHP time zone has been correctly configured by visiting the PHP info script file from a browser at the following URL, as illustrated in the below image. Scroll down to date setting to check the php time zone configuration.<\/p>\n<p class=\"command\">echo\u00a0&#8216;&lt;?php\u00a0phpinfo();\u00a0?&gt;&#8217;|\u00a0tee\u00a0\/var\/www\/html\/info.php<\/p>\n<p><em><strong>https:\/\/yourdomain.tld\/info.php<\/strong><\/em><\/p>\n<p><span><span><span><a class=\"fancybox\" id=\"img-Picture6\" href=\"https:\/\/www.howtoforge.com\/images\/install_zen_cart_in_debian_92\/big\/Picture6.png\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/10\/how-to-install-zen-cart-on-debian-9-5.png\" alt=\"\" title=\"\"><\/a><\/span><\/span><\/span><\/p>\n<p>Zen Cart e-commerce web application stores different configurations, such as users, sessions, contacts, products, catalogs and others, in an RDBMS database. In this guide, we\u2019ll configure Zen Cart application to use MariaDB database as backend. Issue the following command to install MariaDB database and the PHP module needed to access the mysql database.<\/p>\n<p class=\"command\">apt\u00a0install\u00a0mariadb-server mariadb-client php7.0-mysql<\/p>\n<p>After you\u2019ve installed MariaDB, verify if the daemon is running and listens for connections on localhost, port 3306, by running netstat command.<\/p>\n<p class=\"command\">netstat\u00a0\u2013tlpn\u00a0|\u00a0grep\u00a0mysql<\/p>\n<p>Then,\u00a0log\u00a0in\u00a0to\u00a0MySQL\u00a0console\u00a0and\u00a0secure\u00a0MariaDB\u00a0root\u00a0account\u00a0by\u00a0issuing\u00a0the\u00a0following\u00a0commands.<\/p>\n<p class=\"command\">mysql\u00a0-h\u00a0localhost<\/p>\n<pre><em><i>use\u00a0mysql;<br\/>update\u00a0user\u00a0set\u00a0plugin=''\u00a0where\u00a0user='root';<br\/>flush\u00a0privileges;<br\/>exit<\/i><\/em><\/pre>\n<p><strong><em\/><em\/><\/strong>On the next step, secure MariaDB by executing the script mysql_secure_installation provided by the installation packages from Debian stretch repositories. While running the script will ask a series of questions designed to secure MariaDB database, such as: to change MySQL root password, to remove anonymous users, to disable remote root logins and delete the test database. Execute the script by issuing the following command and assure you type yes to all questions asked in order to fully secure MySQL daemon. Use the following script output excerpt as a guide.<\/p>\n<p class=\"command\"><em><i>sudo\u00a0mysql_secure_installation<\/i><\/em><\/p>\n<pre readability=\"83\">NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB<p>\u00a0\u00a0\u00a0\u00a0\u00a0 SERVERS IN PRODUCTION USE!\u00a0 PLEASE READ EACH STEP CAREFULLY!<\/p><p>In order to log into MariaDB to secure it, we'll need the current<\/p><p>password for the root user.\u00a0 If you've just installed MariaDB, and<\/p><p>you haven't set the root password yet, the password will be blank,<\/p><p>so you should just press enter here.<\/p><p>Enter current password for root (enter for none):<\/p><p>OK, successfully used password, moving on...<\/p><p>Setting the root password ensures that nobody can log into the MariaDB<\/p><p>root user without the proper authorisation.<\/p><p>You already have a root password set, so you can safely answer 'n'.<\/p><p>Change the root password? [Y\/n] y<\/p><p>New password:<\/p><p>Re-enter new password:<\/p><p>Password updated successfully!<\/p><p>Reloading privilege tables..<\/p><p>\u00a0... Success!<\/p><p>By default, a MariaDB installation has an anonymous user, allowing anyone<\/p><p>to log into MariaDB without having to have a user account created for<\/p><p>them.\u00a0 This is intended only for testing, and to make the installation<\/p><p>go a bit smoother.\u00a0 You should remove them before moving into a<\/p><p>production environment.<\/p><p>Remove anonymous users? [Y\/n] y<\/p><p>\u00a0... Success!<\/p><p>Normally, root should only be allowed to connect from 'localhost'.\u00a0 This<\/p><p>ensures that someone cannot guess at the root password from the network.<\/p><p>Disallow root login remotely? [Y\/n] y<\/p><p>\u00a0... Success!<\/p><p>By default, MariaDB comes with a database named 'test' that anyone can<\/p><p>access.\u00a0 This is also intended only for testing, and should be removed<\/p><p>before moving into a production environment.<\/p><p>Remove test database and access to it? [Y\/n] y<\/p><p>\u00a0- Dropping test database...<\/p><p>\u00a0... Success!<\/p><p>\u00a0- Removing privileges on test database...<\/p><p>\u00a0... Success!<\/p><p>Reloading the privilege tables will ensure that all changes made so far<\/p><p>will take effect immediately.<\/p><p>Reload privilege tables now? [Y\/n] y<\/p><p>\u00a0... Success!<\/p><p>Cleaning up...<\/p><p>All done!\u00a0 If you've completed all of the above steps, your MariaDB<\/p><p>installation should now be secure.<\/p><p>Thanks for using MariaDB!<\/p><\/pre>\n<p><em\/>In order to test MariaDB security, try login to the database from the console with no root password. The access to the database should be denied if no password is provided for the root account, as illustrated in the following command excerpt:<\/p>\n<p class=\"command\"><em><i><a href=\"https:\/\/www.howtoforge.com\/cdn-cgi\/l\/email-protection\" class=\"__cf_email__\" data-cfemail=\"aedcc1c1daeecddbcccbcdcfdcda\" target=\"_blank\" rel=\"noopener\">[email\u00a0protected]<\/a>:~#\u00a0<\/i><\/em>mysql\u00a0-h\u00a0localhost\u00a0-u\u00a0root<\/p>\n<pre><em><i>Enter\u00a0password:<br\/>ERROR\u00a01045\u00a0(28000):\u00a0Access\u00a0denied\u00a0for\u00a0user\u00a0'root'@'localhost'\u00a0(using\u00a0password:\u00a0NO)<\/i><\/em><\/pre>\n<p><strong\/>If\u00a0the\u00a0password\u00a0is\u00a0supplied,\u00a0the\u00a0login\u00a0process\u00a0should\u00a0be\u00a0granted\u00a0to\u00a0MySQL\u00a0console,\u00a0as\u00a0shown\u00a0in\u00a0the\u00a0command\u00a0sample:<\/p>\n<p class=\"command\"><em><i><a href=\"https:\/\/www.howtoforge.com\/cdn-cgi\/l\/email-protection\" class=\"__cf_email__\" data-cfemail=\"deacb1b1aa9ebdabbcbbbdbfacaa\" target=\"_blank\" rel=\"noopener\">[email\u00a0protected]<\/a>:~#<\/i><\/em><strong><b>\u00a0<\/b><\/strong>mysql\u00a0-h\u00a0localhost\u00a0-u\u00a0root\u00a0-p<\/p>\n<pre><em><i>Enter\u00a0password:<br\/>Welcome\u00a0to\u00a0the\u00a0MariaDB\u00a0monitor.\u00a0\u00a0Commands\u00a0end\u00a0with\u00a0;\u00a0or\u00a0\\g.<br\/>Your\u00a0MariaDB\u00a0connection\u00a0id\u00a0is\u00a015<br\/>Server\u00a0version:\u00a010.1.26-MariaDB-0+deb9u1\u00a0Debian\u00a09.1<br\/>Copyright\u00a0(c)\u00a02000,\u00a02017,\u00a0Oracle,\u00a0MariaDB\u00a0Corporation\u00a0Ab\u00a0and\u00a0others.<br\/>Type\u00a0'help;'\u00a0or\u00a0'\\h'\u00a0for\u00a0help.\u00a0Type\u00a0'\\c'\u00a0to\u00a0clear\u00a0the\u00a0current\u00a0input\u00a0statement.<br\/>MariaDB\u00a0[(none)]&gt;<\/i><\/em><strong><em><b><i>\u00a0exit<br\/><\/i><\/b><\/em><\/strong>Bye<\/pre>\n<p><strong\/>Next, log in to the MariaDB database console, create a database for Zen Cart application and a user with a password that will be used to manage the application database, by issuing the following commands. Replace the database name, user and password accordingly.\u00a0<\/p>\n<p class=\"command\">mysql\u00a0\u2013u\u00a0root\u00a0-p<\/p>\n<pre>create\u00a0database\u00a0zencart;<br\/>grant\u00a0SELECT,\u00a0INSERT,\u00a0UPDATE,\u00a0DELETE,\u00a0CREATE,\u00a0ALTER,\u00a0INDEX,\u00a0DROP\u00a0on\u00a0zencart.*\u00a0to\u00a0'zencart_user'@'localhost'\u00a0identified\u00a0by\u00a0'password1';<br\/>flush\u00a0privileges;<br\/>exit<\/pre>\n<p><strong\/>In order to apply all changes made so far, restart MySQL and Apache daemons and verify if daemons are running by issuing the following commands.<\/p>\n<p class=\"command\">systemctl\u00a0restart\u00a0mysql\u00a0apache2<\/p>\n<p class=\"command\">systemctl\u00a0status\u00a0mysql\u00a0apache2<\/p>\n<h2 id=\"installnbspzennbspcartnbsp\"><strong\/><strong\/>Install\u00a0Zen\u00a0Cart\u00a0<\/h2>\n<p>After all system requirements are met for your e-commerce online shop installation, visit SourceForge Zen Cart official download page at\u00a0<a href=\"https:\/\/sourceforge.net\/projects\/zencart\/files\/\" target=\"_blank\" rel=\"noopener\">https:\/\/sourceforge.net\/projects\/zencart\/files\/<\/a> and download the latest zip package compressed archive by with the help of the wget utility, as illustrated in the following sample.<\/p>\n<p class=\"command\">wget\u00a0https:\/\/downloads.sourceforge.net\/project\/zencart\/CURRENT%20-%20Zen%20Cart%201.5.x%20Series\/zen-cart-v1.5.5f-12312017b.zip<\/p>\n<p><span><strong><span><b><span\/><\/b><\/span><\/strong><\/span>After the zip archive download finishes, extract Zen Cart zip compressed archive directly and list the extracted files by issuing the following commands. Also, remove the default index.html file installed by Apache web server to webroot path and also delete the info.php file created earlier.\u00a0<\/p>\n<p class=\"command\">rm\u00a0\/var\/www\/html\/index.html\u00a0<\/p>\n<p class=\"command\">rm\u00a0\/var\/www\/html\/info.php<\/p>\n<p class=\"command\">unzip\u00a0<span>zen-cart-v1.5.5f-12312017b.zip<\/span><\/p>\n<p class=\"command\">ls<\/p>\n<p><strong\/>The installation files for Zen Cart are located in your current working directory in the extracted zen-cart directory. Issue ls command to view zen-cart directory files. Copy all the content of the zen-cart-v1 directory to your web server document root path by issuing the following command.<\/p>\n<p class=\"command\">ls\u00a0-al\u00a0zen-cart-v[tab]<\/p>\n<p class=\"command\">cp\u00a0-rf\u00a0zen-cart-v1.5.5e-03082017\/*\u00a0\/var\/www\/html\/<\/p>\n<p><strong\/>Change directory to web server document root and issue the following command to create the configuration files required by Zen Cart application to write store settings.<\/p>\n<p class=\"command\">cd\u00a0\/var\/www\/html\/<\/p>\n<p class=\"command\">cp\u00a0includes\/dist-configure.php\u00a0includes\/configure.php<\/p>\n<p class=\"command\">cp\u00a0admin\/includes\/dist-configure.php\u00a0admin\/includes\/configure.php\u00a0<\/p>\n<p>Next, execute the following commands in order to grant Apache runtime user with full write permissions to the web root path. Use ls command to list permissions for application\u2019s installed files located in the \/var\/www\/html\/ directory.<\/p>\n<p class=\"command\">chown\u00a0-R\u00a0www-data:www-data\u00a0\/var\/www\/html\/<\/p>\n<p class=\"command\">ls\u00a0\u2013al\u00a0\/var\/www\/html\/<\/p>\n<p><a class=\"fancybox\" id=\"img-Picture7\" href=\"https:\/\/www.howtoforge.com\/images\/install_zen_cart_in_debian_92\/big\/Picture7.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/10\/how-to-install-zen-cart-on-debian-9-6.png\" alt=\"ZenCart unpacked\" width=\"550\" height=\"413\" title=\"\"><\/a><\/p>\n<p>Now, proceed Zen Cart online shop installation process by opening a browser and navigate your server\u2019s IP address or domain name or server FQDN via the HTTPS protocol. On the first installation screen Zen Cart installer will present you a summary of a list of issues concerning you you\u2019re seeing the page . Because the application hasn\u2019t been installed yet, hit on on Click here link in order to start the the installation process, as illustrated in the following image.<\/p>\n<p><span><a href=\"https:\/\/yourdomain.tld\" target=\"_blank\" rel=\"noopener\"><span><span\/><\/span><\/a><a><strong\/><\/a><em><strong>https:\/\/yourdomain.tld<\/strong><\/em><\/span><\/p>\n<p><span><span><span><a class=\"fancybox\" id=\"img-Picture8\" href=\"https:\/\/www.howtoforge.com\/images\/install_zen_cart_in_debian_92\/big\/Picture8.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/10\/how-to-install-zen-cart-on-debian-9-7.png\" alt=\"ZenCart web installer\" width=\"550\" height=\"430\" title=\"\"><\/a><\/span><\/span><\/span><\/p>\n<p>In the next installation screen, the installer will perform a series of pre-installation checks against the server PHP settings and installed PHP extension in order to determine if all system requirements to install Zen Cart e-commerce application are met.\u00a0 It will also check if the Apache HTTP runtime user can write to a series of directories from webroot path, as shown in the below images. After reviewing all system inspections checks, hit on Continue button to move forward with the installation process.<\/p>\n<p><a class=\"fancybox\" id=\"img-Picture9\" href=\"https:\/\/www.howtoforge.com\/images\/install_zen_cart_in_debian_92\/big\/Picture9.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/10\/how-to-install-zen-cart-on-debian-9-8.png\" alt=\"System inspection\" width=\"550\" height=\"310\" title=\"\"><\/a>On the next screen, setup your Zen Cart online store. First, check the License agreement checkbox and verify the Admin Server Domain URL address to redirect to your domain name via HTTPS application protocol. Next, check Enable SSL for Storefront in Catalog (Storefront) Settings and verify domain URL addresses. In the last filed, verify if the store physical path matches your web server document root path and hit on Continue button to proceed further with the installation process.<\/p>\n<p><a class=\"fancybox\" id=\"img-Picture10\" href=\"https:\/\/www.howtoforge.com\/images\/install_zen_cart_in_debian_92\/big\/Picture10.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/10\/how-to-install-zen-cart-on-debian-9-9.png\" alt=\"System setup\" width=\"550\" height=\"549\" title=\"\"><\/a><\/p>\n<p>In the next installation screen, add MySQL database address, name and credentials created earlier for the Zen Cart database. Leave the Load Demo Data unchecked and select your database character set to UTF8 and the prefix to zen_. Choose the SQL Cache Method to File and hit on the Continue button to move to the next installation stage.<\/p>\n<p><a class=\"fancybox\" id=\"img-Picture11\" href=\"https:\/\/www.howtoforge.com\/images\/install_zen_cart_in_debian_92\/big\/Picture11.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/10\/how-to-install-zen-cart-on-debian-9-10.png\" alt=\"Database setup\" width=\"550\" height=\"529\" title=\"\"><\/a><\/p>\n<p>Next, add an Admin Superuser account for your Zen Cart online store and an email address for the admin account. Make sure you note down the admin store password and the admin directory name and hit on Continue button to start the installation process.<\/p>\n<p><a class=\"fancybox\" id=\"img-Picture12\" href=\"https:\/\/www.howtoforge.com\/images\/install_zen_cart_in_debian_92\/big\/Picture12.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/10\/how-to-install-zen-cart-on-debian-9-11.png\" alt=\"Admin setup\" width=\"550\" height=\"518\" title=\"\"><\/a><\/p>\n<p>After the installation completes, the installer will display two buttons for accessing Zen Cart Backed Administration panel, which will be used to manage your online shop, and the Storefront store link, which will be displayed to your clients.<\/p>\n<p><a class=\"fancybox\" id=\"img-Picture13\" href=\"https:\/\/www.howtoforge.com\/images\/install_zen_cart_in_debian_92\/big\/Picture13.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/10\/how-to-install-zen-cart-on-debian-9-12.png\" alt=\"Setup finished\" width=\"550\" height=\"384\" title=\"\"><\/a><\/p>\n<p>In order to visit your online store, first hit on Go to your Storefront button and the frontend of your e-commerce application will be displayed in your browser as illustrated in the below screenshot. You can also visit the store frontend by navigating to your server IP address or domain name via HTTPS protocol.<\/p>\n<p><span><a href=\"https:\/\/yourdomain.tld\" target=\"_blank\" rel=\"noopener\"><span><span\/><\/span><\/a><a><strong\/><\/a><em><strong>https:\/\/www.yourdomain.tld<\/strong><\/em><\/span><\/p>\n<p><span><span><span><a class=\"fancybox\" id=\"img-Picture14\" href=\"https:\/\/www.howtoforge.com\/images\/install_zen_cart_in_debian_92\/big\/Picture14.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/10\/how-to-install-zen-cart-on-debian-9-13.png\" alt=\"ZenCart installed\" width=\"550\" height=\"450\" title=\"\"><\/a><\/span><\/span><\/span><\/p>\n<p>Before logging in to your store backed admin panel, first, return to server console and issue the following command to remove Zen Cart installation directory.<\/p>\n<p class=\"command\">rm\u00a0-rf\u00a0\/var\/www\/html\/zc_install\/<\/p>\n<p>In order to manage your Zen Cart online store, hit on the Admin Backend link which will redirect you to the store backend. Use the admin credentials configured during the installation process in order to log in to Zen Cart backend panel, as shown in the below screenshot.<\/p>\n<p>You can also visit the Zen Cart admin web panel by navigating to your server IP address or domain name via HTTPS protocol to admin directory URL address random string configured during the installation process.<\/p>\n<p><em><strong>https:\/\/yourdomain.tld\/random_string\/login.php<\/strong><\/em><\/p>\n<p><a class=\"fancybox\" id=\"img-Picture15\" href=\"https:\/\/www.howtoforge.com\/images\/install_zen_cart_in_debian_92\/big\/Picture15.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/10\/how-to-install-zen-cart-on-debian-9-14.png\" alt=\"ZenCart login\" width=\"550\" height=\"411\" title=\"\"><\/a>After logging in to Zen Cart backed admin panel, complete the initial setup wizard with your own store details and git on the Update button to write changes, as shown in the following screenshot.<\/p>\n<p><a class=\"fancybox\" id=\"img-Picture16\" href=\"https:\/\/www.howtoforge.com\/images\/install_zen_cart_in_debian_92\/big\/Picture16.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/10\/how-to-install-zen-cart-on-debian-9-15.png\" alt=\"ZenCart Initial setup wizard\" width=\"550\" height=\"428\" title=\"\"><\/a><\/p>\n<p>In order to secure Zen Cart application, return to server console and issue the following commands to change permissions for includes\/configure.php file and for configure.php file from admin directory to be owned by the root account.<\/p>\n<p class=\"command\">chown\u00a0root:root\u00a0\/var\/www\/html\/includes\/configure.php\u00a0<\/p>\n<p class=\"command\">chown\u00a0root:root\u00a0\/var\/www\/html\/brOil-QUl-cHain\/includes\/configure.php<\/p>\n<p>Finally, in order to force visitors to browse Zen Cart frontend website and to securely access the backend interface via HTTPS protocol that encrypts the traffic between the server and client browsers, return to your server\u2019s terminal and create a new .htaccess file by issuing the following command.<\/p>\n<p class=\"command\">nano\u00a0\/var\/www\/html\/.htaccess<\/p>\n<p>Change\u00a0PHP\u00a0settings\u00a0to\u00a0match\u00a0your\u00a0own\u00a0server\u00a0resources\u00a0and\u00a0add\u00a0the\u00a0HTTPS\u00a0redirect\u00a0rules\u00a0as\u00a0shown\u00a0in\u00a0the\u00a0below .htaccess file\u00a0excerpt<strong>:<\/strong><\/p>\n<pre>#\u00a0Modify\u00a0PHP\u00a0settings<br\/><em><i>php_flag\u00a0register_globals\u00a0off<br\/>php_flag\u00a0magic_quotes_gpc\u00a0Off<br\/>php_value\u00a0max_execution_time\u00a0200<br\/>php_value\u00a0max_input_time\u00a0200<br\/>php_value\u00a0upload_max_filesize\u00a0999M<br\/><\/i><\/em><em><i>php_value\u00a0post_max_size\u00a0999M<\/i><\/em><strong><em><b><i\/><\/b><\/em><\/strong><em><i>#\u00a0Redirect\u00a0to\u00a0HTTPS<br\/><\/i><\/em><em><i>&lt;IfModule\u00a0mod_rewrite.c&gt;<br\/><\/i><\/em><em><i>RewriteEngine\u00a0On<br\/><\/i><\/em><em><i>RewriteCond\u00a0%{HTTPS}\u00a0off<br\/><\/i><\/em><em><i>RewriteRule\u00a0(.*)\u00a0https:\/\/%{SERVER_NAME}\/$1\u00a0[R,L]<br\/><\/i><\/em><em><i>&lt;\/IfModule&gt;<\/i><\/em> <\/pre>\n<p>That\u2019s all! You have successfully installed and configured Zen Cart e-commerce application in Debian 9.2. However, because Apache HTTP server uses an untrusted Self-Signed certificate to encrypt the traffic between the server and visitor\u2019s browsers, a warning message will always be generated and displayed in their browsers. This warning is bad for your online shop business. In this case you should buy a certificate issued by a trusted Certificate Authority or get a free certificate pair from Let\u2019s Encrypt CA.<\/p>\n<p>For other custom configurations regarding Zen Cart application, visit the documentation page at the following address: <a href=\"https:\/\/www.zen-cart.com\/wiki\/index.php\/Main_Page\" target=\"_blank\" rel=\"noopener\">https:\/\/www.zen-cart.com\/wiki\/index.php\/Main_Page<\/a><\/p>\n<div>\n<p><b>Share this page:<\/b><\/p>\n<p>\n<a href=\"https:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Fwww.howtoforge.com%2Ftutorial%2Fdebian-zen-cart-installation%2F\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/10\/how-to-install-zen-cart-on-debian-9-16.png\" height=\"20\" alt=\"\" title=\"\"><\/a><br \/>\n<a href=\"https:\/\/twitter.com\/intent\/tweet?url=https%3A%2F%2Fwww.howtoforge.com%2Ftutorial%2Fdebian-zen-cart-installation%2F&amp;text=How+to+Install+Zen+Cart+on+Debian+9&amp;via=howtoforgecom&amp;related=howtoforgecom\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/10\/how-to-install-zen-cart-on-debian-9-17.png\" height=\"20\" alt=\"\" title=\"\"><\/a><br \/>\n<a href=\"https:\/\/twitter.com\/howtoforgecom\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/10\/how-to-install-zen-cart-on-debian-9-18.png\" height=\"20\" alt=\"\" title=\"\"><\/a><br \/>\n<a href=\"https:\/\/plus.google.com\/share?url=https%3A%2F%2Fwww.howtoforge.com%2Ftutorial%2Fdebian-zen-cart-installation%2F\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/10\/how-to-install-zen-cart-on-debian-9-19.png\" height=\"20\" alt=\"\" title=\"\"><\/a>\n<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Zen Cart is a free open source e-commerce content management and shopping cart platform. The software is written in PHP programming language and often installed on Linux under Apache\/Nginx web servers, PHP and MySQL\/MariaDB database management system, also known as LAMP or LEMP stack.\u00a0 Zen Cart e-commerce\u00a0solution is used to easily create online shops for [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-7000","post","type-post","status-publish","format-standard","hentry","category-36"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/7000","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=7000"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/7000\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=7000"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=7000"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=7000"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}