Learn how to install Zen Cart on Linux Ubuntu 22.04 LTS
Introduction
Requirements
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.
sudo apt update -yWhen the update process complete, run the following command to upgrade installed packages
sudo apt upgrade -yOnce 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-intlWhen the installation completes, open the php.ini configuration file with the command:
sudo nano /etc/php/8.1/apache2.php.iniSearch 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/HararePress 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
mysqlAfter 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.
wget https://github.com/zencart/zencart/archive/refs/tags/v2.0.0.zip --no-check-certificate2. Once the download is complete, unzip the downloaded archive:
unzip v2.0.0.zip3. Move the extracted directory to the Apache web root:
mv zencart-2.0.0 /var/www/html/zencart4. 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.php5. 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.confThen, 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.confFinally, 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
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!