Location : Web Hosting - Web Hosting Knowledge Base - oscommerce Tutorial

oscommerce installation in cpanel hosting account

Installating oscommerce manually in a cpanel hosting account is a simple three step process, we will be going through each steps in detail here :-

Preparing cpanel hosting account

oscommerce program requires PHP and a MySQL database to work, our Linux based web servers has been configured with proper PHP settings to run oscommerce, all you need to do is login to your hosting account control panel and create an empty MySQL database for oscommerce installation later. You can check out create mysql database and grant mysql user acess for the detail steps to setup a mysql database, please remember to write down the mysql database name, mysql user name and password after the mysql database creation process, we will be needing this info in the oscommerce installation process later.

Preparing oscommerce files

After getting an empty mysql database setup in hosting account, we can now start to prepare the oscommerce files. First, we need to download oscommece file from oscommerce download site and extract the files in your computer. The compressed file will then be extracted to a folder "oscommerce-xx" where "xx" is the version number. Open up your FTP client and upload the files to the appropriate folder in your hosting account. Please note that if you want to access your oscommerce website by entering :-

http://wwwyourdomain.com

then place all files within the oscommerce-xx/catalog/ folder in the public_html folder in your hosting account.

If you want to access your oscommerce website by entering :-

http://www.yourdomain.com/shop/

then place the entire oscommerce-xx/catalog/ folder in the public_html folder and then rename the catalog folder in hosting account to shop accordingly. You can check out rename file or folder name with cpanel if you want to do it with cpanel hosting account control panel.

The last thing in preparing oscommerce files is to reset the file permission for catalog/includes/configure.php to 777 or rwxrwxrwx, this is required for the installation process later where oscommerce will need to write some configuration data to this file, you can check out rename File and folder permission using cpanel file manager for the details on making the permission changes. Please take note that after the installation process, file permission for this catalog/includes/configure.php file must be reset back to 644 or rw-r--r-- to avoid security issues.

Running oscommerce installation script

After preparing the mysql database and placing the oscommerce files in the appropriate folder in your hosting account, you can now execute the oscommerce installation script to setup oscommerce for action. Depending on where you have placed oscommerce files, enter http://www.yourdomain.com or http://www.yourdomain.com/shop/ in your web browser window and this will start up the oscommerce installation script :-

  1. In the first screen, select Install New online store
  2. let Import Catalog Database and Automatic Configuration checked, both are required for new installation, hit Continue to proceeed to next step
  3. In the Database Import screen enter the following (you will need the mysql connection info you have wrote down in the mysql database setup process earlier) :-
    • Database Server: localhost
    • Username: username_mysqluser
    • Password: password_set_for_mysqluser_above
    • Database Name: username_mysqldbname
    • Database Tye: MySQL - MyISAM(Default)
    • Dtabase Table Prefix: osc_
    • Persistent Connections: unchecked
    • Session Storage: [checked] Databases
    • Import Sample Data: checked>
  4. hit Continue to next step
  5. oscommerce will attempt a test conection to mysql server with the connection info given, you will be getting a successful status page if the connection info given is correct, if you received a failed status, generally that means there is an error if either the mysql user, database or password, if all are entered correctly, then double check if the mysql user has been granted access to the database.
  6. After receiving a successful status page, hit Continue to proceed to next step
  7. You will be getting another status screen for sucessfully importing the database, hit Continue to proceed to next step
  8. In the oscommerce configuration screen :-
    • WWW Address: http://www.yourdomain.com
    • Webserver Root Directory: /home/username/public_html/
    • HTTP Cookie Domain: www.yourdomain.com
    • HTTP Cookie Path: /~username/public_html/
    • Enable SSL Connections: [checked] if you have SSL cert installed else leave unchecked
    • Word Directory: /home/username/tmp/
    • hit Continue to proceed to next step
  9. If the configuration entered is free from error, you will get a status screen stating the configuration was successsful, hit Continue to proceed to next step
  10. oscommerce is setup and ready to use, you can choose either Catalog (see the web store) or Administration Tool (login to admin screen for further configuration and setup product listing etc. for the store)

To finish up the installation process, you are required to:-

  • rename or remove the catalog/install folder in your hosting account
  • reset the file permission of file catalog/includes/configure.php to 644 or rw-r--r--
  • reset permission for catalog/images to 777 or rwxrwxrwx
  • reset permission for admin/images/graphs to 777 or rwxrwxrwx
  • create a admin/backups folder and set permission to 777 or wxrwxrwx, this is for storing database backup for your store, option in "Tools" section of the store admin screen
  • password protect the admin folder to avoid security sissue, you can check out Password protect folder for the detail process