Ric Posted April 18, 2014 Report Share Posted April 18, 2014 How to install OpenCart and configure SSLI have had several requests regarding the installation of OpenCart and how to run it with SSL on Uniform 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 the main server only. The following step-by-step guide covers this modification and how to install OpenCart on Uniform Server ZeroXI. The guide also covers portability allowing OpenCart to run from a USB memory stick or other location.Preliminary:1. Download (opencart-1.5.6.3.zip) and extract OpenCart files to a separate folder.2. Copy the folder “upload” to Uniform Server folder UniServerZ\www3. Rename the “upload” folder to shop.4. Rename file UniServerZ\www\shop\config-dist.php to config.php5. Rename file UniServerZ\www\shop\admin\config-dist.php to config.phpApache configuration: Apache SSL configuration must be modified to secure the main server only.6. Edit file UniServerZ\core\apache2\conf\extra\httpd-ssl.confLocate two instances of ${US_ROOTF_SSL} and replace with ${US_ROOTF_WWW}Apache server certificate:Create a self-signed server certificate (or see documentation, obtaining and installing a certificate issued by a certificate authority.)7. Start UniController8. From the top menu bar select: Apache>Apache SSL>Server Certificate and Key generator9. Generator forms opens. No need to change any parameters, click Generate button.OpenCart installation:10. From UniController start Apache and MySQL server.11. Using phpMyAdmin create a new database, name it opencart (or any name of your choice)12. Access OpenCart by typing the following into your browser: http://localhost/shop/This starts the installation process displaying four pages as follows:Page Step 1: Click continuePage Step 2: All items are green - Click continuePage Step 3: Configuration. Set following parameters: 1. Please enter your database connection details. Database Host: change localhost to 127.0.0.1 User: root Password: root (or whatever you set for the MySQL root password) Database name: opencart (or whatever you set in 11) 2. Please enter a username and password for the administration Username: fred (use a name you prefer) Password fred123 (use your own password) E-mails me@some_provider.com (provide an e-mail you wish to use) Click continue.Page Step 4: Delete folder: UniServerZ\www\shop\install13. While on step 4 page click “Login to your Administration”14. Enter name and password (fred fred123) you set for the administrator. Click Login15. Enabling SSL in the OpenCart Dashboard as follows:a. Go to System > Settingsb. To the right of “Your Store (Default)” click Editc. Click on the Server tabd. Check the radio button to use SSLe. Click Saveg. Logout16. Enabling SSL in the OpenCart directory config.php file:a. Edit file UniServerZ\www\shop\config.phpb. Locate these lines: // HTTPS define('HTTPS_SERVER', 'http://localhost/shop/');Change to: // HTTPS define('HTTPS_SERVER', 'https://localhost/shop/');17. Enabling SSL in the OpenCart Admin folder config.php file:a. Edit file: UniServerZ\www\shop\admin\config.phpb. Locate these lines: // 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.Test:18. Type the following into browser: http://localhost/shop/ Expected result example cart content is displayed.19. Add an item to the cart and click checkout. Result your browser is forced to a secure connection and displays closed padlock. If requested by your browser add an exception.20. Type the following into browser: http://localhost/shop/admin/21. Enter name and password (fred fred123) you set for the administrator. Expected result your browser is again forced to a secure connection and displays closed padlock.Portability:The above installation is fixed however it is easily converted for portability allowing OpenCart to run from a USB memory stick. Paths in the two configuration (config.php) files are absolute these require modification. Note your paths may be different to those shown however the replacement sections can be used with no modification.22. Edit file: UniServerZ\www\shop\config.phpLocate this section: // 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/');23. Edit file: UniServerZ\www\shop\admin\config.phpLocate this section: // DIR define('DIR_APPLICATION', 'C:\UniServerZ\www\shop/admin/'); define('DIR_SYSTEM', 'C:\UniServerZ\www\shop/system/'); define('DIR_DATABASE', 'C:\UniServerZ\www\shop/system/database/'); define('DIR_LANGUAGE', 'C:\UniServerZ\www\shop/admin/language/'); define('DIR_TEMPLATE', 'C:\UniServerZ\www\shop/admin/view/template/'); 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/'); define('DIR_CATALOG', 'C:\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/');All the bestRic Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.