The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Accessing OS-Commerce

Discussion in 'General Discussion' started by Computerbob, Aug 22, 2004.

  1. Computerbob

    Computerbob Active Member

    Joined:
    Feb 5, 2003
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    1
    I tried asking this question before but must have been unclear because there were no replys.

    After setting up OS Commerce on a new client, How does one access OS Commerce to configure the shopping cart. But if the domain has not resolved to this machine you can't access it.

    Normally you would type http://domainname.com/shop/admin to get into the OS Commerce admin setup screens.

    But presently you have to type http://ip address/~client/shop/admin.

    You get there but everytime you click on anything it reverts back to the http://domainname/shop/???

    The client want to setup there shopping card before the domain is transfer to this server. I have about 4 client that want to do this and am look for a solution.

    Anyone have any ideas.

    Thank

    Compter Bob.
     
  2. GufyMike

    GufyMike Member

    Joined:
    Feb 9, 2004
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    In the config area for the script change the domain name to the http://ip/~username then change it back to the domain name as soon as the user changes name servers. atleast thats what I would do.
     
  3. Computerbob

    Computerbob Active Member

    Joined:
    Feb 5, 2003
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    1
    Couple of followup queston.

    I hate to be stupid, but in which script?

    Have been looking a little for where but I'm not finding anything.

    Have been poking around but haven't found anything yet. Can you point me in the right direction. The carts been created (in test mode only) but I can delete it.

    Computer Bob
     
  4. GufyMike

    GufyMike Member

    Joined:
    Feb 9, 2004
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    In catalog/includes/configure.php where catalog is the root of oscommerce


    define('HTTP_SERVER', 'http://www.mydomain.tld'); // eg, http://localhost - should not be empty for productive servers
    define('HTTPS_SERVER', 'https://www.mydomain.tld'); // eg, https://localhost - should not be empty for productive servers

    Edit those entries. I believe they are the only ones which set the the domain name so when you click a link it takes you to http?//domain.tld/catalog instead to http://ip/~username/catalog (My user is using catalog to your store dir I think)
     
  5. Computerbob

    Computerbob Active Member

    Joined:
    Feb 5, 2003
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    1
    How to do it. How to access OS Commerce Admin only sections with a domain name NOT re

    This is only for the ADMIN section of the OS Commerce program. The shopping will not work until additional changes are done. I’m still working on finding all the changes that need top be done. When I get more I will post more information. Thank to user GufyMike for his assistance in getting to the correct path to find the files.

    So you want to add OS Commerce to your web site but it hasn’t resolved to the CPanel server. This could be that the customer doesn’t want to move his current site until the shopping cart is set up and working. This means little or no downtime for the new client. So what do you do?

    First you create the customer account on the CPanel machine. Then create the OS Commerce Shopping cart from the Client CPanel.

    After you have done this you need to edit a few files. How you do this is up to you. Having Root access to the servers (we own them) I login as root and then go that client home directory.

    Example would be (I’m doing it in steps):

    cd /home/clientfolder/
    cd public_html
    cd shopping (or what ever you called the folder you created the shopping cart in)

    cd admin/include

    Now edit the file configure.php
    I use JOE, but you could use anything that can edit the file. I didn’t include the complete file below but what we need to edit is near the top of the file.
    I have made the entries bold to help find it. You will find the entry

    define('HTTP_SERVER', 'http://DomainNAME.com');


    Now I just commented it out with two // in front of it and then copied the entry below it and made the changes. That way it will be easy to undo it.

    define('HTTP_SERVER', 'http://123.456.789.123/~clientname');

    Now don’t forget that the line must end with the semi colon.

    Now save the file and go the shopping cart using your browser. You should be able to edit all the admin stuff by using the IP and path

    IE: http://123.456.787.123/~clientname/shopping/admin

    Just login in and away you go.


    ******Start Example below*****

    <?php
    /*
    $Id: configure.php,v 1.14 2003/02/21 16:55:24 dgw_ Exp $

    osCommerce, Open Source E-Commerce Solutions
    http://www.oscommerce.com

    Copyright (c) 2002 osCommerce

    Released under the GNU General Public License
    */

    // define our webserver variables
    // FS = Filesystem (physical)
    // WS = Webserver (virtual)
    //define('HTTP_SERVER', 'http://DomainNAME.com');
    define('HTTP_SERVER', 'http://123.456.789.123/~client');

    define
    ('HTTP_CATALOG_SERVER', '');
    define('HTTPS_CATALOG_SERVER', '');
    define('ENABLE_SSL_CATALOG', 'false'); // secure webserver for catalog module
    define('DIR_FS_DOCUMENT_ROOT', $DOCUMENT_ROOT); // where your pages are located on the server. if $DOCUMENT_ROOT doesnt suit you, replace
    define('DIR_WS_ADMIN', '/shopping/admin/');
    define('DIR_FS_ADMIN', DIR_FS_DOCUMENT_ROOT . DIR_WS_ADMIN);
    define('DIR_WS_CATALOG', '/shopping/');
    define('DIR_FS_CATALOG', DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG);
    define('DIR_WS_IMAGES', 'images/');
    define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
    define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . 'images/');
    define('DIR_WS_INCLUDES', 'includes/');
    define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
    define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
    define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
    define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
    define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
    define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG . 'includes/languages/');
    define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');
    define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');
    define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');
    define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');


    Computer Bob
     
  6. Computerbob

    Computerbob Active Member

    Joined:
    Feb 5, 2003
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    1
    How to access OS Commerce Catalog only sections with a domain NOT resolved in Cpanel

    Now How to make the catalog work without a resolved domain name. Doing it with IP Address

    Step 2: to make the catalog work.

    Now that we have the admin working well to configure the shopping cart we need to be able to test it out as a user.

    Normally this would be done by using your browser and going to http://domainname/shopping/

    But it doesn’t work too well.

    We have to edit a few more files.

    Cd /home/username/public_html/shopping/includes

    There you will find a file called “configure.php. I would make a backup copy of the file first, there are more then one line to change.

    Edit the file (I use JOE, but what every to edit it.

    You need to look for all the line that contains the domain name for the site. They all need to be changed to the IP address

    Below is one example of the changes to be made.

    Before
    define('HTTP_SERVER', 'http://domainname.com);

    After
    define('HTTP_SERVER', 'http://123.456.789.123/~username');

    Next two additional line need to be changed to make the icon and images appear.

    Find the following two line and add the “~username/” before the entries.

    Before
    define('DIR_WS_IMAGES', '/shopping/images/');
    define('DIR_WS_ICONS', '/shopping/icons/');

    After
    define('DIR_WS_IMAGES', '/~username/shopping/images/');
    define('DIR_WS_ICONS', '/~username/shopping/icons/');

    That should be it. If I find anything missing I will update this thread.

    Computer Bob



    ***Below is an example of the file before editing. ****


    <?php
    /*
    $Id: configure.php,v 1.14 2003/07/09 01:15:48 hpdl Exp $

    osCommerce, Open Source E-Commerce Solutions
    http://www.oscommerce.com

    Copyright (c) 2003 osCommerce

    Released under the GNU General Public License
    */

    // Define the webserver and path parameters
    // * DIR_FS_* = Filesystem directories (local/physical)
    // * DIR_WS_* = Webserver directories (virtual/URL)
    define('HTTP_SERVER', 'http://domainname.com);
    define('HTTPS_SERVER', 'https://domainname.com);
    define('ENABLE_SSL', false); // secure webserver for checkout procedure?
    define('HTTP_COOKIE_DOMAIN', 'http://domainname.com);
    define('HTTPS_COOKIE_DOMAIN', 'https://domainname.com);
    define('HTTP_COOKIE_PATH', '/');
    define('HTTPS_COOKIE_PATH', '/');
    define('DIR_WS_HTTP_CATALOG', '/shopping/');
    define('DIR_WS_HTTPS_CATALOG', '/shopping/');
    define('DIR_WS_IMAGES', '/shopping/images/');
    define('DIR_WS_ICONS', '/shopping/icons/');
    define('DIR_WS_INCLUDES', 'includes/');
    define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
    define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
    define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
    define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
    define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');

    define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');
    define('DIR_FS_CATALOG', dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']));
    define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
    define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

    // define our database connection
    define('DB_SERVER', 'localhost');
    define('DB_SERVER_USERNAME', 'autogate_osc1');
    define('DB_SERVER_PASSWORD', 'B3Nci2D9Il');
    define('DB_DATABASE', 'autogate_osc1');
    define('USE_PCONNECT', 'false'); // use persistent connections?
    define('STORE_SESSIONS', 'mysql');
    ?>


    After changes made to the file.

    <?php
    /*
    $Id: configure.php,v 1.14 2003/07/09 01:15:48 hpdl Exp $

    osCommerce, Open Source E-Commerce Solutions
    http://www.oscommerce.com

    Copyright (c) 2003 osCommerce

    Released under the GNU General Public License
    */

    // Define the webserver and path parameters
    // * DIR_FS_* = Filesystem directories (local/physical)
    // * DIR_WS_* = Webserver directories (virtual/URL)
    define('HTTP_SERVER', 'http://123.456.789.123/~username);
    define('HTTPS_SERVER', 'https://123.456.789.123/~username);
    define('ENABLE_SSL', false); // secure webserver for checkout procedure?
    define('HTTP_COOKIE_DOMAIN', 'http://123.456.789.123/~username);
    define('HTTPS_COOKIE_DOMAIN', 'https://123.456.789.123/~username);
    define('HTTP_COOKIE_PATH', '/');
    define('HTTPS_COOKIE_PATH', '/');
    define('DIR_WS_HTTP_CATALOG', '/shopping/');
    define('DIR_WS_HTTPS_CATALOG', '/shopping/');
    define('DIR_WS_IMAGES', '/~username/shopping/images/');
    define('DIR_WS_ICONS', '/~username/shopping/icons/');
    define('DIR_WS_INCLUDES', 'includes/');
    define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
    define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
    define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
    define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
    define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');

    define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');
    define('DIR_FS_CATALOG', dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']));
    define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
    define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

    // define our database connection
    define('DB_SERVER', 'localhost');
    define('DB_SERVER_USERNAME', 'autogate_osc1');
    define('DB_SERVER_PASSWORD', 'B3Nci2D9Il');
    define('DB_DATABASE', 'autogate_osc1');
    define('USE_PCONNECT', 'false'); // use persistent connections?
    define('STORE_SESSIONS', 'mysql');
    ?>
     
Loading...

Share This Page