Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

http and https are on two different machines


tonyk

Recommended Posts

I need to configure ocCommerce so that the catalog runs on one server and the checkout process runs on a secure (SSL) server located on a different physical machine.

 

I currently have osCommerce installed and functioning just fine on the http machine, and I have the complete catalog and admin folders installed on the other SSL server.

 

I modified the configure.php file to point to the SSL server, see below:

 

<?php

/*

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2002 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://mydomain.com'); // eg, http://localhost - should not be NULL for productive servers

define('HTTPS_SERVER', 'https://mydomain.secure.com'); // eg, https://localhost - should not be NULL for productive servers

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

define('DIR_WS_CATALOG', '/catalog/'); // absolute path required

define('DIR_WS_IMAGES', 'images/');

define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');

define('DIR_WS_INCLUDES', 'includes/'); // If "URL fopen wrappers" are enabled in PHP (which they are in the default configuration), this can be a URL instead of a local pathname

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', DIR_WS_CATALOG . 'pub/');

define('DIR_FS_DOCUMENT_ROOT', '/usr/local/etc/httpd/htdocs/mydomaincom');

define('DIR_FS_CATALOG', '/usr/local/etc/httpd/htdocs/mydomaincom/catalog/');

define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

 

// define our database connection

define('DB_SERVER', 'XXXXXXX'); // eg, localhost - should not be NULL for productive servers

define('DB_SERVER_USERNAME', 'XXXXXXX');

define('DB_SERVER_PASSWORD', 'XXXXXXXXX');

define('DB_DATABASE', 'XXXXXXX');

define('USE_PCONNECT', 'false'); // use persistent connections?

define('STORE_SESSIONS', ''); // leave empty '' for default handler or set to 'mysql'

?>

 

 

Here is the configure.php files that is located on the SSL server:

 

<?php

/*

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2002 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://mydomain.com'); // eg, http://localhost - should not be NULL for productive servers

define('HTTPS_SERVER', 'https://mydomain.secure.com'); // eg, https://localhost - should not be NULL for productive servers

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

define('DIR_WS_CATALOG', '/catalog/'); // absolute path required

define('DIR_WS_IMAGES', 'images/');

define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');

define('DIR_WS_INCLUDES', 'includes/'); // If "URL fopen wrappers" are enabled in PHP (which they are in the default configuration), this can be a URL instead of a local pathname

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', DIR_WS_CATALOG . 'pub/');

define('DIR_FS_DOCUMENT_ROOT', '/usr/local/etc/httpd/htdocs/mydomaincom');

define('DIR_FS_CATALOG', '/usr/local/etc/httpd/htdocs/mydomaincom/catalog/');

define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

 

// define our database connection

define('DB_SERVER', 'XXXXXXX'); // eg, localhost - should not be NULL for productive servers

define('DB_SERVER_USERNAME', 'XXXXXXXXX');

define('DB_SERVER_PASSWORD', 'XXXXXXXX');

define('DB_DATABASE', 'XXXXXXXXX');

define('USE_PCONNECT', 'false'); // use persistent connections?

define('STORE_SESSIONS', ''); // leave empty '' for default handler or set to 'mysql'

?>

 

When I go to checkout, the browser goes to the proper location on the https server, but the page that it renders is blank.

 

Does anybody have any ideas?

Link to comment
Share on other sites

The default setting of STORE_SESSIONS file is in /tmp folder. Since you are running on two different machines, you need to set the STORE_SESSIONS to mysql. This means all session info will be store on your MySql db.

 

define('STORE_SESSIONS', 'mysql');

 

Regards,

Bn

Link to comment
Share on other sites

If someone has encountered some of the same problems are has accomplished this particular task (install on the two different machines)...please let me know.

 

PM me, I am stumped and willing to pay for some help. I am still getting the blank page on checkout and can't figure out why.

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

 

I struggled all weekend with the same problem. Finally I got an email from the hosting company support:

 

We have your solution! Your "http" server is running php version 4. Your "https" server was running php version 3. The httpd daemon didn't know how to handle the request, so when you called to anything .php in "https", a blank page was returned... also partly due to the fact that your shopping cart script seems to prefer php version 4 over version 3. Regardless, I've updated your "https" server to run php version 4. The 'blank page' problem is now resolved.

 

It seems to work fine now except that when someone is on the SSL page and then logs in, it takes them back to http and also the images in https are still pointing to the non-ssl paths. Any ideas there?

 

Chris

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...