How to Install S-Cart on Linux Mint Latest

S-Cart is an open-source e-commerce platform developed with PHP and MySQL. It is a powerful and customizable e-commerce solution that can be installed on various operating systems, including Linux Mint.

In this tutorial, we will discuss how to install S-Cart on Linux Mint Latest.

Prerequisites

Before installing S-Cart, ensure that you have the following prerequisites:

Step 1: Install Required Packages

First, update the package information and install the required packages using the following commands:

sudo apt update
sudo apt install git unzip
sudo apt install apache2 mariadb-server
sudo apt install php libapache2-mod-php php-mysql php-curl php-gd php-intl php-json php-mbstring php-xml php-zip

Step 2: Create a Database

After installing the required packages, the next step is to create a database for the S-Cart installation. Follow the below instructions:

  1. Log in to the MariaDB shell using the following command:
sudo mysql -u root -p
  1. Create a new database using the below command. Replace dbname with your preferred name.
CREATE DATABASE dbname;
  1. Next, create a new user and grant all the privileges to the user using the following commands. Replace username and password with your preferred values.
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON dbname.* TO 'username'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit;

Step 3: Install S-Cart

Now that you have installed the necessary prerequisites, created a database, and granted the database user access, you can proceed to install S-Cart.

  1. Clone the S-Cart repository from GitHub using the git clone command:
git clone https://github.com/s-cart/s-cart.git
cd s-cart
  1. Set the appropriate permissions for Apache to access the S-Cart directory using the following command.
sudo chown -R www-data:www-data /var/www/html/s-cart/
  1. Import the S-Cart database schema into our database using the following command. Replace username, password, and dbname with your preferred values.
mysql -u username -p dbname < database/shops.sql
  1. Make a copy of the example config file and then edit the copied file to match your database's connection details.
cp app/Config/db.php.example app/Config/db.php
  1. Edit the database connection details in the app/Config/db.php file.

    <?php
    return array(
      'host' => 'localhost',
      'port' => '3306',
      'database' => 'dbname',
      'username' => 'username',
      'password' => 'password',
      'prefix' => 'sc_',
    );
    

Step 4: Configure Apache

Once we have installed S-Cart, we need to configure Apache to access it.

  1. Create an Apache virtual host configuration file for S-Cart using the following command:
sudo nano /etc/apache2/sites-available/s-cart.conf
  1. Add the following content to the file, save and close the file.
<VirtualHost *:80>
  ServerAdmin webmaster@localhost
  ServerName localhost
  DocumentRoot /var/www/html/s-cart
  ErrorLog ${APACHE_LOG_DIR}/error.log
  CustomLog ${APACHE_LOG_DIR}/access.log combined
  <Directory /var/www/html/s-cart/>
      Options FollowSymLinks
      AllowOverride All
      Require all granted
  </Directory>
</VirtualHost>
  1. Enable the virtual host configuration using the following command.
sudo a2ensite s-cart.conf
  1. To enable the Apache rewrite module, run the following command.
sudo a2enmod rewrite
  1. Finally, restart the Apache service to apply the changes.
sudo service apache2 restart

Step 5: Access S-Cart

Once you have completed all these steps, you can go ahead and access S-Cart by opening a web browser and navigating to http://localhost.

Conclusion

You have successfully installed S-Cart on Linux Mint Latest. Now you can start using S-Cart to set up your e-commerce store.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!