1

Recently I've come across the osCommerce, an open-source e-commerce project, and I'd like to try it. Is it packaged in the repository (like Wordpress)? If not, how do I manually install and use it?

Jorge Castro
  • 71,754
Oxwivi
  • 17,849
  • Dude, forget about OSCommerce, it's really old news. There are a whole lot of better shopping platforms. Aside from the big names you can try Microweber for example which is PHP/MySQL of course, but way lighter than OSCommerce. –  Feb 14 '14 at 10:59

2 Answers2

1

you need a LAMP solution, so you have to install Apache, MySQL (server version) and the required PHP version and it's modules for your software.

The path where you have to "install" your files is called "document root" and is defined in the Apache configuration file, which is usually /var/www/. You can open the file /etc/apache2/apache2.conf and simply read (and change) the location of the DR.

You can basically consider the PHP as a big plugin for Apache, so probably for all the settings regarding the organization of the files on the disk and the general setup you have to refer to apache2.conf file. But to manage the PHP functionality you can modify the file php.ini that is usually located under the /etc/php tree but it can easily be moved elsewere according to your version of Ubuntu, but in general you can find a php.ini under /etc/.

Always make a backup of these files if you are not sure about what you are really doing.

By default the address of your local webserver is localhost or 127.0.0.1 if you want to use an IP, you can type it as the address and reach your document root. If you have created a dir under the DR called test (as in /var/www/test/), navigate to the content of this folder simply by going to http://localhost/test/ or http://127.0.0.1/test/ in your web browser. In a nutshell every web address is relative to the DR.

Oxwivi
  • 17,849
Micro
  • 2,158
  • I was hoping for a clear instructions on how set up an configure those to work with each other. – Oxwivi Nov 20 '11 at 18:04
  • you probably do not need that, in many cases it's simply enough to install these packages from the repository, everything else is tuning, your LAMP works right after the installation. – Micro Nov 20 '11 at 18:07
  • The LAMP will, I know, but I need to configure osCommerce to use the PHP and whatever other backends it needs. – Oxwivi Nov 20 '11 at 18:17
  • What do you mean with that? Apache recognize the use of php simply looking at the source code of the page, everything contained in the brackets is php for Apache after you have installed the right modules. It's an automated process and you simply have to copy all the osCommerce files and paste this files in the DR. – Micro Nov 20 '11 at 18:26
  • Oh darn it! I'm so stupid! So you're saying that Apache handles everything, right? It makes sense. I still have a lot to learn. – Oxwivi Nov 20 '11 at 18:27
1

osCommerce requires PHP and MySQL, in other words, a LAMP stack (Linux (operating system), Apache HTTP Server, MySQL (database software) and PHP). osCommerce need only to be copied to the document root, /var/www/.

Further, we need to create a database and user in MySQL for osCommerce to use.

Install LAMP and osCommerce

sudo tasksel install lamp-server

Now you need to download and "install" osCommerce (get the latest download URL @ osCommerce):

wget http://www.oscommerce.com/get/8 #this is osCommerce 3.0.2 download as of 21/11/2011
unzip oscommerce-3.0.2.zip
sudo cp oscommerce-3.0.2/oscommerce/ /var/www/

In order to avoid permission issues, the above commands downloads to the current shell, unzips and copies osCommerce to /var/www/. Never unzip it directly or move the files to the document root if you don't know the necessary permissions required for a web application to function properly.

osCommerce will now be accessible at http://ipaddress/osommerce/, where ipaddress is the IP address or the domain of your server. If you're installing osCommerce on the system you are currently on, you can replace ipaddress with localhost or 127.0.0.1.

Browsing to the osCommerce page will trigger the initial setup and ask for the details of MySQL database it will use and administrator user set up.

Create a MySQL database

First, you should create a MySQL user for osCommerce to use. It's bad practise to use the root user/pass (setup during LAMP installation) for a web application.

In a shell on the machine with the MySQL on it, do:

mysql -u root -p

Enter the root password you previously specified. This gets you a prompt which has full access to your MySQL server.

Now, pick a database name - it doesn't matter what it is really so long as it's unique on the MySQL server (to see existing ones, SHOW DATABASES;)

CREATE DATABASE dbname;

For example, replacing dbname can be replaced with with oscommerce.

Now you have to give a new user access to that database. Pick a username and password (the username can be oscommerce again, but make a secure password) - replace dbname with the database name (in this example, oscommerce):

GRANT ALL ON dbname.* TO username IDENTIFIED BY 'password';

Done. Now you have the details to put into your webform; the Database Server is just localhost or 127.0.0.1, assuming the webserver is the same machine as the MySQL server, the Username and Password are the ones just created, and the Database Name is whatever you replaced dbname with. Port can be left empty.

Reference

Oxwivi
  • 17,849