osCommerce Online Merchant System

 

Introduction

 

You will find that open source systems are usually written in PHP and systems such as content management systems and shopping carts tend to use MySQL as their back-end database for the simple reason that MySQL is also open source as oppose to other DBMSs that maybe proprietary such as MS-Access and Oracle.  MySQL is a database management system and so it serves the same purpose as other DBMSs such as MS-Access, Oracle, SQL Server, FileMaker, dBASE, Clipper, and FoxPro.

Presentation1

A typical architecture for hosting a shopping cart is as depicted in the diagram above. What the diagram intends to emphasis are:

Presentation1

Note that you have a folder on your F-Drive called the "public_html".  This folder is actually on a server called "homepages.shu.ac.uk".  So any files that you place in this folder could be a server-side php file.  Note that MySQL server also runs on "homepages.shu.ac.uk".

 

Setup

  1. Before you start you need to make sure you are ready for installing open source.  Check it out
  2. osCommerce uses MySQL as the back-end database.  If you do not have a MySQL account, create it now
  3. Visit OSCommerce Website and find the latest download under osCommerce Solutions and download it
  4. Using the zip archive, extract all the files into the root of a directory in your homespace - Your "public_html" folder on your F-Drive

Note: Once the zip file is extracted, a directory called 'oscommerce' followed by some version reference is created.  Not that all downloaded files are placed in this directory and a file structure is also created

Note: Extraction of the files into 'public_html' is a convenient FTP transfer of files on the server. This has been made possible because your 'public_html' folder resides on the server (see diagram and notes above).  Under normal circumstances, in absence of student setup, you would have had to take the extra step of FTP transfer of files to your root folder on Web server

  1. Since oscommerce folder's name will be part of the URL for accessing the shop, it would be a good idea to rename it to something more straight forward such as 'shop'.  So the URL to your shop will be 'http://homepages.shu.ac.uk/~YourUsername/shop/'

 

Note: In the root folder of the installation (in 'shop' folder) you will find a file named 'documentation. pdf'.  This file contains information that you will find useful in developing your shop.  You must keep and regularly refer to this file.  There is also information for installing osCommerce in this file but for conciseness we have included the required information in this file

 

Note: A back-end database details such as name of the MySQL server, username, and password need to be written into two files within your shop installation. These two files are '/shop/catalog/includes/configure.php' and '/shop/catalog/admin/includes/configure.php'.  To begin with, these two files are not writeable.  For the installation process to work, we need to make the two files writeable.  Also note that after the installation process the access to the two files must again be restricted if we are to ensure that 3rd parties will not be able to write to them.

 

Crash course in Unix:

ls

list contents of a directory (folder)

ls -l

list contents of a directory (folder) with details

cd

change directory

cd ..

change directory upwards (parent directory)

chmod

change permissions (more below)

pwd

get 'Web server Root Directory'

 

  1. Connect to Unix using 'Secure Shell'. 

 

Navigate to '/public_html/shop/catalog/' folder and change permission level for 'includes' folder to '777'

At the prompt type: chmod 777 includes

At the prompt type: chmod 777 images

Navigate to '/public_html/shop/catalog/includes/' folder and change permission level for 'configure.php' to '777'

At the prompt type: chmod 777 configure.php

Navigate to '/public_html/shop/catalog/admin/' folder and change permission level for 'includes' folder to '777'

At the prompt type: chmod 777 includes

At the prompt type: chmod 777 backups

Navigate to '/public_html/shop/catalog/admin/includes/' folder and change permission level for 'configure.php' to '777'

At the prompt type: chmod 777 configure.php

 

  1. Note your 'Web server Root Directory'.  You would need this in the installation process.  UNIX command 'pwd' gives you your root path depending on where you are in that path.  For the installation process this should end with '/catalog/'

 

  1. Open your Web browser and inserting your username in the following go to: 'http://homepages.shu.ac.uk/~YourUsername/shop/catalog/install/' and click on 'Continue' to begin installation

 

  1. Insert MySQL details into the form.  Note that password is not your network password but the one for your MySQL account. Click 'Continue'

 

 

 

 

 

Note: A back-end database structure and initial content will be downloaded into your MySQL database.  Note the 'WWW Address' and Web server root directory, leave them as they are.

 

  1. Enter Web server details

 

  1. Insert your details into the Online Store Settings form.  Click 'Continue'

 

Note: Make sure to memorise your administrator username and password for future use. You will not be able to configure and manage the shop without them.

Note: We now need to do some checking to make sure that all the correct details are written into the two 'configure.php' files.

 

  1. Locate 'configure.php' within the 'includes' folder in 'catalog' folder and open this file using TextPad.  Check to make sure that the correct credentials and details are inserted into this file and that they are correct.  You must use the details that you received in the email from the MySQL registration. There are also server and directory details you need to check.  Ensure these details are as stated below.  If these details are not in the file, insert them manually. Save and close the file.

 

Repeat this process for 'configure.php' within the 'includes' folder in 'catalog/admin'

 

  1. Go to your page at http://homepages.shu.ac.uk/~YourUsername/shop/catalog/

 

Note: There are warning messages at the top of the page.  This means that in order to protect your installation you need to alter access levels to directories and files back to their default values.

 

  1.  Change access levels

chmod 755 includes

chmod 644 includes/configure.php

chmod 755 admin/includes

chmod 644 admin/includes/configure.php

 

  1. You also need to restrict access to the install directory so that 3rd parties can not reinstall your system.  For this, simply rename this directory.