X-Cart:Installing X-Cart Manually

From X-Cart 4 Classic
Revision as of 15:02, 20 September 2010 by Ivka (talk | contribs)
Jump to: navigation, search

It is assumed that you are installing X-Cart on a UNIX-based server with terminal access and you have adequate skills in using the basic UNIX commands.

To install X-Cart manually:

1. Download a distribution package from the File Area section of your HelpDesk account at https://secure.qtmsoft.com/ . The package you need is contained in the archive file x-cart-x.y.z.tgz, where x, y and x stand for the X-Cart version.

You can also download an evaluation copy from http://www.x-cart.com/download.html

2. Use an FTP client to upload the archive with the distribution package to a web-accessible directory on your server or your hosting account.

Please make sure that before uploading X-Cart files to the server you set 'Binary' FTP transfer mode in your FTP client. Some of the uploaded files may be damaged if transferred in the 'ASCII'/'Text' mode.

3. Decompress the package using one of the following commands.

gunzip < x-cart-X.Y.Z.tgz | tar -xvf -


tar -xzvf x-cart-X.X.Z.tgz

As a result of extracting files from the archive, you should get the directory /xcart that would contain all X-Cart files and folders. The directory /xcart is created automatically; if necessary, you can rename the directory or move its content to a different location, e.g., your web root. Further in this manual we will refer to the directory with the X-Cart files and folders as the X-Cart root directory, X-Cart installation directory or /xcart directory.

4. Change active directory to the X-Cart root directory.

> cd xcart

5. Set up a MySQL database which you are going to use with X-Cart.

The shell commands listed below use the following abbreviations:

<username> : the username for your MySQL user account;
<password> : the password for your MySQL user account;
<db_host> : the DNS name or the IP-address of your MySQL server;
<db_name> : the name of your MySQL database.
a. Clear all the data which the database might contain, create the required tables and populate them with data.
You can use the following shell commands.
> mysql -u<username> -p<password> -h<db_host> <db_name> < sql/dbclear.sql

> mysql -u<username> -p<password> -h<db_host> <db_name> < sql/xcart_tables.sql

> mysql -u<username> -p<password> -h<db_host> <db_name> < sql/xcart_data.sql

> mysql -u<username> -p<password> -h<db_host> <db_name> < sql/xcart_language_US.sql
b. If you want to test the installed store and import a sample product catalog and other demo data, which is similar to the one you could try with the online demo available at the product website | www.x-cart.com , run the following shell command.
> mysql -u<username> -p<password> -h<db_host> <db_name> < sql/xcart_demo.sql
Later on you will be able to remove the demo data using the Remove data tool available in the Summary/Tools section of the Admin area.
c. If your company is based in a country that has states, or if you are planning to sell internationally and your customers are going to be from countries that have states, you may want to import the names of the states for each of these countries. Later on you will be able use the imported state names for setting up destination zones, your company address and user addresses.
To import the names of the states, run the following shell command
> mysql -u<username> -p<password> -h<db_host> <db_name> < sql/states_<country>.sql
replacing the <country> part with one of the following values:
AT for Austria
AU for Australia
BE for Belgium
CA for Canada
DE for Germany
ES for Spain
FR for France
IT for Italy
LU for Luxemburg
NL for the Netherlands
UK for the United Kingdom
US for the United States.
If a particular country is missing from the list, you will be able to manually add the country and its states later. The instructions on how to carry out this task are available in the States section.
d. For some countries X-Cart enables you to define pre-configured store settings. These settings include generic tax rules and rates, destination zones, default company and customer addresses and phone numbers, language variables which may differ from one country to another (e.g. postal code instead of zip code), etc.

By default, the store is installed with pre-configured settings for the United States. If your store is based in a country other than the United States, you may find it useful to import some pre-configured settings and thus speed up the process of configuring your store.

Currently the settings are available for the following countries: Australia, Canada and the United Kingdom (Great Britain). To import the settings for any of these countries, run the following shell command

> mysql -u<username> -p<password> -h<db_host> <db_name> < sql/xcart_conf_<country>.sql

replacing the <country> part with one of the following values:

AU for Australia
CA for Canada
UK for United Kingdom.

6. Create the required directories and set proper permissions.

a. Set up permissions 777 for directories /files, /catalog and /var.
> chmod 777 files catalog var
b. If you are planning to use the PGP encryption method, create the directory .pgp and set its permissions to 755.
> mkdir .pgp

> chmod 755 .pgp
c. Set permissions to 755 for the script admin/newsletter.sh (The this script is used by the News Management module for sending newsletters).
> chmod 755 admin/newsletter.sh
d. Set permissions to 755 for all the payment modules (files with the *.pl extension inside the payment/ directory).
> chmod 755 payment/*.pl

7. Set up the skin.

a Copy the contents of the directory /skin1_original to the directory /skin1.
> cp -Rp skin1_original/* skin1
This will set up the default interface including the default skin Light & Lucid (2 columns) for the Customer area.
b. If you want to replace the default skin Light & Lucid (2 columns) with one of the alternative skins that come with the X-Cart distribution package, copy the directory with the skin to the directory /skin1. Use the command:
> cp -Rpf schemes/templates/<Skin_name>/* skin1
replacing the <Skin_name> part with one of the following values:
artistictunes_business for Artistic Tunes Business
artistictunes_car_tires for Artistic Tunes Car Tires
artistictunes_fragrances_and_makeup for Artistic Tunes Fragrances and Makeup
artistictunes_water_colour for Artistic Tunes Water Colour
fashion_mosaic_blue for Fashion Mosaic Blue
fashion_mosaic_green for Fashion Mosaic Green
fashion_mosaic_grey for Fashion Mosaic Grey
fashion_mosaic_pink for Fashion Mosaic Pink
light_and_lucid Light & Lucid (3 columns)
neon_lights_flowers for Neon Lights Flowers
neon_lights_household for Neon Lights Household
neon_lights_music for Neon Lights Music
neon_lights_sport for Neon Lights Sports
vivid_dreams_aquamarine for Vivid Dreams Aquamarine
vivid_dreams_chromo for Vivid Dreams Chromo
vivid_dreams_lotus for Vivid Dreams Lotus
vivid_dreams_violet for Vivid Dreams Violet
c. After you have copied the skin files to the directory /skin1, set the permissions of every subdirectory and file inside the directory /skin1 to 777.
> chmod -R 777 skin1
d. To see the changes, clear the directory var/templates_c which contains compiled templates.
> rm -rf var/templates_c

8. Open X-Cart's main configuration file config.php for editing and set the true values for the following variables:

$sql_host =’%SQL_HOST%’;

$sql_user =’%SQL_USER%’;

$sql_db =’%SQL_DB%’;

$sql_password =’%SQL_PASSWORD%’;


$xcart_http_host =”$HTTP_HOST”;

$xcart_https_host =”$HTTP_HOST”;

$xcart_web_dir =”/xcart”;

Blowfish key

To ensure the safety of sensitive data in the database (user info, order details, etc.), X-Cart uses the Blowfish encryption algorithm. Encryption is performed using a special key code. In X-Cart, this code is referred to as Blowfish key. The same code is used to decrypt the data when you or your authorized personnel is trying to access the encrypted data (e.g. when viewing an order in the Admin area).

X-Cart keeps the Blowfish in the main configuration file config.php in the variable $blowfish_key. Before the store is installed, the $blowfish_key variable contains a default value. When you install X-Cart using the Installation Wizard, the installation script install.php generates a new Blowfish key and writes it to the $blowfish_key variable in the config.php file. With manual installation, a new Blowfish key is never generated. And when the installation is complete, the $blowfish_key variable still contains the default value. Using the default Blowfish key is not secure, because its value is known to many people. And you need to generate a new value for the Blowfish key.

To generate a new Blowfish key you should go to the Summary/Tools section of the Admin area and use the Re-generate the Blowfish encryption key tool. For details on how to carry out this task see section X-Cart:Advanced Tools.

If the newly installed store is supposed to use a database that was previously used use by another X-Cart installation, the data in such database is already encrypted by the Blowfish key generated by that store. It means that neither your nor any of your customers will be able even to log in to their accounts, because the value of the variable $blowfish_key is different to the value of the key which was used to encrypt the store database. To resolve this issue, you need to open the main configuration file config.php for editing and change the value of the variable $blowfish_key to the value of the Blowfish key that was used by the previous X-Cart installation.