OpenCart Server Deployment Overview¶
Prerequisites¶
The following system parameters and settings are required for the application to function correctly:
-
Operating System: Debian, Ubuntu, or RedHat family distributions (CentOS, Rocky Linux, AlmaLinux).
-
Access Rights: Superuser (
root) privileges to install system packages and manage services. -
Ports:
-
80— used by the Certbot Docker container for domain ownership validation. -
443— external port for HTTPS traffic. -
8080— internal web server port (Apache/httpd), which receives proxied traffic.
FQDN of the final panel on hostkey.in domain¶
The domain template is formed as follows:
| Parameter | Value |
|---|---|
| Prefix | opencart |
| Domain | hostkey.in |
| Full Template | opencart{Server_ID_from_Invapi}.hostkey.in/opencart |
File and Directory Structure¶
The following directories are created and used during the deployment process:
-
/root/opencart/— application source files downloaded from the GitHub repository. -
/var/www/html/opencart/— web application working directory. -
/root/nginx/— Docker Compose configuration files for the proxy server. -
/data/nginx/user_conf.d/— custom Nginx configurations. -
/data/nginx/nginx-certbot.env— environment variables file for the Certbot container.
Application Installation Process¶
Deployment is performed by cloning the OpenCart repository (branch 3.0.x.x) and configuring the web server. The main stages include:
-
Installing system dependencies (PHP, MySQL, Apache/httpd).
-
Cloning the source code from GitHub to
/root/opencart/. -
Copying application files to
/var/www/html/opencart/. -
Renaming configuration files from
config-dist.phptoconfig.php(including theadmindirectory). -
Configuring the web server to listen on the internal port to ensure SSL operation via proxy.
Access Rights and Security¶
-
Web Server User: All files in
/var/www/html/opencartbelong to thewww-datauser (in Debian/Ubuntu) orapache(in RedHat). -
Firewall:
-
In RedHat-based systems, ports
80/tcpand443/tcpare opened automatically. -
Network Security: The IPv6 protocol is disabled (
net.ipv6.conf.all.disable_ipv6 = 1) to prevent network interaction conflicts.
Databases¶
The application uses a local MySQL database management system:
-
Database Name:
opencart -
DB User:
opencart -
Access Rights: Full privileges (
ALL) on theopencartdatabase. -
Storage Location: Local MySQL/MariaDB instance installed in the operating system.
Docker Containers and Execution¶
A container with automatic Let's Encrypt certificate renewal is used to ensure HTTPS operation.
Nginx Certbot Container:
-
Image Name:
jonasal/nginx-certbot:latest -
Ports: Uses
network_mode: host. -
Volumes:
-
nginx_secrets:/etc/letsencrypt— certificate storage. -
/data/nginx/user_conf.d:/etc/nginx/user_conf.d— custom proxy configurations. -
Environment Variables:
-
CERTBOT_EMAIL: email address for Let's Encrypt notifications (default is[email protected]). -
Restart Policy:
unless-stopped.
Application Update Instructions¶
Updates are performed by updating the configuration and restarting containers:
(Note: If changes involve system packages, standard OS update commands must be executed).Permissions Settings¶
The following directory permissions are set to ensure correct web server operation:
-
/var/www— ownerwww-data/apache, recursive. -
/var/www/html/opencart— access mode0755.
Available Connection Ports¶
| Port | Purpose |
|---|---|
443 (HTTPS) | Primary application access via secure connection |
80 (HTTP) | Used only within the system for certificate validation |
8080 | Internal Apache web server port |
Starting and Stopping the Application¶
The proxy server container is managed from the /root/nginx directory:
-
Start:
-
Stop:
Proxy Servers¶
An nginx-certbot container is used as a Reverse Proxy. It accepts incoming HTTPS traffic on port 443 and forwards it to the local web server (Apache/httpd) running on port 8080 via HTTP protocol.