Opencart is an e-commerce building application based on php. It is an open software for setting up shopping sites,etc..,. It is an online store management system. It is also available in FTP server or we can configure it and run from our own servers.

    In this article we are going to see how to install and run Opencart application in our system for building our own e-commerce site.

    The prerequisite requirement to run Opencart application is the server should be a LAMP configured server, since it is a PHP based application.

    If your system is already a LAMP configured one you are good to go if not you can check the below link for LAMP installation.

For LAMP installation,

RPM based machines:

Click here for RPM based machines.

Debian based machines:

Click here for Debian based machines.

Installing Opencart:

    Download the latest opencart opensource package from their official site OpenCart Download page or Clone the latest OpenCart version from GitHub.

$ wget https://github.com/opencart/opencart/releases/download/3.0.2.0/3.0.2.0-OpenCart.zip

unzip the file,

$ unzip 3.0.2.0-OpenCart.zip

Move all the files and folders from "upload" folder to your document root,

$ mv upload/* /usr/local/apache-2.4.37/htdocs/opencart/

Rename the sample configuration files to main config files,

$ cd /usr/local/apache-2.4.37/htdocs/opencart/

$ mv config-dist.php config.php $ mv admin/config-dist.php admin/config.php

Permissions for the web user,

    Change the ownership for the below files and folders since it requires permissions to folders while you are uploading files, images to your e-commerce site.

$ chown daemon:daemon system/storage/cache/ -R
$ chown daemon:daemon system/storage/download/ -R
$ chown daemon:daemon system/storage/logs/ -R
$ chown daemon:daemon system/storage/modification/ -R
$ chown daemon:daemon system/storage/session/ -R
$ chown daemon:daemon system/storage/upload/ -R
$ chown daemon:daemon system/storage/vendor/ -R
$ chown daemon:daemon image/ -R
$ chown daemon:daemon image/cache/ -R
$ chown daemon:daemon image/catalog/ -R
$ chown daemon:daemon config.php
$ chown daemon:daemon admin/config.php

Webserver changes:

    Add a Virtual host to run your e-commerce site, We are going to run an e-commerce site ljunixopencart.com through opencart,

<virtualhost *:80>
ServerAdmin jhony@ljunixopencart.com
DocumentRoot "/usr/local/apache-2.4.37/htdocs/opencart"
ServerName ljunixopencart.com
ServerAlias www.ljunixopencart.com
ErrorLog "logs/ljunixopencart.com-error_log"
CustomLog "logs/ljunixopencart.com-access_log" common
</VirtualHost>

To know about more on setting up a virtual host Click here

Creating database and providing grants:

$ mysql

Create a database for your e-commerce site,

mysql> create database opencart;

Grant privileges to the user for accessing the opencart database,

mysql> grant all privileges on opencart.* to "ljunix"@"localhost" identified by "Password123";

opencart will be your database name, enter the username and for "localhost" leave it if you want to install opencart on your local system or mention the server IP if installing in remote server.

Flush the privileges,

mysql> flush privileges;

    Add a host entry to the server IP or to 127.0.0.1 to www.ljunixopencart.com and access the same on your browser to complete the installation, you will be redirected to the setup page,

$ cat /etc/hosts
127.0.0.1         localhost
127.0.1.1         jhony

127.0.0.1         www.ljunixopencart.com


Follow the below steps to complete the installation,

Step 1: Accepting the opencart free software agreement:

    Read the agreement to know more about the terms and conditions of Opencart,


Step 2: Click continue to proceed to the next step of installation.

Step 3: Pre-Installation requirements and dependencies:

    This page provides you the dependencies for opencart application, without these dependencies we cannot proceed to the next step. Make sure every requirement are checked.


   
Step 4: Configuration settings:


    1. Enter the exact details that you have provided for the database grants,


DB DriverProbably we will go with mysqli which is supported for PHP-7 and higher versions.
HostnameEnter the server IP or 127.0.0.1 if installed in local system.
UsernameDatabase username mentioned on the mysql grants.
PasswordPassword mentioned on the mysql grants.
DatabaseDatabase name.
Port3306 by Default
PrefixDatabase tables prefix name.

    2. Details to access the Administration dashboard.

UsernamePortal Admin username.
PasswordPassword for your admin user.
E-MailEmail ID for notifications regarding sales and analytics.

Accessing your e-commerce site:

You can either check your e-commerce site or login to the administration dashboard on the next step,


Default site page:


Administration Dashboard:

    The URL to access your administration dashboard is site-name/admin (Ex: http://www.ljunixopencart.com/admin ). You can change the Admin Login URL according to your wish on admin/config.php file.


Securing your e-commerce site:

1.Remove the install directory after completing the installation.

2.Securing the Storage location:
   
    It is advisable to move your storage location outside the web-access to make your e-commerce site secure.
   
    You can do it either Automatically or Manually. If you choose to do it by manually, you have to update storage locations on the config files.

    We will do it by automatically,


    Now you all setup to run up your e-commerce site. Happy selling and retailing!!!


Feel free to ask if you have any questions.

Comments

  1. Be the first to add a comment.