LinuxTutorialsUbuntu

How To Install AbanteCart on Ubuntu 20.04 LTS

Install AbanteCart on Ubuntu 20.04

In this tutorial, we will show you how to install AbanteCart on Ubuntu 20.04 LTS. For those of you who didn’t know, AbanteCart is an open-source e-commerce platform based on PHP. It is an ideal e-commerce solution for small to medium businesses. The fast and secure solution allows you to design, list products, attach prices, set up delivery methods, and accept payments on your eCommerce website.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you through the step-by-step installation of the AbanteCart open-source e-commerce platform on Ubuntu 20.04 (Focal Fossa). You can follow the same instructions for Ubuntu 18.04, 16.04, and any other Debian-based distribution like Linux Mint.

Prerequisites

  • A server running one of the following operating systems: Ubuntu 20.04, 18.04, and any other Debian-based distribution like Linux Mint.
  • It’s recommended that you use a fresh OS install to prevent any potential issues
  • A non-root sudo user or access to the root user. We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.

Install AbanteCart on Ubuntu 20.04 LTS Focal Fossa

Step 1. First, make sure that all your system packages are up-to-date by running the following apt commands in the terminal.

sudo apt update
sudo apt upgrade

Step 2. Installing the LAMP stack.

A Ubuntu 20.04 LAMP server is required. If you do not have LAMP installed, you can follow our guide here.

Step 3. Installing AbanteCart on Ubuntu 20.04.

By default, AbanteCart is not available on Ubuntu 20.04 base repository. Now we run the commands below to download the latest version of AbanteCart from Github:

wget https://github.com/abantecart/abantecart-src/archive/master.zip

Next, extract the downloaded file:

unzip master.zip

Then, create the public web root directory for Abantecart:

sudo mkdir /var/www/html/abantecart -p

After that, copy the extracted abantecart-src-master/public_html directory to the webroot directory:

sudo cp -r abantecart-src-master/public_html /var/www/html/abantecart/

We will need to change some folders permissions:

sudo chown -R www-data:www-data /var/www/html/abantecart

Step 4. Configuring MariaDB.

By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation script. you should read and below each step carefully which will set a root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MariaDB:

mysql_secure_installation

Configure it like this:

- Set root password? [Y/n] y
- Remove anonymous users? [Y/n] y
- Disallow root login remotely? [Y/n] y
- Remove test database and access to it? [Y/n] y
- Reload privilege tables now? [Y/n] y

Next, we will need to log in to the MariaDB console and create a database for the AbanteCart. Run the following command:

mysql -u root -p

This will prompt you for a password, so enter your MariaDB root password and hit Enter. Once you are logged in to your database server you need to create a database for AbanteCart installation:

CREATE DATABASE abantecartdb;
CREATE USER 'abantecartuser'@'localhost' IDENTIFIED BY 'Your-Stong-Passwd';
GRANT ALL PRIVILEGES ON `abantecartdb`.* TO 'abantecartuser'@'localhost';
FLUSH PRIVILEGES;

Step 5. Configuring Apache.

Now we create a new virtual host directive in Apache. For example, create a new Apache configuration file named ‘abantecart.conf’ on your virtual server:

nano /etc/apache2/sites-available/abantecart.conf

Add the following lines:

<VirtualHost *:80>
     ServerAdmin admin@your-domain.com
     DocumentRoot /var/www/html/abantecart
     ServerName your-domain.com

     <Directory /var/www/html/abantecart/>
          Options +FollowSymlinks
          AllowOverride All
          Require all granted
     </Directory>
     ErrorLog ${APACHE_LOG_DIR}/error.log
     CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

Save and close the file, then restart the Apache webserver so that the changes take place:

sudo a2enmod rewrite
sudo a2ensite abantecart.conf 
sudo systemctl restart apache2

Step 6. Set up HTTPS.

We should enable a secure HTTPS connection on AbanteCart. We can obtain a free TLS certificate from Let’s Encrypt. Install Let’s Encrypt client (certbot) from Ubuntu 20.04 repository:

sudo apt install certbot python3-certbot-apache

Next, run the following command to obtain a free TLS certificate using the Apache plugin:

certbot --apache -d your-domian.com

You will be asked to provide your email and accept the term of service:

Enabled Apache rewrite module
Redirecting vhost in /etc/apache2/sites-enabled/abantecart.conf to ssl vhost in /etc/apache2/sites-available/abantecart-le-ssl.conf

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://your-domain.com

You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=your-domain.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/your-domain.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/your-domain.com/privkey.pem
   Your cert will expire on 2022-06-11. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot again
   with the "certonly" option. To non-interactively renew *all* of
   your certificates, run "certbot renew"
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

If the test is successful, reload Apache for the change to take effect:

sudo apache2ctl -t
sudo systemctl reload apache2

Step 7. Configure Firewall.

By default, the UFW firewall is enabled on Ubuntu. Depending on your Apache virtual host configuration file, open ports 80 and 443 to allow HTTP and HTTPS traffic:

sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw reload

Step 8. Accessing AbanteCart Web Interface.

Once successfully installed, open your web browser and access the AbanteCart web interface using the URL https://your-domain.com. You should see the following page:

Install AbanteCart on Ubuntu 20.04 LTS Focal Fossa

Congratulations! You have successfully installed AbanteCart. Thanks for using this tutorial for installing the AbanteCart open-source e-commerce platform on Ubuntu 20.04 LTS Focal Fossa system. For additional help or useful information, we recommend you check the official AbanteCart website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button