Zen Cart is a popular open-source e-commerce platform that is used to build online stores. In this article, we will guide you through the process of installing Zen Cart on a fresh installation of Ubuntu 20.04.
Before we begin, make sure that you have a fresh installation of Ubuntu 20.04 and that LAMP (Linux, Apache, MySQL, PHP) is installed on your system. You will also need to be logged in as a user with sudo
privileges.
Download Zen Cart
The first step is to download the latest version of Zen Cart from the official website. To do this, run the following commands in the terminal:
wget <https://sourceforge.net/projects/zencart/files/latest/download> -O zencart.zip
unzip zencart.zip -d zencart
This will download the Zen Cart zip file and extract it to a new directory called "zencart"
.
Create a new MySQL database
Next, we need to create a new MySQL database for Zen Cart. To do this, log in to the MySQL shell using the following command:
mysql -u root -p
When prompted, enter the MySQL root
password.
In the MySQL shell, run the following commands to create a new database called "zencart"
:
CREATE DATABASE zencart;
GRANT ALL PRIVILEGES ON zencart.* TO 'zencartuser'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
EXIT;
Make sure to replace "zencartuser"
and “password” with the actual username and password that you want to use for the Zen Cart database user.
Copy Zen Cart files to the web root directory
After creating the database, we need to copy the Zen Cart files to the web root directory. To do this, run the following commands in the terminal:
sudo cp -r zencart/ /var/www/html/zencart
sudo chown -R www-data:www-data /var/www/html/zencart
This will copy the Zen Cart files to the web root directory and set the correct ownership permissions for the files.
Configure Apache
Next, we need to configure Apache to serve the Zen Cart website. To do this, create a new Apache virtual host file using the following command:
sudo nano /etc/apache2/sites-available/zencart.conf
In the file, add the following configuration:
<VirtualHost *:80>
ServerName your-domain.com
ServerAdmin admin@your-domain.com
DocumentRoot /var/www/html/zencart
<Directory /var/www/html/zencart>
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Make sure to replace “your-domain.com” and "**admin@your-domain.com**"
with the actual domain name and admin email