Skip to content

Installing LiteCommerce from GitHub

beatnbite edited this page Mar 22, 2011 · 15 revisions

Installing LiteCommerce from GitHub

Preparing for installation

First of all, create a GitHub account, Install Git on your computer and create a MySQL database for storing LiteCommerce and Drupal tables. The instructions below assume that Windows users also install TortoiseGit (configure it to use the SSH client provided by Git).

A great tutorial on Git is available at http://progit.org/book/.

Now, there are two ways how you can get LiteCommerce 3 and the Drupal integration module with the theme:

  1. You can download them directly from our GitHub repositories (git://github.com/litecommerce/core.git and git://github.com/litecommerce/drupal.git). Our repositories are read-only, so you won’t be able to push your changes back to GitHub servers.

  2. You can "fork" our repositories into your GitHub account and download LC3 and D7 from there (https://github.com/<username>/core and https://github.com/<username>/drupal). This way, you can publish your changes on GitHub servers and share them with other LC users. Another point is that you can ask us (by submitting a "pull request") to merge your changes into our repositories (for instance, you may have a patch that fixes a LiteCommerce bug).

Note: By proposing changes to our repositories, you grant us the right to use your code in our software (both open-source and proprietary) without any restrictions on your side and any obligations on our side.

Further in the instructions, it is assumed that you work with "forks". If that’s not the case, replace "" with "litecommerce" in the GitHub links.

Linux users: deploying developer LC+Drupal installation

  1. Download and configure LiteCommerce 3: open the console, change to the directory where you will be installing LC3 and Drupal and type the following commands. Depending on your environment, the commands may require you to run them as root (if your are working on a local PC, you may try to switch to the root user by typing "su" and then entering the root password).
    • git clone [email protected]:<username>/core.git xlite
    • By default, this extracts the stable branch ("master") from the repository. If you need the most recent (untested) version, do the following:
      • cd xlite
      • git checkout -b master-dev origin/master-dev
      • cd ..
    • cp xlite/src/etc/config.php xlite/src/etc/config.local.php
    • Now edit the configuration (vi xlite/src/etc/config.local.php) and specify:
      • Your MySQL database settings ("database_details" section)
      • Domain name of your site and path to the "/xlite/src/" directory ("host_details" section)
      • "drupal" ("default" for "master-dev" branch) skin in the "skin_details" section
  2. Download and configure Drupal 7 with the LC integration module/theme: in the console, open the directory where you are installing LC3 and Drupal and type the following commands (again, the commands may require you to run them as root):
    • git clone [email protected]:<username>/drupal.git xlite_cms
    • By default, this extracts the stable branch ("7.x-master") from the repository. If you need the most recent (untested) version, do the following:
      • cd xlite_cms
      • git checkout -b 7.x-master-dev origin/7.x-master-dev
      • cd ..
    • cp xlite_cms/.dev/dev_install.php xlite_cms/dev_install.php
    • cp xlite_cms/sites/default/default.settings.php xlite_cms/sites/default/settings.php
    • Now edit the configuration (vi xlite_cms/sites/default/settings.php) and specify:
      • MySQL database settings, set table prefix to "drupal_" (see the $databases variable). It should be the same database as the one that stores the LC3 tables.
      • URL to the xlite_cms directory (see the $base_url variable)
  3. Make sure the "xlite/src/var" and "xlite_cms/sites" directories have permissions that allow the web server to write files there. It really depends on your server environment, so please ask your server administrator how you can configure the permissions without opening a security breach. If you are installing LC3 on a local PC, which you are never going to use as a production server, you may try setting the 777 permissions on the directory (chmod 777 xlite/src/var xlite_cms/sites) and disabling SELinux (set "SELINUX=disabled" in "/etc/selinux/config" file and reboot). Never disable SELinux on a public server without consulting with your server administrator.
  4. Open the xlite/src directory in the console and run the php -f restoredb demo command there. Make sure the script doesn’t display any errors.
  5. Rebuild a cache of the LC3 classes by opening the http://<your_domain>/<your_path>/xlite/src/cart.php script in a browser.
  6. Now initialize the Drupal database by running the automatic installation script in your browser (the script won’t run correctly if the previous step has failed): http://<your_domain>/<your_path>/xlite_cms/dev_install.php

Windows users: deploying developer LC+Drupal installation

  1. Download and configure LiteCommerce 3:
    • Open the folder, where you will be installing LC3 and Drupal.
    • Right-click on the folder and then select the "Git clone..." item (added by TortoiseGit) on the context menu that appears. Specify "[email protected]:/core.git" as the repository URL and path to the directory where LC is to be downloaded. TortoiseGit automatically appends repository name ("core") to path, so replace the "core" with "xlite". Click the "OK" button to start the process (it may take up to 30-60 minutes, depending on your network bandwidth). By default, it extracts the stable branch ("master"); so, if you need the most recent version, right-click on the "xlite" folder, then select "Switch/Checkout" on the "TortoiseGit" context menu that appears and select the "master-dev" branch.
    • Copy the xlite/src/etc/config.php file to xlite/src/etc/config.local.php, then edit the config.local.php file and specify:
      • Your MySQL database settings ("database_details" section)
      • Domain name of your site and the path to the "xlite/src" directory ("host_details" section)
      • "drupal" skin ("skin_details" section)
  2. Download and configure Drupal 7 with the LC integration module/theme:
    • Open the folder, where you are installing LC3 and Drupal.
    • On the context menu, select "Git clone..." Specify "[email protected]:/drupal.git" as the repository URL and path to the directory, where Drupal is to be downloaded. TortoiseGit automatically appends repository name ("drupal") to path, so replace it with "xlite_cms" and click the "OK" button to start the process. By default, it extracts the stable branch ("7.x-maser"), the most recent untested branch is "7.x-master-dev".
    • Copy xlite_cms/sites/default/default.settings.php to xlite_cms/sites/default/settings.php, then edit settings.php and specify:
      • MySQL database settings, set table prefix to "drupal_" (see the $databases variable).
      • URL to the xlite_cms directory (see the $base_url variable)
  3. Copy xlite_cms/.dev/dev_install.php to the xlite_cms directory.
  4. Create a "restoredb.bat" file in the xlite/src directory, add the "php -f restoredb demo" string and run it. Make sure it doesn’t display any errors.
  5. Rebuild a cache of LC3 classes by opening the http://<your_domain>/<your_path>/xlite/src/cart.php script in a browser.
  6. Now initialize the Drupal database by running the automatic installation script in your browser (the script won’t run correctly if the previous step has failed): http://<your_domain>/<your_path>/xlite_cms/dev_install.php
Clone this wiki locally