billysoftacademy.com

Learn how to install Zen Cart on Linux Ubuntu 22.04 LTS

Introduction

Zen Cart is an open-source software program that enables you to create and manage an online store. It’s free and user-friendly, making it a popular choice for e-commerce beginners. Zen Cart is a great option for those seeking a free and easy-to-use platform to establish a basic online store.In this tutorial, we will demonstrate how to install Zen Cart on Ubuntu 22.04 LTS.

Requirements

The following is a list of items needed to complete the installation successfully:
1) Linux Ubuntu Server 22.04 LTS or newer
2) An SSH client such as Putty or the terminal app for macOS
3) A domain name pointing to the IP address of the Ubuntu server
4) A stable internet connection
5) A basic understanding of the Linux command line.

Overview

The following is an overview of the steps covered in this guide:
1) Download and install the LAMP stack.
2) Create a MySQL database for Zen Cart.
3) Download Zen Cart and create an Apache virtual host.
4) Setup Zen Cart and access the web dashboard.
5) Conclusion and next steps.

Step 1: Download and install the LAMP stack.

Using your preferred SSH client, open an SSH connection to your Linux Ubuntu server and run the following command to update the system repository:
sudo apt update -y
When the update process complete, run the following command to upgrade installed packages
sudo apt upgrade -y
Once this is done, restart the server for any new changes to take effect. When the server reboots, reopen the SSH connection and run the following command to install Apache, MariaDB, PHP and other important required PHP extensions:
apt install -y apache2 mariadb-server php php-cli php-common libapache2-mod-php php-curl php-zip php-gd php-mysql php-xml php-mbstring php-json php-intl
When the installation completes, open the php.ini configuration file with the command:
sudo nano /etc/php/8.1/apache2.php.ini
Search the file for the parameters listed below and update the values accordingly:
memory_limit = 512M
post_max_size = 128M
upload_max_filesize = 128M
date.timezone = Africa/Harare
Press CTRL + O, press ENTER to confirm and press CTRL + X to exit the file. Restart Apache web server for the changes to take effect:
systemctl restart apache2

Step 2: Create a MySQL database for Zen Cart

The next step is creating a MySQL database for Zen Cart. First, log in to your MariaDB shell by running the command:
mysql
After successfully connecting, create a database and user for Zen Cart using the following commands:
CREATE DATABASE zencart;
CREATE USER 'zencart'@'localhost' IDENTIFIED BY 'verystrongpassword';
Next, grant all the privileges to Zen Cart with the following command:
GRANT ALL PRIVILEGES ON zencart.* TO 'zencart'@'localhost';
Finally, flush the privileges and exit from the MariaDB shell by running these commands:
FLUSH PRIVILEGES;
EXIT;

Step 3: Download Zen Cart and create an Apache virtual host.

The next step is downloading Zen Cart and creating an Apache virtual host. Go to the Zen Cart official download page and download the latest Zen Cart archive using the following command:
wget https://github.com/zencart/zencart/archive/refs/tags/v2.0.0.zip --no-check-certificate
2. Once the download is complete, unzip the downloaded archive:
unzip v2.0.0.zip
3. Move the extracted directory to the Apache web root:
mv zencart-2.0.0 /var/www/html/zencart
4. Copy the Zen Cart sample configuration file to the appropriate location:
cp /var/www/html/zencart/includes/dist-configure.php /var/www/html/zencart/includes/configure.php
5. Change the ownership and permission of the Zen Cart directory:
chown -R www-data:www-data /var/www/html/zencart
find /var/www/html/zencart/ -type d -exec chmod 755 {} \;
find /var/www/html/zencart/ -type f -exec chmod 644 {} \;
To set up Zen Cart, you’ll need to create an Apache virtual host configuration file. Start by opening the file zencart.conf located in /etc/apache2/sites-available using the command:
nano /etc/apache2/sites-available/zencart.conf
Then, paste the following content into the file:
< VirtualHost *:80>
    ServerAdmin admin@example.com
    DocumentRoot /var/www/html/zencart/
    
    ServerName zencart.example.com

    < Directory /var/www/html/zencart/> 
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    < /Directory>

    ErrorLog /var/log/apache2/example.com-error_log
    CustomLog /var/log/apache2/example.com-access_log common
< /VirtualHost>
After adding the content, save the file and then enable the Zen Cart virtual host using the command:
a2ensite zencart.conf
Finally, to apply the changes, restart the Apache service with the command:
systemctl restart apache2

Step 4: Setup Zen Cart and access the web dashboard

Open your web browser and go to the Zen Cart UI using the URL

http://zencart.example.com

You will be directed to a welcome to Zen Cart page.

1) Click on the “CLICK HERE” link to begin the installation. You will then see the system inspection page.
2) Click on “Continue” and you will encounter the License Agreement and settings page.
3) Accept the License Agreement, set other necessary preferences, and click on “Continue”. This will take you to the database setup page.
4) Enter your database credentials and click on “Continue”. You will then see the admin setup page.
5) Set your admin username, email, and password, and click on “Continue”.

Once done, delete the installation directory from your server using the following command:

   rm -rf /var/www/html/zencart/zc_install

After deleting the installation directory, click on the “Admin Dashboard” link. This will bring you to the admin login page. Enter your admin username and password, and click on “Submit”. You will then see the password reset page. Change your admin password and click on “Submit”. You will then be directed to the Initial Setup page. Provide your store information and click on “Update”. This will lead you to the Zen Cart dashboard.

Conclusion and next steps

By following these steps, you have successfully installed Zen Cart on your Ubuntu 22.04 LTS server. Now you have a functional e-commerce platform ready to be customized and populated with your products. Remember to secure your online store by setting strong passwords and keeping the software updated. Here are some next steps to consider:

1) Explore the Zen Cart administration panel and familiarize yourself with the functionalities.
2) Add your products, descriptions, and images.
3) Configure payment gateways to accept online payments from your customers.
4) Customize the Zen Cart theme to match your brand identity.
5) Implement marketing strategies to attract visitors to your online store.

Congratulations on launching your online store with Zen Cart!
Scroll to Top