OpenCart is a free and open source shopping cart application providing an online e-commerce solution. The following page provides detailed information for installing OpenCart on Uniform Server XII and how to run it with SSL. Also covered is portability allowing OpenCart to run from a USB memory stick or another location. The following guide assumes you are installing OpenCart in a sub-folder named shop. Running third party scripts such as OpenCart requires Uniform Server's SSL default behaver to be modified this is covered in section "SSL secure main server." Note: At Step D you are required to enter your e-mail address this is the e-mail address you set as default when configuring MSMTP, for details see Edit MSMTP Configuration SSL secure main server.A default installation of Uniform Server contains a separate folder (ssl) preconfigured specifically for a personal secure server. To run third party scripts such as OpenCart requires this default behaver to be modified such that SSL secures only the main server. The Apache SSL configuration must be modified to secure only the main server as follows:
Note: With the above modifications folder ssl becomes redundant and is no longer used. Create a self-signed certificateCreate a self-signed server certificate or see documentation Apache - Free Server Certificate to obtain and install a certificate issued by a certificate authority.
Step A: Download and ExtractDownload and unzip the OpenCart package.
Before OpenCart can be installed a MySQL user and database are required for details see Step B. Step B: Create the Database and a User using phpMyAdminFollow these instructions to create your OpenCart username and database using phpMyAdmin. Note: These instructions are written for phpMyAdmin 4.1.13; the phpMyAdmin user interface can vary slightly between versions.
Note: Other parts of this documentation assume you have set the following: OpenCart database name = opencart Username for OpenCart = opencart Password = fred123 remember to replace these with the values you have set in the above. Step C: Upload the filesNote: The location of your root web directory www will vary depending where Uniform Server was installed. Copy the OpenCart upload directory into the root directory of your web site.
Step D: OpenCart InstallationThe following assumes you have Apache and MySQL servers running. To start the OpenCart installation:
The installation process consists of four pages as follows: STEP 1 - LICENSE STEP 2 - PRE-INSTALLITION
Uniform Server defaults meet all the above requirements click Continue STEP 3 - CONFIGURATION 1. Please enter your database connection details.
2. Please enter a username and password for the administration.
That completes configuration click Continue. STEP 4 - Finished Login to administration.
Enabling SSL in the OpenCart DashboardThe following assumes you are logged into admin, if not see note above. To enable SSL in the OpenCart Dashboard proceed as follows:
Finally delete folder: C:\UniServerZ\www\shop Enabling SSL in the OpenCart directory - config.php fileEdit file C:\UniServerZ\www\shop\config.php // HTTPS define('HTTPS_SERVER', 'http://localhost/shop/');Change to: // HTTPS define('HTTPS_SERVER', 'https://localhost/shop/'); Enabling SSL in the OpenCart Admin directory - config.php fileEdit file: UniServerZ\www\shop\admin\config.php // HTTPS define('HTTPS_SERVER', 'http://localhost/shop/admin/'); define('HTTPS_CATALOG', 'http://localhost/shop/');Change to: // HTTPS define('HTTPS_SERVER', 'https://localhost/shop/admin/'); define('HTTPS_CATALOG', 'https://localhost/shop/'); That completes installation. Close browser and restart servers. TestTest the installion as follows:
PortabilityPaths in the two configuration (config.php) files use absolute paths. This restricts the above installation to a fixed location, meaning Uniform Server and OpenCart cannot be moved to a different location. However OpenCart is easily converted for portability allowing the complete server to run from either a USB memory stick or moved to another location. Note: Paths in your config.php files may be different to those shown, however the replacement sections can be used with no modification. Edit file: C:\UniServerZ\www\shop\config.php // DIR define('DIR_APPLICATION', 'C:\UniServerZ\www\shop/catalog/'); define('DIR_SYSTEM', 'C:\UniServerZ\www\shop/system/'); define('DIR_DATABASE', 'C:\UniServerZ\www\shop/system/database/'); define('DIR_LANGUAGE', 'C:\UniServerZ\www\shop/catalog/language/'); define('DIR_TEMPLATE', 'C:\UniServerZ\www\shop/catalog/view/theme/'); define('DIR_CONFIG', 'C:\UniServerZ\www\shop/system/config/'); define('DIR_IMAGE', 'C:\UniServerZ\www\shop/image/'); define('DIR_CACHE', 'C:\UniServerZ\www\shop/system/cache/'); define('DIR_DOWNLOAD', 'C:\UniServerZ\www\shop/download/'); define('DIR_LOGS', 'C:\UniServerZ\www\shop/system/logs/'); Replace with: // DIR $root= substr($_SERVER["DOCUMENT_ROOT"],0,-4); // Get path define('DIR_APPLICATION', $root . '\www\shop/catalog/'); define('DIR_SYSTEM', $root . '\www\shop/system/'); define('DIR_DATABASE', $root . '\www\shop/system/database/'); define('DIR_LANGUAGE', $root . '\www\shop/catalog/language/'); define('DIR_TEMPLATE', $root . '\www\shop/catalog/view/theme/'); define('DIR_CONFIG', $root . '\www\shop/system/config/'); define('DIR_IMAGE', $root . '\www\shop/image/'); define('DIR_CACHE', $root . '\www\shop/system/cache/'); define('DIR_DOWNLOAD', $root . '\www\shop/download/'); define('DIR_LOGS', $root . '\www\shop/system/logs/'); Edit file: C:\UniServerZ\www\shop\admin\config.php // DIR define('DIR_APPLICATION', 'I:\UniServerZ\www\shop/admin/'); define('DIR_SYSTEM', 'I:\UniServerZ\www\shop/system/'); define('DIR_DATABASE', 'I:\UniServerZ\www\shop/system/database/'); define('DIR_LANGUAGE', 'I:\UniServerZ\www\shop/admin/language/'); define('DIR_TEMPLATE', 'I:\UniServerZ\www\shop/admin/view/template/'); define('DIR_CONFIG', 'I:\UniServerZ\www\shop/system/config/'); define('DIR_IMAGE', 'I:\UniServerZ\www\shop/image/'); define('DIR_CACHE', 'I:\UniServerZ\www\shop/system/cache/'); define('DIR_DOWNLOAD', 'I:\UniServerZ\www\shop/download/'); define('DIR_LOGS', 'I:\UniServerZ\www\shop/system/logs/'); define('DIR_CATALOG', 'I:\UniServerZ\www\shop/catalog/'); Replace with: // DIR $root= substr($_SERVER["DOCUMENT_ROOT"],0,-4); // Get path define('DIR_APPLICATION', $root . '\www\shop/admin/'); define('DIR_SYSTEM', $root . '\www\shop/system/'); define('DIR_DATABASE', $root . '\www\shop/system/database/'); define('DIR_LANGUAGE', $root . '\www\shop/admin/language/'); define('DIR_TEMPLATE', $root . '\www\shop/admin/view/template/'); define('DIR_CONFIG', $root . '\www\shop/system/config/'); define('DIR_IMAGE', $root . '\www\shop/image/'); define('DIR_CACHE', $root . '\www\shop/system/cache/'); define('DIR_DOWNLOAD', $root . '\www\shop/download/'); define('DIR_LOGS', $root . '\www\shop/system/logs/'); define('DIR_CATALOG', $root . '\www\shop/catalog/'); Test portabilityTest the installion for portability as follows:
--oOo--
|