comparison docs/installation_win.rst @ 7626:19af3fef3b34 stable

merge default to stable for 0.4.0
author Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
date Sun, 31 Mar 2019 21:28:56 +0200
parents b777b096d9a2 3158cf0dafb7
children ab30729c735c
comparison
equal deleted inserted replaced
7558:fdee9a036bee 7626:19af3fef3b34
1 .. _installation_win: 1 .. _installation_win:
2 2
3 ================================================================ 3 ====================================================
4 Installation and upgrade on Windows (7/Server 2008 R2 and newer) 4 Installation on Windows (7/Server 2008 R2 and newer)
5 ================================================================ 5 ====================================================
6 6
7 7
8 First time install 8 First time install
9 :::::::::::::::::: 9 ------------------
10 10
11 Target OS: Windows 7 and newer or Windows Server 2008 R2 and newer 11 Target OS: Windows 7 and newer or Windows Server 2008 R2 and newer
12 12
13 Tested on Windows 8.1, Windows Server 2008 R2 and Windows Server 2012 13 Tested on Windows 8.1, Windows Server 2008 R2 and Windows Server 2012
14 14
15 To install on an older version of Windows, see `<installation_win_old.html>`_ 15 To install on an older version of Windows, see `<installation_win_old.html>`_
16 16
17 Step 1 -- Install Python 17 Step 1 -- Install Python
18 ------------------------ 18 ^^^^^^^^^^^^^^^^^^^^^^^^
19 19
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. 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 .. warning:: Python 3.x is not supported. 22 .. warning:: Python 3.x is not supported.
23 23
29 While writing this guide, the latest version was v2.7.9. 29 While writing this guide, the latest version was v2.7.9.
30 Remember the specific major and minor versions installed, because they will 30 Remember the specific major and minor versions installed, because they will
31 be needed in the next step. In this case, it is "2.7". 31 be needed in the next step. In this case, it is "2.7".
32 32
33 Step 2 -- Python BIN 33 Step 2 -- Python BIN
34 -------------------- 34 ^^^^^^^^^^^^^^^^^^^^
35 35
36 Add Python BIN folder to the path. This can be done manually (editing 36 Add Python BIN folder to the path. This can be done manually (editing
37 "PATH" environment variable) or by using Windows Support Tools that 37 "PATH" environment variable) or by using Windows Support Tools that
38 come pre-installed in Windows Vista/7 and later. 38 come pre-installed in Windows Vista/7 and later.
39 39
43 43
44 Please substitute [your-python-path] with your Python installation 44 Please substitute [your-python-path] with your Python installation
45 path. Typically this is ``C:\\Python27``. 45 path. Typically this is ``C:\\Python27``.
46 46
47 Step 3 -- Install pywin32 extensions 47 Step 3 -- Install pywin32 extensions
48 ------------------------------------ 48 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
49 49
50 Download pywin32 from: 50 Download pywin32 from:
51 http://sourceforge.net/projects/pywin32/files/ 51 http://sourceforge.net/projects/pywin32/files/
52 52
53 - Click on "pywin32" folder 53 - Click on "pywin32" folder
59 (x64) 59 (x64)
60 http://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/pywin32-219.win32-py2.7.exe/download 60 http://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/pywin32-219.win32-py2.7.exe/download
61 (Win32) 61 (Win32)
62 62
63 Step 4 -- Install pip 63 Step 4 -- Install pip
64 --------------------- 64 ^^^^^^^^^^^^^^^^^^^^^
65 65
66 pip is a package management system for Python. You will need it to install Kallithea and its dependencies. 66 pip is a package management system for Python. You will need it to install Kallithea and its dependencies.
67 67
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). 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
83 open a CMD and type:: 83 open a CMD and type::
84 84
85 SETX PATH "%PATH%;[your-python-path]\Scripts" /M 85 SETX PATH "%PATH%;[your-python-path]\Scripts" /M
86 86
87 Step 5 -- Kallithea folder structure 87 Step 5 -- Kallithea folder structure
88 ------------------------------------ 88 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
89 89
90 Create a Kallithea folder structure. 90 Create a Kallithea folder structure.
91 91
92 This is only an example to install Kallithea. Of course, you can 92 This is only an example to install Kallithea. Of course, you can
93 change it. However, this guide will follow the proposed structure, so 93 change it. However, this guide will follow the proposed structure, so
100 C:\Kallithea\Bin 100 C:\Kallithea\Bin
101 C:\Kallithea\Env 101 C:\Kallithea\Env
102 C:\Kallithea\Repos 102 C:\Kallithea\Repos
103 103
104 Step 6 -- Install virtualenv 104 Step 6 -- Install virtualenv
105 ---------------------------- 105 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
106 106
107 .. note:: 107 .. note::
108 A python virtual environment will allow for isolation between the Python packages of your system and those used for Kallithea. 108 A python virtual environment will allow for isolation between the Python packages of your system and those used for Kallithea.
109 It is strongly recommended to use it to ensure that Kallithea does not change a dependency that other software uses or vice versa. 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
117 To create a virtual environment, run:: 117 To create a virtual environment, run::
118 118
119 virtualenv C:\Kallithea\Env 119 virtualenv C:\Kallithea\Env
120 120
121 Step 7 -- Install Kallithea 121 Step 7 -- Install Kallithea
122 --------------------------- 122 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
123 123
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. 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 Some Python packages use managed code and need to be compiled. 125 Some Python packages use managed code and need to be compiled.
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. 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
132 132
133 In a command prompt type (adapting paths if necessary):: 133 In a command prompt type (adapting paths if necessary)::
134 134
135 cd C:\Kallithea\Env\Scripts 135 cd C:\Kallithea\Env\Scripts
136 activate 136 activate
137 pip install --upgrade pip "setuptools<34" 137 pip install --upgrade pip setuptools
138 138
139 The prompt will change into "(Env) C:\\Kallithea\\Env\\Scripts" or similar 139 The prompt will change into "(Env) C:\\Kallithea\\Env\\Scripts" or similar
140 (depending of your folder structure). Then type:: 140 (depending of your folder structure). Then type::
141 141
142 pip install kallithea 142 pip install kallithea
143 143
144 .. note:: This will take some time. Please wait patiently until it is fully 144 .. note:: This will take some time. Please wait patiently until it is fully
145 complete. Some warnings will appear. Don't worry, they are 145 complete. Some warnings will appear. Don't worry, they are
146 normal. 146 normal.
147 147
148 Step 8 -- Install git (optional) 148 Step 8 -- Install Git (optional)
149 -------------------------------- 149 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
150 150
151 Mercurial being a python package, it was installed automatically when doing "pip install kallithea". 151 Mercurial being a python package, was installed automatically when doing ``pip install kallithea``.
152 152
153 You need to install git manually if you want Kallithea to be able to host git repositories. 153 You need to install Git manually if you want Kallithea to be able to host Git repositories.
154
155 See http://git-scm.com/book/en/v2/Getting-Started-Installing-Git#Installing-on-Windows for instructions. 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 Step 9 -- Configuring Kallithea 159 Step 9 -- Configuring Kallithea
158 ------------------------------- 160 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
159 161
160 Steps taken from `<setup.html>`_ 162 Steps taken from `<setup.html>`_
161 163
162 You have to use the same command prompt as in Step 7, so if you closed 164 You have to use the same command prompt as in Step 7, so if you closed
163 it, reopen it following the same commands (including the "activate" 165 it, reopen it following the same commands (including the "activate"
164 one). When ready, type:: 166 one). When ready, type::
165 167
166 cd C:\Kallithea\Bin 168 cd C:\Kallithea\Bin
167 paster make-config Kallithea production.ini 169 kallithea-cli config-create my.ini
168 170
169 Then you must edit production.ini to fit your needs (IP address, IP 171 Then you must edit my.ini to fit your needs (IP address, IP
170 port, mail settings, database, etc.). `NotePad++`__ or a similar text 172 port, mail settings, database, etc.). `NotePad++`__ or a similar text
171 editor is recommended to properly handle the newline character 173 editor is recommended to properly handle the newline character
172 differences between Unix and Windows. 174 differences between Unix and Windows.
173 175
174 __ http://notepad-plus-plus.org/ 176 __ http://notepad-plus-plus.org/
175 177
176 For the sake of simplicity, run it with the default settings. After your edits (if any) in the previous command prompt, type:: 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 paster setup-db production.ini 180 kallithea-cli db-create -c my.ini
179 181
180 .. warning:: This time a *new* database will be installed. You must 182 .. warning:: This time a *new* database will be installed. You must
181 follow a different step to later *upgrade* to a newer 183 follow a different process to later :ref:`upgrade <upgrade>`
182 Kallithea version) 184 to a newer Kallithea version.
183 185
184 The script will ask you for confirmation about creating a new database, answer yes (y) 186 The script will ask you for confirmation about creating a new database, answer yes (y)
185 187
186 The script will ask you for the repository path, answer C:\\Kallithea\\Repos (or similar). 188 The script will ask you for the repository path, answer C:\\Kallithea\\Repos (or similar).
187 189
189 191
190 The script will ask you for admin mail, answer "admin@xxxx.com" (or whatever you want). 192 The script will ask you for admin mail, answer "admin@xxxx.com" (or whatever you want).
191 193
192 If you make a mistake and the script doesn't end, don't worry: start it again. 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 git, you will get errors about it that you can ignore. 196 If you decided not to install Git, you will get errors about it that you can ignore.
195 197
196 Step 10 -- Running Kallithea 198 Step 10 -- Running Kallithea
197 ---------------------------- 199 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
198 200
199 In the previous command prompt, being in the C:\\Kallithea\\Bin folder, type:: 201 In the previous command prompt, being in the C:\\Kallithea\\Bin folder, type::
200 202
201 paster serve production.ini 203 gearbox serve -c my.ini
202 204
203 Open your web server, and go to http://127.0.0.1:5000 205 Open your web server, and go to http://127.0.0.1:5000
204 206
205 It works!! :-) 207 It works!! :-)
206 208
217 - http://wiki.pylonshq.com/display/pylonscookbook/How+to+run+Pylons+as+a+Windows+service 219 - http://wiki.pylonshq.com/display/pylonscookbook/How+to+run+Pylons+as+a+Windows+service
218 220
219 - Using Apache. You can investigate here: 221 - Using Apache. You can investigate here:
220 222
221 - https://groups.google.com/group/rhodecode/msg/c433074e813ffdc4 223 - https://groups.google.com/group/rhodecode/msg/c433074e813ffdc4
222
223
224 Upgrading
225 :::::::::
226
227 Stop running Kallithea
228 Open a CommandPrompt like in Step 7 (cd to C:\Kallithea\Env\Scripts and activate) and type::
229
230 pip install kallithea --upgrade
231 cd \Kallithea\Bin
232
233 Backup your production.ini file now.
234
235 Then run::
236
237 paster make-config Kallithea production.ini
238
239 Look for changes and update your production.ini accordingly.
240
241 Next, update the database::
242
243 paster upgrade-db production.ini
244
245 More details can be found in `<upgrade.html>`_.