Show More
@@ -1,221 +1,223 b'' | |||
|
1 | 1 | .. _installation_win: |
|
2 | 2 | |
|
3 | 3 | ==================================================== |
|
4 | 4 | Installation on Windows (7/Server 2008 R2 and newer) |
|
5 | 5 | ==================================================== |
|
6 | 6 | |
|
7 | 7 | |
|
8 | 8 | First time install |
|
9 | 9 | ------------------ |
|
10 | 10 | |
|
11 | 11 | Target OS: Windows 7 and newer or Windows Server 2008 R2 and newer |
|
12 | 12 | |
|
13 | 13 | Tested on Windows 8.1, Windows Server 2008 R2 and Windows Server 2012 |
|
14 | 14 | |
|
15 | 15 | To install on an older version of Windows, see `<installation_win_old.html>`_ |
|
16 | 16 | |
|
17 | 17 | Step 1 -- Install Python |
|
18 | 18 | ^^^^^^^^^^^^^^^^^^^^^^^^ |
|
19 | 19 | |
|
20 | 20 | Install Python 2.x.y (x = 6 or 7). Latest version is recommended. If you need another version, they can run side by side. |
|
21 | 21 | |
|
22 | 22 | .. warning:: Python 3.x is not supported. |
|
23 | 23 | |
|
24 | 24 | - Download Python 2.x.y from http://www.python.org/download/ |
|
25 | 25 | - Choose and click on the version |
|
26 | 26 | - Click on "Windows X86-64 Installer" for x64 or "Windows x86 MSI installer" for Win32. |
|
27 | 27 | - Disable UAC or run the installer with admin privileges. If you chose to disable UAC, do not forget to reboot afterwards. |
|
28 | 28 | |
|
29 | 29 | While writing this guide, the latest version was v2.7.9. |
|
30 | 30 | Remember the specific major and minor versions installed, because they will |
|
31 | 31 | be needed in the next step. In this case, it is "2.7". |
|
32 | 32 | |
|
33 | 33 | Step 2 -- Python BIN |
|
34 | 34 | ^^^^^^^^^^^^^^^^^^^^ |
|
35 | 35 | |
|
36 | 36 | Add Python BIN folder to the path. This can be done manually (editing |
|
37 | 37 | "PATH" environment variable) or by using Windows Support Tools that |
|
38 | 38 | come pre-installed in Windows Vista/7 and later. |
|
39 | 39 | |
|
40 | 40 | Open a CMD and type:: |
|
41 | 41 | |
|
42 | 42 | SETX PATH "%PATH%;[your-python-path]" /M |
|
43 | 43 | |
|
44 | 44 | Please substitute [your-python-path] with your Python installation |
|
45 | 45 | path. Typically this is ``C:\\Python27``. |
|
46 | 46 | |
|
47 | 47 | Step 3 -- Install pywin32 extensions |
|
48 | 48 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
|
49 | 49 | |
|
50 | 50 | Download pywin32 from: |
|
51 | 51 | http://sourceforge.net/projects/pywin32/files/ |
|
52 | 52 | |
|
53 | 53 | - Click on "pywin32" folder |
|
54 | 54 | - Click on the first folder (in this case, Build 219, maybe newer when you try) |
|
55 | 55 | - Choose the file ending with ".amd64-py2.x.exe" (".win32-py2.x.exe" |
|
56 | 56 | for Win32) where x is the minor version of Python you installed. |
|
57 | 57 | When writing this guide, the file was: |
|
58 | 58 | http://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/pywin32-219.win-amd64-py2.7.exe/download |
|
59 | 59 | (x64) |
|
60 | 60 | http://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/pywin32-219.win32-py2.7.exe/download |
|
61 | 61 | (Win32) |
|
62 | 62 | |
|
63 | 63 | Step 4 -- Install pip |
|
64 | 64 | ^^^^^^^^^^^^^^^^^^^^^ |
|
65 | 65 | |
|
66 | 66 | pip is a package management system for Python. You will need it to install Kallithea and its dependencies. |
|
67 | 67 | |
|
68 | 68 | If you installed Python 2.7.9+, you already have it (as long as you ran the installer with admin privileges or disabled UAC). |
|
69 | 69 | |
|
70 | 70 | If it was not installed or if you are using Python>=2.6,<2.7.9: |
|
71 | 71 | |
|
72 | 72 | - Go to https://bootstrap.pypa.io |
|
73 | 73 | - Right-click on get-pip.py and choose Saves as... |
|
74 | 74 | - Run "python2 get-pip.py" in the folder where you downloaded get-pip.py (may require admin access). |
|
75 | 75 | |
|
76 | 76 | .. note:: |
|
77 | 77 | |
|
78 | 78 | See http://stackoverflow.com/questions/4750806/how-to-install-pip-on-windows |
|
79 | 79 | for details and alternative methods. |
|
80 | 80 | |
|
81 | 81 | Note that pip.exe will be placed inside your Python installation's |
|
82 | 82 | Scripts folder, which is likely not on your path. To correct this, |
|
83 | 83 | open a CMD and type:: |
|
84 | 84 | |
|
85 | 85 | SETX PATH "%PATH%;[your-python-path]\Scripts" /M |
|
86 | 86 | |
|
87 | 87 | Step 5 -- Kallithea folder structure |
|
88 | 88 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
|
89 | 89 | |
|
90 | 90 | Create a Kallithea folder structure. |
|
91 | 91 | |
|
92 | 92 | This is only an example to install Kallithea. Of course, you can |
|
93 | 93 | change it. However, this guide will follow the proposed structure, so |
|
94 | 94 | please later adapt the paths if you change them. Folders without |
|
95 | 95 | spaces are recommended. |
|
96 | 96 | |
|
97 | 97 | Create the following folder structure:: |
|
98 | 98 | |
|
99 | 99 | C:\Kallithea |
|
100 | 100 | C:\Kallithea\Bin |
|
101 | 101 | C:\Kallithea\Env |
|
102 | 102 | C:\Kallithea\Repos |
|
103 | 103 | |
|
104 | 104 | Step 6 -- Install virtualenv |
|
105 | 105 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
|
106 | 106 | |
|
107 | 107 | .. note:: |
|
108 | 108 | A python virtual environment will allow for isolation between the Python packages of your system and those used for Kallithea. |
|
109 | 109 | It is strongly recommended to use it to ensure that Kallithea does not change a dependency that other software uses or vice versa. |
|
110 | 110 | |
|
111 | 111 | In a command prompt type:: |
|
112 | 112 | |
|
113 | 113 | pip install virtualenv |
|
114 | 114 | |
|
115 | 115 | Virtualenv will now be inside your Python Scripts path (C:\\Python27\\Scripts or similar). |
|
116 | 116 | |
|
117 | 117 | To create a virtual environment, run:: |
|
118 | 118 | |
|
119 | 119 | virtualenv C:\Kallithea\Env |
|
120 | 120 | |
|
121 | 121 | Step 7 -- Install Kallithea |
|
122 | 122 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
|
123 | 123 | |
|
124 | 124 | 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. |
|
125 | 125 | Some Python packages use managed code and need to be compiled. |
|
126 | 126 | 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. |
|
127 | 127 | |
|
128 | 128 | Download and install "Microsoft Visual C++ Compiler for Python 2.7" from http://aka.ms/vcpython27 |
|
129 | 129 | |
|
130 | 130 | .. note:: |
|
131 | 131 | 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. |
|
132 | 132 | |
|
133 | 133 | In a command prompt type (adapting paths if necessary):: |
|
134 | 134 | |
|
135 | 135 | cd C:\Kallithea\Env\Scripts |
|
136 | 136 | activate |
|
137 | 137 | pip install --upgrade pip setuptools |
|
138 | 138 | |
|
139 | 139 | The prompt will change into "(Env) C:\\Kallithea\\Env\\Scripts" or similar |
|
140 | 140 | (depending of your folder structure). Then type:: |
|
141 | 141 | |
|
142 | 142 | pip install kallithea |
|
143 | 143 | |
|
144 | 144 | .. note:: This will take some time. Please wait patiently until it is fully |
|
145 | 145 | complete. Some warnings will appear. Don't worry, they are |
|
146 | 146 | normal. |
|
147 | 147 | |
|
148 |
Step 8 -- Install |
|
|
148 | Step 8 -- Install Git (optional) | |
|
149 | 149 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
|
150 | 150 | |
|
151 |
Mercurial being a python package, |
|
|
151 | Mercurial being a python package, was installed automatically when doing ``pip install kallithea``. | |
|
152 | 152 | |
|
153 |
You need to install |
|
|
154 | ||
|
153 | You need to install Git manually if you want Kallithea to be able to host Git repositories. | |
|
155 | 154 | See http://git-scm.com/book/en/v2/Getting-Started-Installing-Git#Installing-on-Windows for instructions. |
|
155 | The location of the Git binaries (like ``c:\path\to\git\bin``) must be | |
|
156 | added to the ``PATH`` environment variable so ``git.exe`` and other tools like | |
|
157 | ``gzip.exe`` are available. | |
|
156 | 158 | |
|
157 | 159 | Step 9 -- Configuring Kallithea |
|
158 | 160 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
|
159 | 161 | |
|
160 | 162 | Steps taken from `<setup.html>`_ |
|
161 | 163 | |
|
162 | 164 | You have to use the same command prompt as in Step 7, so if you closed |
|
163 | 165 | it, reopen it following the same commands (including the "activate" |
|
164 | 166 | one). When ready, type:: |
|
165 | 167 | |
|
166 | 168 | cd C:\Kallithea\Bin |
|
167 | 169 | paster make-config Kallithea production.ini |
|
168 | 170 | |
|
169 | 171 | Then you must edit production.ini to fit your needs (IP address, IP |
|
170 | 172 | port, mail settings, database, etc.). `NotePad++`__ or a similar text |
|
171 | 173 | editor is recommended to properly handle the newline character |
|
172 | 174 | differences between Unix and Windows. |
|
173 | 175 | |
|
174 | 176 | __ http://notepad-plus-plus.org/ |
|
175 | 177 | |
|
176 | 178 | For the sake of simplicity, run it with the default settings. After your edits (if any) in the previous command prompt, type:: |
|
177 | 179 | |
|
178 | 180 | paster setup-db production.ini |
|
179 | 181 | |
|
180 | 182 | .. warning:: This time a *new* database will be installed. You must |
|
181 | 183 | follow a different process to later :ref:`upgrade <upgrade>` |
|
182 | 184 | to a newer Kallithea version. |
|
183 | 185 | |
|
184 | 186 | The script will ask you for confirmation about creating a new database, answer yes (y) |
|
185 | 187 | |
|
186 | 188 | The script will ask you for the repository path, answer C:\\Kallithea\\Repos (or similar). |
|
187 | 189 | |
|
188 | 190 | The script will ask you for the admin username and password, answer "admin" + "123456" (or whatever you want) |
|
189 | 191 | |
|
190 | 192 | The script will ask you for admin mail, answer "admin@xxxx.com" (or whatever you want). |
|
191 | 193 | |
|
192 | 194 | If you make a mistake and the script doesn't end, don't worry: start it again. |
|
193 | 195 | |
|
194 |
If you decided not to install |
|
|
196 | If you decided not to install Git, you will get errors about it that you can ignore. | |
|
195 | 197 | |
|
196 | 198 | Step 10 -- Running Kallithea |
|
197 | 199 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
|
198 | 200 | |
|
199 | 201 | In the previous command prompt, being in the C:\\Kallithea\\Bin folder, type:: |
|
200 | 202 | |
|
201 | 203 | paster serve production.ini |
|
202 | 204 | |
|
203 | 205 | Open your web server, and go to http://127.0.0.1:5000 |
|
204 | 206 | |
|
205 | 207 | It works!! :-) |
|
206 | 208 | |
|
207 | 209 | Remark: |
|
208 | 210 | 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. |
|
209 | 211 | |
|
210 | 212 | What this guide does not cover: |
|
211 | 213 | |
|
212 | 214 | - Installing Celery |
|
213 | 215 | - Running Kallithea as a Windows Service. You can investigate here: |
|
214 | 216 | |
|
215 | 217 | - http://pypi.python.org/pypi/wsgisvc |
|
216 | 218 | - http://ryrobes.com/python/running-python-scripts-as-a-windows-service/ |
|
217 | 219 | - http://wiki.pylonshq.com/display/pylonscookbook/How+to+run+Pylons+as+a+Windows+service |
|
218 | 220 | |
|
219 | 221 | - Using Apache. You can investigate here: |
|
220 | 222 | |
|
221 | 223 | - https://groups.google.com/group/rhodecode/msg/c433074e813ffdc4 |
General Comments 0
You need to be logged in to leave comments.
Login now