installation_win.rst
245 lines
| 8.4 KiB
| text/x-rst
|
RstLexer
/ docs / installation_win.rst
Denis Blanchette
|
r4815 | .. _installation_win: | ||
Mads Kiilerich
|
r5413 | ================================================================ | ||
Denis Blanchette
|
r4815 | Installation and upgrade on Windows (7/Server 2008 R2 and newer) | ||
================================================================ | ||||
Mads Kiilerich
|
r5433 | |||
Denis Blanchette
|
r4815 | First time install | ||
Mads Kiilerich
|
r5568 | ------------------ | ||
Denis Blanchette
|
r4815 | |||
Target OS: Windows 7 and newer or Windows Server 2008 R2 and newer | ||||
Tested on Windows 8.1, Windows Server 2008 R2 and Windows Server 2012 | ||||
To install on an older version of Windows, see `<installation_win_old.html>`_ | ||||
Mads Kiilerich
|
r5435 | Step 1 -- Install Python | ||
Mads Kiilerich
|
r5568 | ^^^^^^^^^^^^^^^^^^^^^^^^ | ||
Denis Blanchette
|
r4815 | |||
Install Python 2.x.y (x = 6 or 7). Latest version is recommended. If you need another version, they can run side by side. | ||||
Michael V. DePalatis
|
r4955 | .. warning:: Python 3.x is not supported. | ||
Denis Blanchette
|
r4815 | |||
- Download Python 2.x.y from http://www.python.org/download/ | ||||
- Choose and click on the version | ||||
- Click on "Windows X86-64 Installer" for x64 or "Windows x86 MSI installer" for Win32. | ||||
- Disable UAC or run the installer with admin privileges. If you chose to disable UAC, do not forget to reboot afterwards. | ||||
Michael V. DePalatis
|
r4955 | While writing this guide, the latest version was v2.7.9. | ||
Denis Blanchette
|
r4815 | Remember the specific major and minor versions installed, because they will | ||
be needed in the next step. In this case, it is "2.7". | ||||
Mads Kiilerich
|
r5435 | Step 2 -- Python BIN | ||
Mads Kiilerich
|
r5568 | ^^^^^^^^^^^^^^^^^^^^ | ||
Denis Blanchette
|
r4815 | |||
Michael V. DePalatis
|
r4955 | Add Python BIN folder to the path. This can be done manually (editing | ||
"PATH" environment variable) or by using Windows Support Tools that | ||||
come pre-installed in Windows Vista/7 and later. | ||||
Denis Blanchette
|
r4815 | |||
Open a CMD and type:: | ||||
SETX PATH "%PATH%;[your-python-path]" /M | ||||
Michael V. DePalatis
|
r4955 | Please substitute [your-python-path] with your Python installation | ||
path. Typically this is ``C:\\Python27``. | ||||
Denis Blanchette
|
r4815 | |||
Mads Kiilerich
|
r5435 | Step 3 -- Install pywin32 extensions | ||
Mads Kiilerich
|
r5568 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
Denis Blanchette
|
r4815 | |||
Download pywin32 from: | ||||
http://sourceforge.net/projects/pywin32/files/ | ||||
- Click on "pywin32" folder | ||||
- Click on the first folder (in this case, Build 219, maybe newer when you try) | ||||
Michael V. DePalatis
|
r4955 | - Choose the file ending with ".amd64-py2.x.exe" (".win32-py2.x.exe" | ||
for Win32) where x is the minor version of Python you installed. | ||||
When writing this guide, the file was: | ||||
http://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/pywin32-219.win-amd64-py2.7.exe/download | ||||
(x64) | ||||
http://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/pywin32-219.win32-py2.7.exe/download | ||||
(Win32) | ||||
Denis Blanchette
|
r4815 | |||
Mads Kiilerich
|
r5435 | Step 4 -- Install pip | ||
Mads Kiilerich
|
r5568 | ^^^^^^^^^^^^^^^^^^^^^ | ||
Denis Blanchette
|
r4815 | |||
pip is a package management system for Python. You will need it to install Kallithea and its dependencies. | ||||
If you installed Python 2.7.9+, you already have it (as long as you ran the installer with admin privileges or disabled UAC). | ||||
If it was not installed or if you are using Python>=2.6,<2.7.9: | ||||
- Go to https://bootstrap.pypa.io | ||||
- Right-click on get-pip.py and choose Saves as... | ||||
Mads Kiilerich
|
r5502 | - Run "python2 get-pip.py" in the folder where you downloaded get-pip.py (may require admin access). | ||
Mads Kiilerich
|
r4902 | |||
Michael V. DePalatis
|
r4955 | .. note:: | ||
Denis Blanchette
|
r4815 | |||
Michael V. DePalatis
|
r4955 | See http://stackoverflow.com/questions/4750806/how-to-install-pip-on-windows | ||
for details and alternative methods. | ||||
Denis Blanchette
|
r4815 | |||
Michael V. DePalatis
|
r4955 | Note that pip.exe will be placed inside your Python installation's | ||
Scripts folder, which is likely not on your path. To correct this, | ||||
open a CMD and type:: | ||||
Denis Blanchette
|
r4815 | |||
SETX PATH "%PATH%;[your-python-path]\Scripts" /M | ||||
Mads Kiilerich
|
r5435 | Step 5 -- Kallithea folder structure | ||
Mads Kiilerich
|
r5568 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
Denis Blanchette
|
r4815 | |||
Create a Kallithea folder structure. | ||||
Michael V. DePalatis
|
r4955 | This is only an example to install Kallithea. Of course, you can | ||
change it. However, this guide will follow the proposed structure, so | ||||
please later adapt the paths if you change them. Folders without | ||||
spaces are recommended. | ||||
Denis Blanchette
|
r4815 | |||
Create the following folder structure:: | ||||
C:\Kallithea | ||||
C:\Kallithea\Bin | ||||
C:\Kallithea\Env | ||||
C:\Kallithea\Repos | ||||
Mads Kiilerich
|
r5435 | Step 6 -- Install virtualenv | ||
Mads Kiilerich
|
r5568 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
Denis Blanchette
|
r4815 | |||
.. note:: | ||||
A python virtual environment will allow for isolation between the Python packages of your system and those used for Kallithea. | ||||
Michael V. DePalatis
|
r4955 | It is strongly recommended to use it to ensure that Kallithea does not change a dependency that other software uses or vice versa. | ||
Denis Blanchette
|
r4815 | |||
In a command prompt type:: | ||||
pip install virtualenv | ||||
Virtualenv will now be inside your Python Scripts path (C:\\Python27\\Scripts or similar). | ||||
To create a virtual environment, run:: | ||||
virtualenv C:\Kallithea\Env | ||||
Mads Kiilerich
|
r5435 | Step 7 -- Install Kallithea | ||
Mads Kiilerich
|
r5568 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
Denis Blanchette
|
r4815 | |||
Michael V. DePalatis
|
r4955 | In order to install Kallithea, you need to be able to run "pip install kallithea". It will use pip to install the Kallithea Python package and its dependencies. | ||
Denis Blanchette
|
r4815 | Some Python packages use managed code and need to be compiled. | ||
This can be done on Linux without any special steps. On Windows, you will need to install Microsoft Visual C++ compiler for Python 2.7. | ||||
Download and install "Microsoft Visual C++ Compiler for Python 2.7" from http://aka.ms/vcpython27 | ||||
.. note:: | ||||
You can also install the dependencies using already compiled Windows binaries packages. A good source of compiled Python packages is http://www.lfd.uci.edu/~gohlke/pythonlibs/. However, not all of the necessary packages for Kallithea are on this site and some are hard to find, so we will stick with using the compiler. | ||||
In a command prompt type (adapting paths if necessary):: | ||||
cd C:\Kallithea\Env\Scripts | ||||
activate | ||||
Mads Kiilerich
|
r5519 | pip install --upgrade pip setuptools | ||
Denis Blanchette
|
r4815 | |||
The prompt will change into "(Env) C:\\Kallithea\\Env\\Scripts" or similar | ||||
(depending of your folder structure). Then type:: | ||||
pip install kallithea | ||||
Michael V. DePalatis
|
r4955 | .. note:: This will take some time. Please wait patiently until it is fully | ||
complete. Some warnings will appear. Don't worry, they are | ||||
normal. | ||||
Denis Blanchette
|
r4815 | |||
Mads Kiilerich
|
r5435 | Step 8 -- Install git (optional) | ||
Mads Kiilerich
|
r5568 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
Michael V. DePalatis
|
r4955 | |||
Denis Blanchette
|
r4815 | Mercurial being a python package, it was installed automatically when doing "pip install kallithea". | ||
You need to install git manually if you want Kallithea to be able to host git repositories. | ||||
See http://git-scm.com/book/en/v2/Getting-Started-Installing-Git#Installing-on-Windows for instructions. | ||||
Mads Kiilerich
|
r5435 | Step 9 -- Configuring Kallithea | ||
Mads Kiilerich
|
r5568 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
Denis Blanchette
|
r4815 | |||
Steps taken from `<setup.html>`_ | ||||
Michael V. DePalatis
|
r4955 | You have to use the same command prompt as in Step 7, so if you closed | ||
it, reopen it following the same commands (including the "activate" | ||||
one). When ready, type:: | ||||
Denis Blanchette
|
r4815 | |||
cd C:\Kallithea\Bin | ||||
paster make-config Kallithea production.ini | ||||
Michael V. DePalatis
|
r4955 | Then you must edit production.ini to fit your needs (IP address, IP | ||
port, mail settings, database, etc.). `NotePad++`__ or a similar text | ||||
editor is recommended to properly handle the newline character | ||||
differences between Unix and Windows. | ||||
Denis Blanchette
|
r4815 | |||
Michael V. DePalatis
|
r4955 | __ http://notepad-plus-plus.org/ | ||
For the sake of simplicity, run it with the default settings. After your edits (if any) in the previous command prompt, type:: | ||||
Denis Blanchette
|
r4815 | |||
paster setup-db production.ini | ||||
Michael V. DePalatis
|
r4955 | .. warning:: This time a *new* database will be installed. You must | ||
follow a different step to later *upgrade* to a newer | ||||
Kallithea version) | ||||
Denis Blanchette
|
r4815 | |||
Michael V. DePalatis
|
r4955 | The script will ask you for confirmation about creating a new database, answer yes (y) | ||
Denis Blanchette
|
r4815 | |||
Michael V. DePalatis
|
r4955 | The script will ask you for the repository path, answer C:\\Kallithea\\Repos (or similar). | ||
Denis Blanchette
|
r4815 | |||
Michael V. DePalatis
|
r4955 | The script will ask you for the admin username and password, answer "admin" + "123456" (or whatever you want) | ||
Denis Blanchette
|
r4815 | |||
Michael V. DePalatis
|
r4955 | The script will ask you for admin mail, answer "admin@xxxx.com" (or whatever you want). | ||
Denis Blanchette
|
r4815 | |||
If you make a mistake and the script doesn't end, don't worry: start it again. | ||||
If you decided not to install git, you will get errors about it that you can ignore. | ||||
Mads Kiilerich
|
r5435 | Step 10 -- Running Kallithea | ||
Mads Kiilerich
|
r5568 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
Denis Blanchette
|
r4815 | |||
In the previous command prompt, being in the C:\\Kallithea\\Bin folder, type:: | ||||
paster serve production.ini | ||||
Open your web server, and go to http://127.0.0.1:5000 | ||||
It works!! :-) | ||||
Remark: | ||||
If it does not work the first time, Ctrl-C the CMD process and start it again. Don't forget the "http://" in Internet Explorer. | ||||
Michael V. DePalatis
|
r4955 | What this guide does not cover: | ||
Denis Blanchette
|
r4815 | |||
- Installing Celery | ||||
- Running Kallithea as a Windows Service. You can investigate here: | ||||
- http://pypi.python.org/pypi/wsgisvc | ||||
- http://ryrobes.com/python/running-python-scripts-as-a-windows-service/ | ||||
- http://wiki.pylonshq.com/display/pylonscookbook/How+to+run+Pylons+as+a+Windows+service | ||||
- Using Apache. You can investigate here: | ||||
- https://groups.google.com/group/rhodecode/msg/c433074e813ffdc4 | ||||
Upgrading | ||||
Mads Kiilerich
|
r5568 | --------- | ||
Denis Blanchette
|
r4815 | |||
Stop running Kallithea | ||||
Open a CommandPrompt like in Step 7 (cd to C:\Kallithea\Env\Scripts and activate) and type:: | ||||
pip install kallithea --upgrade | ||||
cd \Kallithea\Bin | ||||
Backup your production.ini file now. | ||||
Michael V. DePalatis
|
r4955 | Then run:: | ||
Denis Blanchette
|
r4815 | |||
paster make-config Kallithea production.ini | ||||
Look for changes and update your production.ini accordingly. | ||||
Michael V. DePalatis
|
r4955 | Next, update the database:: | ||
Denis Blanchette
|
r4815 | |||
paster upgrade-db production.ini | ||||
Michael V. DePalatis
|
r4955 | More details can be found in `<upgrade.html>`_. | ||