Showing results for 
Search instead for 
Did you mean: 

Application Profile - Sample Scalable OpenCart eCommerce Application with Loadbalancer



This article provides a sample application profile that can be imported for use in Cisco CloudCenter which installs and configures a scalable OpenCart application, using a nginx loadbalancer and MySQL database.

Product Versions Validated



Cisco CloudCenter





OpenCart is an Apache PHP based application with MySQL database. For this sample deployment of OpenCart we will front end Apache PHP with load balancer based on nginx. The Apache PHP tier will be modeled to be scalable with an initial node count of 2 (and the maximum number of nodes that the user or APIs are permitable to scale up to is configurable as well). The concepts demonstrated by this sample application profile can be used to model any other desired application.

OpenCart is free open source ecommerce platform for online merchants. OpenCart provides a professional and reliable foundation from which to build a successful online store.


In the above diagram, following requirements are being considered:

  1. Apache php tier is multi-node with initial deployment with two nodes
  2. MySQL database is modeled as single node
  3. nginx load balancer is front ending the Apache php tier


     Figure - CloudCenter Topology Modeler view of the modeled OpenCart application

Considerations for installing Apache php package:

  1. Installation scripts in OpenCart package create DB tables and other entries using Opencart.sql file during the install. With single node based Apache php tier it is not an issue. With multi-node tier, the first node works fine but the subsequent nodes hit issue while executing the sql file. Following changes have been made to account for that:
    • Modified CREATE TABLE lines to CREATE TABLE IF NOT EXISTS so that it checks for TABLE presence before trying to create a table in DB
    • Modified INSERT INTO lines to INSERT IGNORE INTO so that it checks for entries in tables before inserting them
  2. Added db_prefix ‘oc_’ in the cli_install.php file in install folder
  3. Install script for OpenCart package refers to Apache php tier IP as a http_server variable when issuing install command. This works fine when you have single node as the variable has single IP in it. With multi-node, the value has comma separated IPs of nodes of the apache php tier. The node IP needs to be derived from tier IPs and node names

Applicable Profile along with OpenCart package contents are available at following github location:

Application Profile -

OpenCart Package -

Openart Install Script -

DB Setup Script - createdb.sql

Additional Information

CloudCenter -

CloudCenter Product Documentation -

OpenCart -

nginx -


Update History



Content for Community-Ad

This widget could not be displayed.