Skip to content

Latest commit

 

History

History
126 lines (66 loc) · 8.16 KB

INSTALL.md

File metadata and controls

126 lines (66 loc) · 8.16 KB

Installation overview

You will be completing the following steps:

  1. Install Python version 2.6 or 2.7
  2. Install git
  3. Download the KA Lite codebase using git
  4. Run the setup script to complete configuration
  5. Run the server

Jump to below for Windows installation instructions or Mac OS X installation instructions.

Installing on Linux

1. Install Python

Almost all popular versions of Linux come with Python already installed. To ensure that it is a usable version, run python -V from the command line, and ensure that the version number starts with 2.6, or 2.7.

If Python is not installed, install it by running sudo apt-get install python or the equivalent command in your distribution's package manager.

2. Install git

Install git by running sudo apt-get install git-core or the equivalent command in your distribution's package manager.

3. Download KA Lite

Clone the repository into a directory of your choice. Use cd to navigate into the target directory, and then run the command below (the files will be put into a subdirectory of your current directory named ka-lite):

git clone --recursive https://github.com/jamalex/ka-lite.git

(The --recursive is required because it includes khan-exercises as a git submodule.)

4. Run the setup script

Inside the ka-lite directory (that you cloned above) you should find a script called setup_linux.sh. Use cd ka-lite to navigate into the directory, and run this script using ./setup_linux.sh to initialize the server database.

5. Run the server

(If you're installing the server to test/develop, rather than deploy, follow the development instructions instead.)

To start the server, run the start.sh script in the ka-lite directory.

You may want to have this script run automatically when you start the computer. If you are running Ubuntu or another Debian variant, the setup script should have given you the option of setting the server to run automatically in the background when the computer boots. If you skipped this step, you can do it later by running sudo ./runatboot.sh from inside the ka-lite/kalite directory.

The local KA Lite website should now be accessible at http://127.0.0.1:8008/ (replace 127.0.0.1 with your computer's external ip address or domain to access it from another connected computer).

Installing on Windows

1. Install Python

Install Python (version 2.6 or 2.7), if not already installed (download Python 2.7). On 32-bit Windows, use the x86 MSI Installer, and on 64-bit Windows, use the X86-64 MSI Installer.

You will need Python to be on your system PATH, so that it can be run from the command prompt (cmd.exe); see this video about adding Python to the PATH (note that this is for version 2.7; just adapt the paths for older versions). It may be good to add ;C:\Python27\;C:\Python27\Scripts to your path, instead of just ;C:\Python27\ as recommended in the video.

2. Install git

Install the latest version of git for Windows, using all the default options EXCEPT be sure to choose the "Run Git from the Windows Command Prompt" (middle) option on the "Adjusting your PATH environment" page (KA Lite needs to have git accessible on the PATH for updating purposes).

3. Download KA Lite

Clone the repository into a folder of your choice. Load cmd.exe, and use cd to navigate into the target folder (e.g. to put the files in a folder called ka-lite on your Desktop, type cd Desktop), and then run:

git clone --recursive https://github.com/jamalex/ka-lite.git

If you get the message 'git' is not recognized as an internal or external command, operable program or batch file., this means git was not added to your PATH. In this case, you can either uninstall git and then re-follow the git installation instructions above, or add the git bin folder to your PATH -- use C:\Program Files\git\bin (or maybe C:\Program Files (x86)\git\bin) as the path.

(The --recursive is required because it includes khan-exercises as a git submodule.)

4. Run the setup script

Inside the ka-lite folder (that you cloned above) you should find a script called setup_windows.bat. Double-click this script to run it, which will initialize the server database.

5. Run the server

(If you're installing the server to test/develop, rather than deploy, follow the development instructions instead.)

To start the server, double-click the start.bat script in the ka-lite folder.

You may want to have this script run automatically when you start the computer, by creating a shortcut to start.bat and copying it to the Startup folder in the Start Menu -- the installation script should also have given you the option of having this done automatically.

If at any point you see a "Windows Security Alert" warning about Windows Firewall blocking Python, be sure to check both checkboxes (as seen in the picture) and click "Allow access", to ensure that the server will be accessible.

The local KA Lite website should now be accessible at http://127.0.0.1:8008/ (replace 127.0.0.1 with your computer's external ip address or domain to access it from another connected computer).

Installing on Mac OS X

1. Install Python

Python comes pre-installed on Mac OS X, but due to Apple's release cycle, it's often one or even two years old. To check that you have got a usable version, run python -V from the command line (in Terminal from Applications/Utilities), and ensure that the version number starts with 2.6, or 2.7. If it is not a usable version (download Python 2.7). On 32-bit or 64-bit non PPC Mac OS X 10.6 or higher, use the 64-bit/32-bit x86-64/i386 Installer, and on PPC or 32-bit i386 Mac OS X 10.3-10.6, use the 32-bit i386/PPC Installer.

2. Install git

Install the latest version of Git for OS X.

3. Download KA Lite

Clone the repository into a directory of your choice. Use cd to navigate into the target directory (the files will be put into a subdirectory of your current directory named ka-lite), and then run:

git clone --recursive https://github.com/jamalex/ka-lite.git

(The --recursive is required because it includes khan-exercises as a git submodule.)

4. Run the setup script

Inside the ka-lite directory (that you cloned above) you should find a script called setup_mac.command. Double-click that script to run it, which will initialize the server database.

5. Run the server

(If you're installing the server to test/develop, rather than deploy, follow the development instructions instead.)

To start the server, double-click the start.command script in the ka-lite directory.

The local KA Lite website should now be accessible at http://127.0.0.1:8008/ (replace 127.0.0.1 with your computer's external ip address or domain to access it from another connected computer).

Optional: Install and configure Apache/mod_wsgi

KA Lite includes a web server implemented in pure Python for serving the website, capable of handling hundreds of simultaneous users while using very little memory. However, if for some reason you wish to serve the website through Apache and mod_wsgi, here are some useful Apache setup tips.