← Back to Documentation Home

Admin & Web Application Environment Configuration

Explore detailed guidance and instructions of 6amMart environment configuration, ensuring seamless operation and performance of your eCommerce platform.

Table of Contents
  1. Introduction & Requirements
  2. Local Development Setup
  3. cPanel Configuration
  4. VPS Droplet & LAMP Stack Setup
  5. Apache Virtual Host Configuration
  6. SSL Configuration with Certbot
  7. MySQL Database Console Setup
  8. Project Deployment & Permissions

Introduction & Requirements

This guide walks you through the step-by-step setup and configuration of the 6amMart Admin Panel and Web application. Ensure your environment matches the required specifications before beginning.

ComponentRequirements
Admin & Web (V4.0)PHP 8.3 or higher, MySQL 5.7 or higher, Laravel 12
Mobile App (V4.0)Android Studio latest, Flutter SDK (version 3.44.2 Stable), JDK 17, Xcode 26.2 for IPA build
For React (V4.0)Node.js v16.8 or higher, Npm / Yarn, VS Code / WebStorm
For Rental Module (V2.0)Minimum code version 4.0

Local Development Setup

Choose the right development environment for your local machine based on the operating system. Follow the instructions below for a smooth setup:

1. Windows (XAMPP)

Download and install XAMPP to set up a comprehensive local development environment on Windows.

2. Linux (LAMP)

Configure the LAMP stack on your Linux distribution for the local development environment.

3. MacOS (MAMP)

Install MAMP to establish a compatible local development environment on MacOS.

cPanel Configuration

Before starting the admin installation, the database must be configured for the application. Follow these database setup guidelines:

1. Create a database

Navigate to the MySQL Databases section and create a new database for the application.

2. Create a user for the database

Create a new database user and assign a secure password.

3. Add user to the database

Associate the user with the database and assign all privileges.

4. Domain Configuration

Navigate to your cPanel and locate the domain configuration. For 6amMart, it is essential to have two domains or subdomains. Use your main domain to host the customer web panel. Create a subdomain for the admin panel (e.g. if your domain is example.com, generate a subdomain like admin.example.com).

VPS Droplet & LAMP Stack Setup

To host your application on a VPS (like Digital Ocean), configure a droplet with at least 2 cores CPU and 4GB RAM. Set up the LAMP stack (Linux, Apache2, MySQL, PHP) on Ubuntu by running these commands:

1. Update Package Lists

Ensure package repositories are up to date.

sudo apt update

2. Install Apache Server

Install Apache2 web server.

sudo apt install apache2 -y

3. Install MySQL Server

Install MySQL package.

sudo apt install mysql-server -y

4. Install PHP

Install PHP and core apache bindings.

sudo apt install php libapache2-mod-php php-mysql -y

5. Test PHP Processing

Verify PHP is rendering by placing an info.php page.

/var/www/html/info.php

echo "<?php phpinfo(); ?>" | sudo tee /var/www/html/info.php

6. Install Additional PHP Extensions

Install all required PHP packages for Laravel 12.

sudo apt install php-bcmath php-ctype php-json php-mbstring php-openssl php-pdo php-tokenizer php-xml php-zip php-fileinfo php-gd php-sodium php-mysql php-curl -y

Apache Virtual Host Configuration

Configure a virtual host (vhost) file to point Apache to your project's public directory.

1. Create a Configuration File

Navigate to sites-available and create your configuration file.

Terminal Command

cd /etc/apache2/sites-available/
sudo nano your_domain.com.conf

2. Virtual Host Template

Paste the virtual host template, updating the DocumentRoot and server names to your domain.

your_domain.com.conf

<VirtualHost *:80>
    ServerAdmin webmaster@your_domain.com
    ServerAlias www.your_domain.com
    ServerName your_domain.com
    DocumentRoot /var/www/your_domain.com/public_html

    <Directory /var/www/your_domain.com/public_html>
        Options -Indexes +FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

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

3. Enable Site & Reload

Enable the site in Apache and restart the web server.

sudo a2ensite your_domain.com.conf
sudo systemctl reload apache2

SSL Configuration with Certbot

Set up a free, auto-renewing Let's Encrypt SSL certificate using Certbot.

1. Remove legacy Certbot packages

Avoid version conflicts by removing system-packaged Certbot versions.

sudo apt-get remove certbot

2. Install Certbot and Link Command

Install Certbot using snap and link the executable.

sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot

3. Get and Install SSL Certificate

Run the Certbot Apache plugin to verify your domain and configure HTTPS.

sudo certbot --apache

4. Test Automatic Renewal

Verify that the renewal systemd timer works.

sudo certbot renew --dry-run

MySQL Database Console Setup

If setting up the database via SSH, run the following SQL queries in the MySQL command console:

1. Login & Database creation queries

Log in to MySQL and initialize the database schema and credentials.

MySQL Shell Commands

sudo mysql

CREATE DATABASE your_database_name;
CREATE USER 'your_username'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON your_database_name.* TO 'your_username'@'localhost';
FLUSH PRIVILEGES;
EXIT;

2. Install phpMyAdmin (Optional)

Optionally install phpMyAdmin to manage tables graphically.

sudo apt update
sudo apt install phpmyadmin php-mbstring php-zip php-gd php-json php-curl -y
sudo systemctl restart apache2

Project Deployment & Permissions

1. Upload and Extract Files

Upload the ZIP file to /var/www/your_domain.com/public_html and unzip the contents.

apt install unzip -y
unzip your_file_name.zip

2. Configure file permissions

Apply standard file and folder permissions so Laravel can execute write operations.

chmod commands

sudo chmod 755 .env
sudo chmod 777 modules_statuses.json
sudo chmod 777 app/Providers/RouteServiceProvider.php
sudo chmod -R 777 storage
sudo chmod -R 777 bootstrap/cache
sudo chmod -R 777 resources/lang