CubeCart Installation Guide on Ubuntu 20.04

CubeCart is a free and open-source eCommerce solution tailored for setting up online stores efficiently. Developed in PHP, it offers a straightforward deployment process and a user-friendly environment. Key functionalities include:

  • Access to technical support
  • Comprehensive product statistics
  • Integration with social media platforms
  • Support for multiple languages
  • Multi-currency compatibility
  • Database utilities for backup and recovery
  • Offline availability with caching capability

This guide walks you through the installation of CubeCart on a server running Ubuntu 20.04.

Prerequisites

  • Deploy a Ubuntu 20.04 server with the latest updates applied
  • Create a non-root user and grant sudo privileges

Step 1: Set Up the LAMP Stack

Start by updating the system’s package index:

Add the PHP PPA maintained by Ondřej Surý:

$ sudo apt -y install software-properties-common

$ sudo add-apt-repository ppa:ondrej/php

Refresh the package list again to include the new repository:

CubeCart is best supported by PHP version 7.3. Install the required packages, including Apache, MariaDB, and essential PHP modules:

$ sudo apt install apache2 mariadb-server mariadb-client php7.3 libapache2-mod-php7.3 php7.3-json php7.3-common php7.3-gmp php7.3-curl php7.3-mysql php7.3-mysqli php7.3-mcrypt php7.3-opcache php7.3-intl php7.3-fpm php7.3-xmlrpc php7.3-bcmath php7.3-zip php7.3-imagick php7.3-mbstring php7.3-gd php7.3-cli php7.3-xml php7.3-zip wget unzip curl -y

Modify the PHP settings for optimal CubeCart performance by editing the configuration file:

$ sudo nano /etc/php/7.3/apache2/php.ini

Use Control + W to locate the lines you want to change, then update the following values:

  • memory_limit = 512M
  • upload_max_filesize = 100M
  • post_max_size = 100M

Ensure Apache starts on system reboot:

$ sudo systemctl enable apache2

Restart Apache to apply the new configuration settings:

$ sudo systemctl restart apache2

Step 2: Create the CubeCart Database

Start by enabling the MariaDB service to launch automatically on system reboot:

$ sudo systemctl enable mariadb

Next, run the security script to configure and secure your MariaDB installation:

$ sudo mysql_secure_installation

Answer the prompts as follows to tighten security:

  • Press Enter for the current root password
  • Choose Y to set a new root password
  • Select Y to remove anonymous users
  • Choose Y to block remote root login
  • Press Y to delete the test database
  • Choose Y to reload the privileges table

Now, access the MySQL shell. Enter your root password when prompted:

Inside the MySQL shell, execute the following commands to set up the database:

  • Create a new database called cubecart:
  • Add a user cubecartuser with a secure password (replace StrongPassword accordingly):

CREATE USER 'cubecartuser'@'localhost' IDENTIFIED BY 'StrongPassword';

  • Grant the user all rights to the cubecart database:

GRANT ALL ON cubecart.* TO 'cubecartuser'@'localhost' WITH GRANT OPTION;

  • Apply the permission changes and exit:

Step 3: Install CubeCart

Download the latest version of CubeCart using the link from the official site. The version referenced here is 6.4.4:

$ wget https://www.cubecart.com/download/CubeCart-6.4.4.zip

Create a new directory within the Apache root path for the CubeCart installation:

$ sudo mkdir -p /var/www/cubecart

Extract the downloaded ZIP file into the newly created directory:

$ sudo unzip CubeCart-6.4.4.zip -d /var/www/cubecart

Clean up by removing the ZIP archive:

$ sudo rm CubeCart-6.4.4.zip

Assign ownership of the installation files to the Apache user:

$ sudo chown -R www-data:www-data /var/www/cubecart

Adjust directory permissions to ensure appropriate access rights:

$ sudo chmod -R 755 /var/www/cubecart

Step 4: Configure Apache2 Web Server

Start by permitting HTTP traffic through the system’s firewall:

Now create a dedicated Apache configuration file named cubecart.conf:

$ sudo nano /etc/apache2/sites-available/cubecart.conf

Insert the following configuration details into the file and save your changes:

<VirtualHost *:80>
    ServerAdmin admin@example.com
    DocumentRoot /var/www/cubecart
    ServerName example.com
    ServerAlias www.example.com

    <Directory /var/www/cubecart/>
        Options FollowSymlinks
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Deactivate Apache’s default site configuration to avoid conflicts:

$ sudo a2dissite 000-default.conf

Activate the new CubeCart site configuration:

$ sudo a2ensite cubecart.conf

Enable URL rewriting support, which is essential for CubeCart to function correctly:

Restart Apache to apply all configuration changes:

$ sudo systemctl restart apache2

Step 5: Launch the CubeCart Interface

To begin the web-based setup, open your browser and navigate to your server’s IP address. For instance:

http://192.0.2.10/

Conclusion

You have successfully installed CubeCart on your Ubuntu 20.04 server. Follow the installation wizard in your browser to set up your store. Connect to the database, create an administrator account, and finalize the site configuration. Once completed, you can access both your storefront and admin dashboard.

Source: vultr.com

Create a Free Account

Register now and get access to our Cloud Services.

Posts you might be interested in: