Detailed Installation Instructions

The following sections will flesh out and add details to the quick install guide steps, for those who are just beginning or have hit a snag.
 
Upload the /catalog and /admin dirs to your server
The files and directory structure must be uploaded to your web server. This can accomplished different ways. Use whatever method is most familiar to you, i.e., unzipping the Oscommerce archive to your local computer and using your favorite FTP program to upload those files, or using and tar to avoid the tedium of downloading and re-uploading (unix-linux only). The files can be uploaded to the document root, or some other subdirectory, like catalog. Note: if you are using FTP to upload files, you must upload all PHP files in ASCII mode, not binary
If you have never looked at the oscommerce archive before, the directory structure looks like this:

tep-snapshot
           /catalog
                /catalog
          
/admin
                /admin

All the files are located in the directories that are highlighted in RED.
It is important to only upload the directories that are highlighted, and their sub-directories. First, upload the /catalog directory to your document root (public_html or www). Then, upload the /admin dir to the /catalog dir. This will create a self contained shopping cart environment under a single directory tree that is easy to work with. When you are finished uploading, your basic directory tree should look like this:
/public_html
             /catalog
                      /admin
                              /images
                              /includes
                     /download
                     /images
                     /includes
                     /install
Set the permissions on /catalog/includes/configure.php and /admin/includes/configure.php to 777
Setting file permissions correctly will allow the installation script to write to the configure.php files. So, after they are uploaded you can use telnet, ssh, or your favorite FTP client to set the file permissions. CHMOD 777 will set the correct permissions.
 
Using phpMyAdmin or other tool, create your database and user, and assign that user to the database
This section provides instructions using phpmyadmin to create a database and user, and assign that user to the database. These steps are necessary BEFORE you run the install script. You can download a copy of phpmyadmin at http://www.phpmyadmin.net/. These instructions were written using phpmyadmin 2.2.6. The interface may change, but the procedures are pretty much the same.
  1. On the opening screen of phpmyadmin,  under the MySql heading, you will see a text box. Enter the name of your database here, and click the create button. This creates your database.
  2. Click the Home link in the left frame. Then click the users link. On the next page, select the database that you want to assign this user to. Enter the host name (usually localhost), enter the username, and password. Check all the privileges available and click go. This creates the user and assigns the user to the correct db.
 
Note: Many virtual hosts do not allow this type of access through phpmyadmin, and instead provide you with another way to create your databases and users through your hosting control panel. Check with your host.
 
Run the install script, filling in all the required information.
The install script is included in the oscommerce package and is located in the /catalog/install directory. Simply open your web browser, and point it to  http://yourserver.com/catalog/install/index.php  and the installer will begin.
Replace ‘yourserver’ with your domain name or ip address. This will start the Oscommerce installation script. See the steps below to complete the installation script:
  1. Select the 'New Install' button
  2. Next, check the "import catalog database" and "automatic configuration" checkboxes.
  3. Make sure all the Webserver Information on this page is correct in section 2
  4. Next, enter your correct database information in section 3 of the install page
  5. Click the "Continue" Button
  6. Next, the script will confirm a connection to your database, if it all works, click the continue button. If you get an error, you have made a mistake in your database info. Click the back button and correct your mistake.
  7. Next, you will get a confirmation of successful database import. Click the continue button.
  8. Next, the install script will attempt to access your configure.php files. If the permissions are wrong, you will get error messages, and a "Retry" button. Set the permissions correctly and retry.
  9. The next page has more options. This is step 2 of the installation. Enter the correct web server information.
  10. If you want to enable SSL, check the checkbox, and confirm that all info is correct.
  11. If you are on shared hosting, make sure the "persistent connections" box is unchecked.
  12. Choose to store sessions as files or in the database and click continue.
  13. You have reached the conclusion of the install script. Before you continue, click each button, "Catalog" and "Administration Tool" to test the install.
 
Re-set the permissions on /catalog/includes/configure.php and /admin/includes/configure.php to 644
This is important to ensure security of your configuration. Simply CHMOD 644 the above files. This can be done through telnet, ssh, or an FTP client.
 
Set the permissions on /catalog/images dir to 777
In order to properly upload images through the admin section, the images directory must have world writable permissions set. CHMOD 777 this directory.
 
Create the dir /admin/backups and set the permissions to 777
In your admin directory, create the subdirectory /backups and set the permissions to 777. This will allow you to use the database backup function without receiving error messages. With this permissions configuration, it is not secure to keep backups on your server. You should download the backup to your local computer, and never store the backup on the web server.
 
Password protect your /admin dir using .htaccess
Your admin section should be password protected. The easiest way to do this is to use .htpasswd and .htaccess to secure the directory. If you are not sure how to do this, please follow the procedure outlined below:
  1. Add this code to your .htaccess file

    AuthType Basic
    AuthName "Locked Area"
    AuthUserFile /home/youraccount/.htpasswds/admin/passwd
    require valid-user
  2. Next, create your .htpasswd file. There are several ways to do this, but here is a non-linux users way: go to this web site http://www.kelv.net/programming/htaccess/ and follow the instructions!
 
 
Add to your DirectoryIndex statement and include the following : default.php index.php . This can be done in the Apache httpd.conf file if you have root access, or can be done in a .htaccess file in your /catalog dir.
 
This is the .htaccess method for adding the DirectoryIndex statement.
  1. Create a plain text file using a text editor.
  2. Add this statement : DirectoryIndex default.php index.php index.htm index.html
  3. Save the file as .htaccess  (note the period before the h)
  4. Upload it to your /catalog directory
 
This tells the server to look for default.php as the index page in the /catalog directory, so you can access your catalog by the url http://www.yoursite.com/catalog/ instead of having to include the filename like this http://www.yoursite.com/catalog/default.php.
 
Delete your /catalog/install directory
Congratulations, you have completed all the necessary steps to successfully installing OSCommerce on your web server. You should be able to access your catalog at http://yoursite.com/catalog and your admin at http://yoursite.com/catalog/admin .