Difference between revisions of "X-Cart:Configuring HTTPS"

From X-Cart 4 Classic
Jump to: navigation, search
(Created page with 'Firstly, you should obtain a SSL certificate. Basically most hosting companies offer help with purchasing SSL certificates or provide their own Shared SSL URLs. If your hosting c…')
 
Line 1: Line 1:
Firstly, you should obtain a SSL certificate. Basically most hosting companies offer help with purchasing SSL certificates or provide their own Shared SSL URLs. If your hosting company doesn't offer you such services you will have to choose a certificate yourself.
+
'''Firstly''', you should obtain a SSL certificate and have it installed and configured on your web-server.
We will be glad to help you with this matter. You can purchase SSL certificates from our company. We sell SSL certificates and TrustLogo seals provided by the world leading Certification Authority Comodo Group http://www.comodogroup.com. For details, conditions and prices please see http://www.x-cart.com/trustlogo.html and http://www.x-cart.com/ssl_certificates.html.
+
 
 +
Basically most hosting companies offer help with purchasing SSL certificates or provide their own Shared SSL URLs. If your hosting company doesn't offer you such services you will have to choose a certificate yourself.
 +
 
 +
We will be glad to help you with this matter. You can purchase SSL certificates from our company. We sell SSL certificates provided by the world leading Certification Authority Comodo Group http://www.comodogroup.com. For details, conditions and prices please see http://www.x-cart.com/ssl_certificates.html.
  
 
If you are on dedicate server we are able to offer you our service to analyze and configure your server and/or install the SSL Certificate. Please note we need have 'root' SSH access or 'Administrator' MS Remote Access Desktop to perform the tasks.
 
If you are on dedicate server we are able to offer you our service to analyze and configure your server and/or install the SSL Certificate. Please note we need have 'root' SSH access or 'Administrator' MS Remote Access Desktop to perform the tasks.
  
To configure HTTPS server in X-Cart, you need modify <xcart_dir>/config.php file:
+
'''Secondly''', once you have the SSL certificate installed and configured, you should configure HTTPS server in X-Cart. To do it, you need modify <xcart_dir>/config.php file, and set the $xcart_https_host variable properly:
  
 
<pre>
 
<pre>
#
+
/**
# X-Cart HTTP & HTTPS host
+
* X-Cart HTTP & HTTPS host and web directory
# and web directory where X-Cart installed
+
*
#
+
* This section defines the location of your X-Cart installation. If X-Cart is
# NOTE:
+
* installed using Web installation, the variables of this section are
# You should put here hostname ONLY without http:// or https:// prefixes
+
* configured via the Installation Wizard. If you install X-Cart manually, use
# Do not put slashes after the hostname
+
* this section to provide your web server details manually.
# Web dir is the directory in the URL, not the filesystem path
+
*
# Web dir must start with slash and have no slash at the end
+
* $xcart_http_host - Host name of the server on which your X-Cart software is
# The only exception is when you configure for the root of the site,
+
* to be installed;
# in which case you write single slash in it
+
* $xcart_https_host - Host name of the secure server that will provide access
#
+
* to your X-Cart-based store via the HTTPS protocol;
# EXAMPLE 1:
+
* $xcart_web_dir - X-Cart web directory.
# $xcart_http_host ="www.yourhost.com";
+
*
# $xcart_https_host ="www.securedirectories.com/yourhost.com";
+
* NOTE:
# $xcart_web_dir ="/xcart";
+
* The variables $xcart_http_host and $xcart_https_host must contain hostnames
# will result in the following URLs:
+
* ONLY (no http:// or https:// prefixes, no trailing slashes).
# http://www.yourhost.com/xcart
+
*
# https://www.securedirectories.com/yourhost.com/xcart
+
* Web dir is the directory where your X-Cart is installed as seen from the Web,
#
+
* not the file system.
# EXAMPLE 2:
+
*
# $xcart_http_host ="www.yourhost.com";
+
* Web dir must start with a slash and have no slash at the end. An exception to
# $xcart_https_host ="www.yourhost.com";
+
* this rule is when you install X-Cart in the site root, in which case you need
# $xcart_web_dir ="/";
+
* to leave the variable empty.
# will result in the following URLs:
+
*
# http://www.yourhost.com/
+
* EXAMPLE 1:
# https://www.yourhost.com/
+
* $xcart_http_host ="www.yourhost.com";
 +
* $xcart_https_host ="www.securedirectories.com/yourhost.com";
 +
* $xcart_web_dir ="/xcart";
 +
* will result in the following URLs:
 +
* http://www.yourhost.com/xcart
 +
* https://www.securedirectories.com/yourhost.com/xcart
 +
*
 +
* EXAMPLE 2:
 +
* $xcart_http_host ="www.yourhost.com";
 +
* $xcart_https_host ="www.yourhost.com";
 +
* $xcart_web_dir ="";
 +
* will result in the following URLs:
 +
* http://www.yourhost.com/
 +
* https://www.yourhost.com/
 +
*/
 
</pre>
 
</pre>
  
If you are going to use secure server you should copy the whole X-Cart directory into HTTPS location (or secure server if it is different from HTTP server), then delete all files and directories from directory <xcart_dir>/templates_c on HTTPS location.
+
'''Thirdly''', if you are going to use secure server you should copy the whole X-Cart directory into HTTPS location (or secure server if it is different from HTTP server), then delete all files and directories from directory <xcart_dir>/var/templates_c on HTTPS location. In case both HTTP and HTTPS locations are located on the same Unix server you should just create symbolic link from HTTPS location to HTTP location of X-Cart. Contact your hosting administrators with this issue.
  
If both HTTP and HTTPS locations are located on the same Unix server you should just create symbolic link from HTTPS location to HTTP location of X-Cart. Contact your hosting administrators with this issue.
+
'''Finally''', you can turn on the following options:
 +
* to set up secure checkout, go to admin area, "Payment methods" page and select HTTPS as protocol for payment methods which you are going to use.
 +
* "Use HTTPS for users' login and registration" ("General settings").
 +
* "Use secure login form on a separate page (HTTPS)" ("General settings").
  
Finally you can turn on the following options:
+
'''Optionally''', if you need secure certain php scripts you should add https scripts to <xcart_dir>/https.php file, 'https_scripts' array.
- to set up secure checkout, go to admin area, "Payment methods" page and select HTTPS as protocol for payment methods which you are going to use
 
- "Use HTTPS for users' login and registration" ("General settings")
 
- "Use secure login form on a separate page (HTTPS)" ("General settings"). If you need secure certain php scripts you should add https scripts to <xcart_dir>/https.php file, 'https_scripts' array.
 
  
If you want to switch the whole x-cart to secure mode edit https.php file. Find the line
+
'''Optionally''', if you want to switch the whole x-cart to secure mode edit https.php file. Find the line
  
 
<pre>
 
<pre>

Revision as of 10:06, 13 December 2010

Firstly, you should obtain a SSL certificate and have it installed and configured on your web-server.

Basically most hosting companies offer help with purchasing SSL certificates or provide their own Shared SSL URLs. If your hosting company doesn't offer you such services you will have to choose a certificate yourself.

We will be glad to help you with this matter. You can purchase SSL certificates from our company. We sell SSL certificates provided by the world leading Certification Authority Comodo Group http://www.comodogroup.com. For details, conditions and prices please see http://www.x-cart.com/ssl_certificates.html.

If you are on dedicate server we are able to offer you our service to analyze and configure your server and/or install the SSL Certificate. Please note we need have 'root' SSH access or 'Administrator' MS Remote Access Desktop to perform the tasks.

Secondly, once you have the SSL certificate installed and configured, you should configure HTTPS server in X-Cart. To do it, you need modify <xcart_dir>/config.php file, and set the $xcart_https_host variable properly:

/**
 * X-Cart HTTP & HTTPS host and web directory
 *
 * This section defines the location of your X-Cart installation. If X-Cart is
 * installed using Web installation, the variables of this section are
 * configured via the Installation Wizard. If you install X-Cart manually, use
 * this section to provide your web server details manually.
 *
 * $xcart_http_host - Host name of the server on which your X-Cart software is
 * to be installed;
 * $xcart_https_host - Host name of the secure server that will provide access
 * to your X-Cart-based store via the HTTPS protocol;
 * $xcart_web_dir - X-Cart web directory.
 *
 * NOTE:
 * The variables $xcart_http_host and $xcart_https_host must contain hostnames
 * ONLY (no http:// or https:// prefixes, no trailing slashes).
 *
 * Web dir is the directory where your X-Cart is installed as seen from the Web,
 * not the file system.
 *
 * Web dir must start with a slash and have no slash at the end. An exception to
 * this rule is when you install X-Cart in the site root, in which case you need
 * to leave the variable empty.
 *
 * EXAMPLE 1:
 * $xcart_http_host ="www.yourhost.com";
 * $xcart_https_host ="www.securedirectories.com/yourhost.com";
 * $xcart_web_dir ="/xcart";
 * will result in the following URLs:
 * http://www.yourhost.com/xcart
 * https://www.securedirectories.com/yourhost.com/xcart
 *
 * EXAMPLE 2:
 * $xcart_http_host ="www.yourhost.com";
 * $xcart_https_host ="www.yourhost.com";
 * $xcart_web_dir ="";
 * will result in the following URLs:
 * http://www.yourhost.com/
 * https://www.yourhost.com/
 */

Thirdly, if you are going to use secure server you should copy the whole X-Cart directory into HTTPS location (or secure server if it is different from HTTP server), then delete all files and directories from directory <xcart_dir>/var/templates_c on HTTPS location. In case both HTTP and HTTPS locations are located on the same Unix server you should just create symbolic link from HTTPS location to HTTP location of X-Cart. Contact your hosting administrators with this issue.

Finally, you can turn on the following options:

  • to set up secure checkout, go to admin area, "Payment methods" page and select HTTPS as protocol for payment methods which you are going to use.
  • "Use HTTPS for users' login and registration" ("General settings").
  • "Use secure login form on a separate page (HTTPS)" ("General settings").

Optionally, if you need secure certain php scripts you should add https scripts to <xcart_dir>/https.php file, 'https_scripts' array.

Optionally, if you want to switch the whole x-cart to secure mode edit https.php file. Find the line

function is_https_link($link, $https_scripts) {

and replace it with

function is_https_link($link, $https_scripts) {
return true;