Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Join Date
    Feb 2009
    Posts
    15
    Plugin Contributions
    0

    Default 2 different installs (https and http)

    Good Morning everyone,
    I'm posting this in a new thread and I'll let the moderator decide if it needs to be combined to older threads.

    So here is the problem. I had the store running on a different hosting platform. It was running like a dream. That platform had the http and the https in the same directory so it was easy to switch to the admin section and use the checkout modules. Since then we moved to a new server.

    our current file structure looks like this:
    /home/username/public_html/cart
    and the secure side is:
    /home/username/secure_html/cart

    normal config:

    PHP Code:
    <?php
    /**
     * @package Configuration Settings circa 1.3.8
     * @copyright Copyright 2003-2007 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     */


    /*************** NOTE: This file is similar, but DIFFERENT from the "admin" version of configure.php. ***********/
    /***************       The 2 files should be kept separate and not used to overwrite each other.      ***********/

    // Define the webserver and path parameters
      // HTTP_SERVER is your Main webserver: eg-http://www.your_domain.com
      // HTTPS_SERVER is your Secure webserver: eg-https://www.your_domain.com
      
    define('HTTP_SERVER''http://www.ourdomain.com');
      
    define('HTTPS_SERVER''https://www.ourdomain.com');

      
    // Use secure webserver for checkout procedure?
      
    define('ENABLE_SSL''true');

    // NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes!
    // * DIR_WS_* = Webserver directories (virtual/URL)
      // these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder)
      
    define('DIR_WS_CATALOG''/cart/');
      
    define('DIR_WS_HTTPS_CATALOG''/cart/');
    the admin config:
    PHP Code:
    <?php
    /**
     * @package Configuration Settings circa 1.3.8
     * @copyright Copyright 2003-2007 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     */


    /*************** NOTE: This file is similar, but DIFFERENT from the "store" version of configure.php. ***********/
    /***************       The 2 files should be kept separate and not used to overwrite each other.      ***********/

    // Define the webserver and path parameters
      // Main webserver: eg-http://www.your_domain.com -
      // HTTP_SERVER is your Main webserver: eg-http://www.your_domain.com
      // HTTPS_SERVER is your Secure webserver: eg-https://www.your_domain.com
      // HTTP_CATALOG_SERVER is your Main webserver: eg-http://www.your_domain.com
      // HTTPS_CATALOG_SERVER is your Secure webserver: eg-https://www.your_domain.com
      /*
       * URLs for your site will be built via:
       *     HTTP_SERVER plus DIR_WS_ADMIN or
       *     HTTPS_SERVER plus DIR_WS_HTTPS_ADMIN or
       *     HTTP_SERVER plus DIR_WS_CATALOG or
       *     HTTPS_SERVER plus DIR_WS_HTTPS_CATALOG
       * ...depending on your system configuration settings
       *
       * If you desire your *entire* admin to be SSL-protected, make sure you use a "https:" URL for all 4 of the following:
       */
      
    define('HTTP_SERVER''http://www.ourdomain.com');
      
    define('HTTPS_SERVER''https://www.ourdomain.com');
      
    define('HTTP_CATALOG_SERVER''http://www.ourdomain.com');
      
    define('HTTPS_CATALOG_SERVER''https://www.ourdomain.com');

      
    // Use secure webserver for catalog module and/or admin areas?
      
    define('ENABLE_SSL_CATALOG''false');
      
    define('ENABLE_SSL_ADMIN''true');

    // NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes!
    // * DIR_WS_* = Webserver directories (virtual/URL)
      // these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder)
      
    define('DIR_WS_ADMIN''/cart/admin/');
      
    define('DIR_WS_CATALOG''/cart/');
      
    define('DIR_WS_HTTPS_ADMIN''/cart/admin/');
      
    define('DIR_WS_HTTPS_CATALOG''/cart/');

    so since the file structure demands the 2 different folders, and since I did duplicate the /cart into both the public_html and the secure_html, What is the right way for me to configure these files. Currently no one can check out of the cart...

    thanks

  2. #2
    Join Date
    Nov 2004
    Location
    Norfolk, United Kingdom
    Posts
    3,036
    Plugin Contributions
    2

    Default Re: 2 different installs (https and http)

    You use the pathways to the secure folder for the files located in the secure folder e.g. /home/username/secure_html/cart/

    Everything else remains the same.

    Or, alternatively, you could raise a Support Ticket with your hosts and request that they "symlink" the secure folder to the nonsecure folder, and that will save you duplicating your files and having two different sets of config files as well.

    Vger

  3. #3
    Join Date
    Feb 2009
    Posts
    15
    Plugin Contributions
    0

    Default Re: 2 different installs (https and http)

    Pathways? That sounds interesting. Where can i set that?

  4. #4
    Join Date
    Nov 2004
    Location
    Norfolk, United Kingdom
    Posts
    3,036
    Plugin Contributions
    2

    Default Re: 2 different installs (https and http)

    Pathways? That sounds interesting. Where can i set that?
    In your configure.php files, located inside the two 'includes' folders. For example:

    define('DIR_FS_CATALOG', '/home/username/public_html/cart/');
    and:
    define('DIR_FS_CATALOG', '/home/username/secure_html/cart/');

    But the best advice is to get your hosts to symlink the two folders.

    These days there's absolutely no reason why you should have to maintain two sets of files in separate folders. It's handy for the hosting company because you use up twice as much web space and have to upgrade quicker.

    Vger

  5. #5
    Join Date
    Feb 2009
    Posts
    15
    Plugin Contributions
    0

    Default Re: 2 different installs (https and http)

    so I only need to set the 'DIR_FS_CATALOG' directives in both the /includes/configure.php and the admin/includes/configure.php to

    define('DIR_FS_ADMIN', '/home/username/secure_html/cart/admin/');
    define('DIR_FS_CATALOG', '/home/username/public_html/cart/');

    where the username is the unix user. Does that sound correct?

    I'll ask the hosting company tomorrow.... but tonight that simple fix could help a lot.

  6. #6
    Join Date
    Feb 2009
    Posts
    15
    Plugin Contributions
    0

    Default Re: 2 different installs (https and http)

    argg this is not working.

    Code:
    // Define the webserver and path parameters
      // HTTP_SERVER is your Main webserver: eg-http://www.your_domain.com
      // HTTPS_SERVER is your Secure webserver: eg-https://www.your_domain.com
      define('HTTP_SERVER', 'http://www.ourserver.com');
      define('HTTPS_SERVER', 'https://www.ourserver.com');
    
      // Use secure webserver for checkout procedure?
      define('ENABLE_SSL', 'true');
    
    // NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes!
    // * DIR_WS_* = Webserver directories (virtual/URL)
      // these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder)
      define('DIR_WS_CATALOG', '/cart/');
      define('DIR_WS_HTTPS_CATALOG', '/cart/');
    
      define('DIR_WS_IMAGES', 'images/');
      define('DIR_WS_INCLUDES', 'includes/');
      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', DIR_WS_CATALOG . 'pub/');
      define('DIR_WS_TEMPLATES', DIR_WS_INCLUDES . 'templates/');
    
      define('DIR_WS_PHPBB', '/');
    
    // * DIR_FS_* = Filesystem directories (local/physical)
      //the following path is a COMPLETE path to your Zen Cart files. eg: /var/www/vhost/accountname/public_html/store/
      define('DIR_FS_CATALOG', '/home/username/secure_html/cart/');

    what I get is a https://ourdomain.com/cart/admin/login.php and index.php
    but all the links in the admin index all point back to
    http://ourdomain.com/cart/admin/configuration.php?gID=1

    thus it takes me to the

    https://ourdomain.com/cart/admin/login.php

    which again logs me into
    https://ourdomain.com/cart/admin/index.php

    so I can't edit anything. Would someone help me figure out what I'm doing wrong?

  7. #7
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: 2 different installs (https and http)

    Seriously would talk to your host get your host to set the symlink for the two directories, as Vger suggested ...

    Life will be so much better for you as maintaining the duplicate files yourself is a real pain ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  8. #8
    Join Date
    Feb 2009
    Posts
    15
    Plugin Contributions
    0

    Default Re: 2 different installs (https and http)

    What I meant was; I get the:

    https://ourdomain.com/cart/admin/login.php and index.php
    which is SSL but the links in the admin index point back to items like
    http://ourdomain.com/cart/admin/configuration.php?gID=1
    which is not SSL

    thus the configure redirects me again to the

    https://ourdomain.com/cart/admin/login.php

    which again logs me into
    https://ourdomain.com/cart/admin/index.php

    so I can't edit anything. Would someone help me figure out what I'm doing wrong?[/QUOTE]

  9. #9
    Join Date
    Feb 2009
    Posts
    15
    Plugin Contributions
    0

    Default Re: 2 different installs (https and http)

    Hi Ajeh!

    Quote Originally Posted by Ajeh View Post
    Seriously would talk to your host get your host to set the symlink for the two directories, as Vger suggested ...

    Life will be so much better for you as maintaining the duplicate files yourself is a real pain ...
    I have ssh access and can symlink the folders myself. How would one suggest I do so?

    should I:
    >ln -s /home/usename/public_html/cart /home/usename/secure_html/cart

    that doesn't seem to work well and I get a forbidden error from the server.

  10. #10
    Join Date
    Feb 2009
    Posts
    15
    Plugin Contributions
    0

    Default Re: 2 different installs (https and http)

    So a little more information from the hosting company. I symlinked the secure cart to the public cart but I kept getting a forbidden error and the hosting company advised since the Suhosin is installed on the hosted server I needed to alter the .htaccess to allow the symlink

    ok how do I enable ssl for the admin and checkout ?

    I log in to admin SSL but every menu item afterwards seems to not be secure like:

    admin->configuration->My Store
    translates to
    http://ourdomain.com/cart/admin/configuration.php?gID=1

    and thats no longer SSL.
    How do I force it to pre-pend the menu items in the admin/index to ssl pages? like :

    https://ourdomain.com/cart/admin/con...tion.php?gID=1

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v154 How to switch between http and https
    By su35 in forum General Questions
    Replies: 4
    Last Post: 11 Jul 2016, 02:54 PM
  2. switching back and forth between http and https
    By ajmn in forum General Questions
    Replies: 4
    Last Post: 28 Feb 2012, 02:20 AM
  3. HTTP and HTTPS directory separation
    By gsdcypher in forum General Questions
    Replies: 4
    Last Post: 4 Jan 2010, 08:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg