Toggle navigation

OpenCart Image Guide

Version 3.0.2.0

Websoft9 OpenCart Stack is a pre-configured, ready to run image for running OpenCart on Alibaba Cloud.

OpenCart is an easy to-use, powerful, open source online store management program that can manage multiple online stores from a single back-end. Administrative area simply by filling in forms and clicking “Save”. There are many professionally-written extensions available to customize the store to your needs.it have 13000+ modules and themes on Marketplace for all your needs.

Application Software(Opencart3.0.2.0)
Software directory: /data/wwwroot/opencart

Infrastructure(PHP7.0,APACHE2.4)
PHP Configuration File: /etc/php.ini
Default Apache Vhost Configuration File: /etc/httpd/conf.d/vhost.conf
Apache Vhost Configuration directory: /etc/httpd/conf.d
Apache Log Files: /var/log/httpd

Database(MYSQL5.7)
Database install directory: /usr/share/mysql
Database data directory:  /data/mysql
Database Configuration File: /etc/my.cnf
PhpMyAdmin install directory: /usr/share/phpmyadmin

After the installation of Image,please verify it

  • Login on Alibaba Cloud console,get you Internet IP Address
  • Open you Chrome or Firefox on your local PC,visit the http://Internet IP Address and you can enter the installation page directly,if there no response from browser,please check the Security Group settings to ensure that port 80 is been allowed

It is recommended to complete two steps before the the installation:

  • Domain resolution if you want to use domain for this application (Add an A record to the Internet IP Address of Server from Domain Control Panel)
  • Modify the MySQL password of root through http://Internet IP Address/phpmyadmin

Then access the installation page and complete the installation wizard for the following steps:

  1. Local Chrome or Firefox to visit http://yourdomain or http://Internet IP Address,you will enter the configuration inerface of installation,click”Continue” button to the next step
    oc1
  2. Verify the environment and go to next step
    oc2
  3. Flowing step you should complete the Database Configuration below(Database type is “MySQLi”,hostname is “localhost” and usename/password please refer to the relevant section of documentation:Will be used Usernames and Passwords)
    oc1
  4. When the installation is completed,it will go the following interface
    oc1
  5. Please don’t forget to delete the “installation folder” by Putty below.
    [root@iZbp1i4rjdsy216yq7lgucZ ~]# cd /data/wwwroot/opencart/
    [root@iZbp1i4rjdsy216yq7lgucZ opencart]# mv install install.bak
  6. Click the “Login to your Administration” button to enter the backend of Opencart

Three usernames and passwords are required for application installation, application using, andapplication maintenance:

1、Opencart:Username and Password is set by youself when installation,
Backend URL:http://youdomain.com/admin
2、MySQL Database:Default username and password is root/123456
Control Panel URL:http://Internet IP Address/phpmyadmin
3、Linux Server:Username is root,Password is set by youself when buying.
Please Using the Putty for ssh remote and WinSCP for SFTP

Note:You can reset the password of OS through Cloud Console if you have forgotten it

 

Connect to a Linux instance using Windows OS

This section uses PuTTY as an example. PuTTY can be downloaded here.

You can connect to a Linux instance via PuTTY as follows:

  1. Start Putty.exe.
  2. Enter the public IP address of the instance in Host Name (or IP address).
  3. Use the default port 22.
  4. Select SSH as Connection Type.
  5. Type a session name in Saved Sessions, and then click Save. In later logins, you may directly load the session without re-entering the IP address.
  6. Click Open to connect.
  7. Upon first connection, the following dialog box will be displayed. Click Yes.
  8. As prompted, enter the username and password for the Linux ECS instance. The password will not be displayed on-screen. Press the Enter key to complete connection to the instance.

When you connect your computer to the Linux instance successfully, you can operate the instance from your computer.

Use SFTP you can mange file,upload and download file,configure Server.

  1. Start WinSCP. Login Dialog will appear.
  2. Then select your File protocol(SFTP) on the dialog
  3. Enter your host name to Host name field, username to User name and password to Password like below
  4. You may want to save your session details to a site so you do not need to type them in every time you want to connect. Press Save button and type site name.
  5. When appear the dialog below,please select the “yes”
  6. You can manane Linux file below
  7. WinSCP can integrate the Putty and transfer the log in information to Putty
  8. Now you can use Putty(Not need to log in) from the menu bar of WinSCP

Following is the step for access phpMyadmin

  1. Open Chrome or Firefox on your local PC
  2. visit the http://Internet IP Address/phpMyAdmin,you can enter the login page
  3. select you language,Username:root,Password:123456
  4. Click the button “Go”

While strictly modules, product feeds and OpenCart extensions should be standalone and modular, some require modifications to the OpenCart core. Modifying OpenCart core files greatly reduces your ability to upgrade your store to later versions, and can affect other modules and extensions. vQmod provides a mechanism by which modules requiring OpenCart core modifications can be installed without damaging the integrity of your core system for upgrades. vQmod keeps a list of filenames and changes required, in the form of one XML file per extension. These changes are then created as the core files are used, and the resulting files are stored as cached copies which are executed instead of the original, core PHP or TPL file.

If you wish to upgrade your store, or have a 3rd party extension that you have not used before, it is advisable that you use the vQmod system.

  1. The vQmod download and instructions for installation can be found here:https://github.com/vqmod/vqmod.
  2. Once you have downloaded the appropriate vQmod zip file provided in the link, you need to uncompress the zip file and FTP the vQmod folder to your site’s root directory. From the Filezilla screenshot below, we can see the root directory of this store is located at /data/wwwroot/default/opencart in the Remote site side. Uploading the vQmod folder here will make the vqmod folder visible in /data/wwwroot/default/opencart.
  3. vQmod advises you to set the permissions to writable for the vqmod/vqcache folders, index.php, and admin/index.php. In Filezilla you can right click on a file or folder, select “File Permissions…”, and enter 755 or 777 in the “Numeric value” to set it to writable.
  4. The next step in installing vQmod is to visit the install page in your store. Enter your store’s location in your browser, then “vqmod/install” afterwards. If your store is located at “www.mystore.com”, the vQmod install page would be located at “www.mystore.com/vqmod/install”. The following text will appear on the page if it was installed correctly: “VQMOD HAS BEEN INSTALLED ON YOUR SYSTEM!”.

important note:

  •  Unlike the install folder after installing OpenCart, do not delete vQmod’s install folder after the vQmod installation!
  • vQmod advises that you load your homepage to see if it appears and works correctly after the install. You would also need to check your vqmod/vqcache folder to see if there are new vq files.

The OpenCart extension directory lets you easily extend OpenCart’s default functionality.

To install an extension, follow these steps:

  • Make sure the extension is compatible with your OpenCart version.
  • Read the extension documentation available on the extension Web page or website to understand the installation steps.
  • Download the extension to your desktop.
  • Extract it with your preferred tool and search for a text file listing the installation steps in the root folder of the extracted archive.

If you find installation instructions, follow them (note that some extensions will require vQMod).

 

Set FTP credentials & install extension

Extension Installer you can upload zip-packed or XML extensions as well as single modification files by just a few clicks.

In order to use the Installer wit zip-packed file you need to be aware of your FTP credentials.

In order to set your FTP credentials, navigate to System -> Settings -> Store Settings.

Then, choose the FTP tab and fill in your FTP credentials. Make sure you check the Yes radio button for the Enable FTP field and click the blue Save button in the upper right corner of the page as shown:

Now the Extension Installer will know how to access your FTP and you will be able to install extensions with ease.

Installing an extension

Usually OpenCart 2.x extensions come packed in a zip, which contains installation and/or update instructions, sometimes a release log and another zip, whose name ends in “.ocmod.zip“. Extension Installer recognizes such zips and uploads their content directly to the FTP root of your store. That said, it will produce an error if you try to upload zips with a name that is not in the “*.ocmod.zip” format.

In order to upload an extension, navigate to Extensions -> Extension Installer. Then click the blue Uploadbutton and provide the route to your extension’ s”*.ocmod.zip” archive.

If the extension that you are installing contains files with names already existent in the current location, you will receive an alert about this in the grey “Files that will be overwritten” box. This means the extension is about to overwrite files that you already have on your site. Here, you can either inspect all of the listed files and make sure no OpenCart core files are to be overwritten, or contact the extension’s developer directly. Once you are sure it is safe to proceed, click the blue Continue button. On success, you should get a green “Success: You have installed your extension!” message.

No FTP for Extension Installer

If you don’t want to ust FTP to upload extension files,please intall this No FTP for Extension Installer first

This extension allows to upload extensions without using ftp at the ‘Extension Installer’ page. It can be useful when your ftp is not configured or your hosting aborts the installation procedure for some reason.

How to use it?

  1. download zip archive;
  2. upload xml file from the archive at ‘Extension Installer’ page;(Uploading single .xml modification files is just as easy as installing zip-packed extensions. The difference is only in the route you will provide the Installer with. Modification files’ names should end in “.ocmod.xml” when uploaded via the Installer.)
  3. go to the ‘Modifications’ page and click on the ‘Refresh’ button;
  4. After successful installation of the xml file you should see an ‘Upload without FTP’ checkbox at ‘Extension Installer’ page.

OpenCart is periodically updated with new versions of itself. It is a good idea to update your store with each new version released to take advantage of bug fixes and new features. It may seem like a hassle to update the shop every time a new version comes out, but it is worth the effort in the long run. There are ways to avoid the pain of upgrades, such as using quality themes and modules that do not modify your OpenCart core, or using vQmod.

Backup opencart file and database first

  1. visit the Download page,access the latest version of OpenCart and download it
  2. upload the files from the latest version to the store’s file directory via a FTP client. There are two files that need to be excluded from the upload to the store’s root directory: “/data/wwwroot/default/opencart/config.php”, and the “admin/config.php”.so,The easiest way to upload the files of the latest version, without these two config.php files, is to delete them from the local site side before uploading.
  3. all the files from “upload” are selected and dragged to the scroll bar. Every file within “upload” is automatically loaded to its proper path this way. These files should overwrite the existing files, so select “Overwrite” when asked by the FTP client.
  4. After uploading the files of the new version to the FTP client, the administrator must visit the install page. The install page is located at the store location followed by “/install” like so: www.”mystore”.com/install. The following screenshot displays the upgrade instructions after it finishes updating when viewing the install page.
  5. After letting OpenCart upgrade complete, the following success page will be displayed. The install directory can be deleted now.

Though the upgrade has completed, there are still a few things to do to get the administration side of your store in order:

  • Remove cookies from your browser.
  • Press CTRL+F5 three times in both the admin side and the store front.
  • Visit the store settings and fill in any missing information. See Settings to learn how to edit the store settings.
  • Visit the User Groups and give the Top Administrator all the privileges needed to run the administration. See Users for more information on how to edit User Groups.

Once the administration is in order, you can resume the routine of managing your store; except now you are equipped with all the improved tools and features brought by the update.

 

One of the most devastating events that can happen to an online store is the loss of a database. The store database contains important customer and product information. It is difficult for a store to recover after losing a database, and certainly takes up too much time to re-enter this necessary information. You need to be vigilant with downloading updated backups of the store’s database to their computer, just in case something happens.

Backup Tools

OpenCart lets you download a backup of the store’s current database or restore the database to the administration in System>Backup/Restore. The Backup section seen below contains all the data tables in the MySQL database available for download. You can choose what files you want to download by checking on them. Clicking the “Backup” button will download the selected tables to your computer.

If you need to restore a backup file that you previously saved to your computer, all you need to do is click “Choose File” from Restore Backup, select the sql file from their computer, and the database will be restored.

Manual Moving Opencart

OpenCart can be easily migrated to a new web server. The steps are listed below:

  1. Copy all the OpenCart files from your existing web server to the new web server.
  2. Export the OpenCart database and import it into the new server.
  3. Edit config.php and admin/config.php. These files contain the filesystem paths to OpenCart folders, URLs to OpenCart frontend and admin, and database access details. The paths and database details will most likely need to be updated, and the URLs will need to be changed only if the OpenCart store’s domain has changed.

The PHP configuration file allows you to configure the modules enabled, the email settings or the size of the upload files. It is located at /etc/php.ini.

There are some PHP settings that need to be sufficient when running your application,The values for PHP.ini below are suggested values only.

  • memory_limit – Minimum: 128M Recommended: 512M or better
  • upload_max_filesize – Minimum: 20M
  • post_max_size – Minimum: 20M
  • max_execution_time: At Least 120 Recommended: 300

After modifying the PHP configuration file, restart both Apache and PHP-FPM for the changes to take effect:

# systemctl restart httpd

How to modify the allowed limit for upload?

Modify the  /etc/php.ini file to increase the allowed size for uploads:

; Maximum size of POST data that PHP will accept.
post_max_size = 16M
; Maximum allowed size for uploaded files.
upload_max_filesize = 16M

then,restart the apache

# systemctl restart httpd

How to change the max_execution_time?

If you receive the message “Maximum execution time of 30 seconds exceeded”.You may also like to extend the max_execution_time for PHP and you can modify it by two methods below

Method one: edit your  /etc/php.ini


; Maximum execution time of each script, in seconds
; http://php.net/max-execution-time
; Note: This directive is hardcoded to 0 for the CLI SAPI
max_execution_time = 90
; Maximum amount of time each script may spend parsing request data. It's a good
; idea to limit this time on productions servers in order to eliminate unexpectedly
; long running scripts.

Method two: edit your .htaccess:


<IfModule mod_php5.c>
php_value max_execution_time 90
</IfModule>

How To Change The Language?

The language section lets you manage the languages available for the store front. OpenCart provides English as the default language after installation. To add multiple languages to the site you need to install a language pack. Language packs can be acquired from the Extension Directory. See Adding multiple languages to learn how to add a language pack to OpenCart.

The new language can be added to the site under System>Localisation>Language. The following information will be needed to save the language:

  • Language Name
  • Code: The ISO language code. W3Schools has a complete list of ISO codes.
  • Locale: The code used by browsers to auto-detect the language of the site. Locale codes can be viewed here.
  • Image: The image used to represent the language, that will be displayed in the header area of the store.
  • Directory: The location of the language pack (do not include the catalog/language path).
  • Filename: The name of the language file.
  • Status: Enables or disables the language in the store front.
  • Sort Order: Determines the position of the language among multiple languages in the header.

How To Debug Errors In OpenCart?

The OpenCart log file is at installdir/opencart/htdocs/system/logs/error.txt/error.log.

How To Change Administrator Password?

For security, it is recommended that you change the default administrator password as soon as possible. Follow the steps below:

  1. Log in to the application as an administrator using the link from the previous section.
  2. Select the “System” menu (cog icon) in the left sidebar.
  3. In the resulting sub-menu, select the “Users -> Users” sub-menu item.
  4. Find the administrator account in the list and click the “Edit” icon.
  5. Enter a new password for the administrator account in the resulting account profile page, and repeat it once to confirm.

Use domain you should complete the following steps:

Step One:Domain resolution

e.g,If you using the AliCloud Domain product,you should log in to your Domain Console Panel

And find the domain name resolution interface,then add an A record to the Internet IP Address of Server from Domain Control Panel.

Step One:Modify the Vhost file

  1. Using SFTP to edit the /ect/httpd/conf.d/vhost.conf
  2. Modify the domain related information like below,then save it
    <VirtualHost *:80>
    ServerName www.mydomain.com
    ServerAlias mydomain.com
  3. Using putty to run the command “systemctl restart httpd”

With sensitive customer and payment information being handled by your store, it is critical that you are able to secure that important information as it travels between web server and browser. As a result of this need, many store owners turn to HTTPS for additional security. A SSL certificate needs to be obtained and installed before you can enable HTTPS for your store.

Once the SSL certificate has been installed, go to the Server tabs under your store’s settings in your admin panel. The first option in the Server tab lets you decide if you want to use SSL. Selecting “yes” will enable the SSL so that you can access your store through HTTPS.

Apache http service

~# systemctl start httpd
~# systemctl stop httpd
~# systemctl restart httpd

MySQL  service

~# systemctl start mysqld
~# systemctl stop mysqld
~# systemctl restart mysqld

When install new extension from back-end it will not successful,may be the permissions of file and folder is not appropriate,you should change it

Web site root permissions to follow:
file 644,folder 755 ,Permissions Users and groups apache,apache
If there is a file permissions problem, execute the following three commands:

~# chown -R apache.apache /data/wwwroot/opencart
~# find /data/wwwroot/opencart -type d -exec chmod 755 {} \;
~# find /data/wwwroot/opencart -type f -exec chmod 644 {} \;