##// END OF EJS Templates
- First cut at some documentation corrections.
jfh -
r1089:fd4cd3c1 default
parent child Browse files
Show More
@@ -4,126 +4,134 b' Setup'
4 =====
4 =====
5
5
6
6
7 Setting up the application
7 Setting up RhodeCode
8 --------------------------
8 --------------------------
9
9
10 First You'll need to create RhodeCode config file. Run the following command
10 First, you will need to create a RhodeCode configuration file. Run the following
11 to do this
11 command to do this::
12
13 ::
14
12
15 paster make-config RhodeCode production.ini
13 paster make-config RhodeCode production.ini
16
14
17 - This will create `production.ini` config inside the directory
15 - This will create the file `production.ini` in the current directory. This
18 this config contains various settings for RhodeCode, e.g proxy port,
16 configuration file contains the various settings for RhodeCode, e.g proxy port,
19 email settings, usage of static files, cache, celery settings and logging.
17 email settings, usage of static files, cache, celery settings and logging.
20
18
21
19
22 Next we need to create the database. I'll recommend to use sqlite (default)
20 Next, you need to create the databases used by RhodeCode. I recommend that you
23 or postgresql. Make sure You properly adjust the db url in the .ini file to use
21 use sqlite (default) or postgresql. If you choose a database other than the
24 other than the default sqlite database
22 default ensure you properly adjust the db url in your production.ini
25
23 configuration file to use this other database. Create the databases by running
26
24 the following command::
27 ::
28
25
29 paster setup-app production.ini
26 paster setup-app production.ini
30
27
31 - This command will create all needed tables and an admin account.
28 This will prompt you for a "root" path. This "root" path is the location where
32 When asked for a path You can either use a new location of one with already
29 RhodeCode will store all of its repositories on the current machine. After
33 existing ones. RhodeCode will simply add all new found repositories to
30 entering this "root" path ``setup-app`` will also prompt you for a username and password
34 it's database. Also make sure You specify correct path to repositories.
31 for the initial admin account which ``setup-app`` sets up for you.
35 - Remember that the given path for mercurial_ repositories must be write
36 accessible for the application. It's very important since RhodeCode web
37 interface will work even without such an access but, when trying to do a
38 push it'll eventually fail with permission denied errors.
39
32
40 You are ready to use RhodeCode, to run it simply execute
33 - The ``setup-app`` command will create all of the needed tables and an admin
34 account. When choosing a root path You can either use a new empty location, or a
35 location which already contains existing repositories. If you choose a location
36 which contains existing repositories RhodeCode will simply add all of the
37 repositories at the chosen location to it's database. (Note: make sure you
38 specify the correct path to the root).
39 - Note: the given path for mercurial_ repositories **must** be write accessible
40 for the application. It's very important since the RhodeCode web interface will
41 work without write access, but when trying to do a push it will eventually fail
42 with permission denied errors unless it has write access.
41
43
42 ::
44 You are now ready to use RhodeCode, to run it simply execute::
43
45
44 paster serve production.ini
46 paster serve production.ini
45
47
46 - This command runs the RhodeCode server the app should be available at the
48 - This command runs the RhodeCode server. The web app should be available at the
47 127.0.0.1:5000. This ip and port is configurable via the production.ini
49 127.0.0.1:5000. This ip and port is configurable via the production.ini
48 file created in previous step
50 file created in previous step
49 - Use admin account you created to login.
51 - Use the admin account you created above when running ``setup-app`` to login to the web app.
50 - Default permissions on each repository is read, and owner is admin. So
52 - The default permissions on each repository is read, and the owner is admin.
51 remember to update these if needed. In the admin panel You can toggle ldap,
53 Remember to update these if needed.
52 anonymous, permissions settings. As well as edit more advanced options on
54 - In the admin panel You can toggle ldap, anonymous, permissions settings. As
53 users and repositories
55 well as edit more advanced options on users and repositories
56
57 Try copying your own mercurial repository into the "root" directory you are
58 using, then from within the RhodeCode web application choose Admin >
59 repositories. Then choose Add New Repository. Add the repository you copied into
60 the root. Test that you can browse your repository from within RhodCode and then
61 try cloning your repository from RhodeCode with::
62
63 hg clone http://127.0.0.1:5000/<repository name>
64
65 where *repository name* is replaced by the name of your repository.
54
66
55 Using RhodeCode with SSH
67 Using RhodeCode with SSH
56 ------------------------
68 ------------------------
57
69
58 RhodeCode repository structures are kept in directories with the same name
70 RhodeCode repository structures are kept in directories with the same name
59 as the project, when using repository groups, each group is a a subdirectory.
71 as the project, when using repository groups, each group is a subdirectory.
60 This will allow You to use ssh for accessing repositories quite easy. There
72 This will allow you to use ssh for accessing repositories quite easily. There
61 are some exceptions when using ssh for accessing repositories.
73 are some exceptions when using ssh for accessing repositories.
62
74
63 You have to make sure that the webserver as well as the ssh users have unix
75 You have to make sure that the web-server as well as the ssh users have unix
64 permission for directories. Secondly when using ssh rhodecode will not
76 permission for the appropriate directories. Secondly, when using ssh rhodecode
65 authenticate those requests and permissions set by the web interface will not
77 will not authenticate those requests and permissions set by the web interface
66 work on the repositories accessed via ssh. There is a solution to this to use
78 will not work on the repositories accessed via ssh. There is a solution to this
67 auth hooks, that connects to rhodecode db, and runs check functions for
79 to use auth hooks, that connects to rhodecode db, and runs check functions for
68 permissions.
80 permissions.
69
81
70
82
71 if Your main directory (the same as set in RhodeCode settings) is for example
83 If your main directory (the same as set in RhodeCode settings) is for example
72 set for to **/home/hg** and repository You are using is `rhodecode`
84 set to **/home/hg** and the repository you are using is named `rhodecode`, then
73
85 to clone via ssh you should run::
74 The command runned should look like this::
75
86
76 hg clone ssh://user@server.com/home/hg/rhodecode
87 hg clone ssh://user@server.com/home/hg/rhodecode
77
88
78 Using external tools such as mercurial server or using ssh key based auth is
89 Using external tools such as mercurial server or using ssh key based
79 fully supported.
90 authentication is fully supported.
80
91
81 Setting up Whoosh full text search
92 Setting up Whoosh full text search
82 ----------------------------------
93 ----------------------------------
83
94
84 Starting from version 1.1 whoosh index can be build using paster command.
95 Starting from version 1.1 the whoosh index can be build by using the paster
85 You have to specify the config file that stores location of index, and
96 command ``make-index``. To use ``make-index`` You must specify the configuration
86 location of repositories (`--repo-location`).
97 file that stores the location of the index, and the location of the repositories
98 (`--repo-location`).
87
99
88 There is possible also to pass `-f` to the options
100 You may optionally pass the option `-f` to enable a full index rebuild. Without
89 to enable full index rebuild. Without that indexing will run always in in
101 the `-f` option, indexing will run always in "incremental" mode.
90 incremental mode.
91
102
92 incremental mode::
103 For an incremental index build use::
93
104
94 paster make-index production.ini --repo-location=<location for repos>
105 paster make-index production.ini --repo-location=<location for repos>
95
106
96
107
97
108 For a full index rebuild use::
98 for full index rebuild You can use::
99
109
100 paster make-index production.ini -f --repo-location=<location for repos>
110 paster make-index production.ini -f --repo-location=<location for repos>
101
111
102 - For full text search You can either put crontab entry for
112 - For full text search you can either put crontab entry for
103
113
104 In order to do periodical index builds and keep Your index always up to date.
114 In order to do periodical index builds and keep your index always up to date.
105 It's recommended to do a crontab entry for incremental indexing.
115 It's recommended to do a crontab entry for incremental indexing.
106 An example entry might look like this
116 An example entry might look like this::
107
108 ::
109
117
110 /path/to/python/bin/paster /path/to/rhodecode/production.ini --repo-location=<location for repos>
118 /path/to/python/bin/paster /path/to/rhodecode/production.ini --repo-location=<location for repos>
111
119
112 When using incremental (default) mode whoosh will check last modification date
120 When using incremental mode (the default) whoosh will check the last
113 of each file and add it to reindex if newer file is available. Also indexing
121 modification date of each file and add it to be reindexed if a newer file is
114 daemon checks for removed files and removes them from index.
122 available. The indexing daemon checks for any removed files and removes them
123 from index.
115
124
116 Sometime You might want to rebuild index from scratch. You can do that using
125 If you want to rebuild index from scratch, you can use the `-f` flag as above,
117 the `-f` flag passed to paster command or, in admin panel You can check
126 or in the admin panel you can check `build from scratch` flag.
118 `build from scratch` flag.
119
127
120
128
121 Setting up LDAP support
129 Setting up LDAP support
122 -----------------------
130 -----------------------
123
131
124 RhodeCode starting from version 1.1 supports ldap authentication. In order
132 RhodeCode starting from version 1.1 supports ldap authentication. In order
125 to use LDAP, You have to install python-ldap_ package. This package is available
133 to use LDAP, you have to install python-ldap_ package. This package is available
126 via pypi, so You can install it by running
134 via pypi, so you can install it by running
127
135
128 ::
136 ::
129
137
@@ -134,8 +142,8 b' via pypi, so You can install it by runni'
134 pip install python-ldap
142 pip install python-ldap
135
143
136 .. note::
144 .. note::
137 python-ldap requires some certain libs on Your system, so before installing
145 python-ldap requires some certain libs on your system, so before installing
138 it check that You have at least `openldap`, and `sasl` libraries.
146 it check that you have at least `openldap`, and `sasl` libraries.
139
147
140 ldap settings are located in admin->ldap section,
148 ldap settings are located in admin->ldap section,
141
149
@@ -151,21 +159,21 b" Here's a typical ldap setup::"
151
159
152
160
153 `Account` and `Password` are optional, and used for two-phase ldap
161 `Account` and `Password` are optional, and used for two-phase ldap
154 authentication so those are credentials to access Your ldap, if it doesn't
162 authentication so those are credentials to access your ldap, if it doesn't
155 support anonymous search/user lookups.
163 support anonymous search/user lookups.
156
164
157 Base DN must have %(user)s template inside, it's a placer where Your uid used
165 Base DN must have %(user)s template inside, it's a placer where your uid used
158 to login would go, it allows admins to specify not standard schema for uid
166 to login would go, it allows admins to specify not standard schema for uid
159 variable
167 variable
160
168
161 If all data are entered correctly, and `python-ldap` is properly installed
169 If all data are entered correctly, and `python-ldap` is properly installed
162 Users should be granted to access RhodeCode wit ldap accounts. When
170 Users should be granted to access RhodeCode wit ldap accounts. When
163 logging at the first time an special ldap account is created inside RhodeCode,
171 logging at the first time an special ldap account is created inside RhodeCode,
164 so You can control over permissions even on ldap users. If such user exists
172 so you can control over permissions even on ldap users. If such user exists
165 already in RhodeCode database ldap user with the same username would be not
173 already in RhodeCode database ldap user with the same username would be not
166 able to access RhodeCode.
174 able to access RhodeCode.
167
175
168 If You have problems with ldap access and believe You entered correct
176 If you have problems with ldap access and believe you entered correct
169 information check out the RhodeCode logs,any error messages sent from
177 information check out the RhodeCode logs,any error messages sent from
170 ldap will be saved there.
178 ldap will be saved there.
171
179
@@ -188,14 +196,14 b' In order to make start using celery run:'
188
196
189
197
190 .. note::
198 .. note::
191 Make sure You run this command from same virtualenv, and with the same user
199 Make sure you run this command from same virtualenv, and with the same user
192 that rhodecode runs.
200 that rhodecode runs.
193
201
194 HTTPS support
202 HTTPS support
195 -------------
203 -------------
196
204
197 There are two ways to enable https, first is to set HTTP_X_URL_SCHEME in
205 There are two ways to enable https, first is to set HTTP_X_URL_SCHEME in
198 Your http server headers, than rhodecode will recognise this headers and make
206 your http server headers, than rhodecode will recognise this headers and make
199 proper https redirections, another way is to set `force_https = true`
207 proper https redirections, another way is to set `force_https = true`
200 in the ini cofiguration to force using https, no headers are needed than to
208 in the ini cofiguration to force using https, no headers are needed than to
201 enable https
209 enable https
@@ -216,7 +224,7 b' Sample config for nginx using proxy::'
216 if (!-f $request_filename){
224 if (!-f $request_filename){
217 proxy_pass http://127.0.0.1:5000;
225 proxy_pass http://127.0.0.1:5000;
218 }
226 }
219 #this is important if You want to use https !!!
227 #this is important if you want to use https !!!
220 proxy_set_header X-Url-Scheme $scheme;
228 proxy_set_header X-Url-Scheme $scheme;
221 include /etc/nginx/proxy.conf;
229 include /etc/nginx/proxy.conf;
222 }
230 }
@@ -242,7 +250,7 b' pushes and also on large pushes::'
242 proxy_busy_buffers_size 64k;
250 proxy_busy_buffers_size 64k;
243 proxy_temp_file_write_size 64k;
251 proxy_temp_file_write_size 64k;
244
252
245 Also when using root path with nginx You might set the static files to false
253 Also when using root path with nginx you might set the static files to false
246 in production.ini file::
254 in production.ini file::
247
255
248 [app:main]
256 [app:main]
@@ -299,7 +307,7 b' Apache subdirectory part::'
299 SetEnvIf X-Url-Scheme https HTTPS=1
307 SetEnvIf X-Url-Scheme https HTTPS=1
300 </Location>
308 </Location>
301
309
302 Besides the regular apache setup You'll need to add such part to .ini file::
310 Besides the regular apache setup you will need to add such part to .ini file::
303
311
304 filter-with = proxy-prefix
312 filter-with = proxy-prefix
305
313
@@ -329,7 +337,7 b' Troubleshooting'
329 - missing static files ?
337 - missing static files ?
330
338
331 - make sure either to set the `static_files = true` in the .ini file or
339 - make sure either to set the `static_files = true` in the .ini file or
332 double check the root path for Your http setup. It should point to
340 double check the root path for your http setup. It should point to
333 for example:
341 for example:
334 /home/my-virtual-python/lib/python2.6/site-packages/rhodecode/public
342 /home/my-virtual-python/lib/python2.6/site-packages/rhodecode/public
335
343
@@ -339,16 +347,16 b' Troubleshooting'
339
347
340 - long lasting push timeouts ?
348 - long lasting push timeouts ?
341
349
342 - make sure You set a longer timeouts in Your proxy/fcgi settings, timeouts
350 - make sure you set a longer timeouts in your proxy/fcgi settings, timeouts
343 are caused by https server and not RhodeCode
351 are caused by https server and not RhodeCode
344
352
345 - large pushes timeouts ?
353 - large pushes timeouts ?
346
354
347 - make sure You set a proper max_body_size for the http server
355 - make sure you set a proper max_body_size for the http server
348
356
349 - Apache doesn't pass basicAuth on pull/push ?
357 - Apache doesn't pass basicAuth on pull/push ?
350
358
351 - Make sure You added `WSGIPassAuthorization true`
359 - Make sure you added `WSGIPassAuthorization true`
352
360
353 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
361 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
354 .. _python: http://www.python.org/
362 .. _python: http://www.python.org/
General Comments 0
You need to be logged in to leave comments. Login now