##// 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
11 to do this
12
13 ::
10 First, you will need to create a RhodeCode configuration file. Run the following
11 command to do this::
14 12
15 13 paster make-config RhodeCode production.ini
16 14
17 - This will create `production.ini` config inside the directory
18 this config contains various settings for RhodeCode, e.g proxy port,
15 - This will create the file `production.ini` in the current directory. This
16 configuration file contains the various settings for RhodeCode, e.g proxy port,
19 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)
23 or postgresql. Make sure You properly adjust the db url in the .ini file to use
24 other than the default sqlite database
25
26
27 ::
20 Next, you need to create the databases used by RhodeCode. I recommend that you
21 use sqlite (default) or postgresql. If you choose a database other than the
22 default ensure you properly adjust the db url in your production.ini
23 configuration file to use this other database. Create the databases by running
24 the following command::
28 25
29 26 paster setup-app production.ini
30 27
31 - This command will create all needed tables and an admin account.
32 When asked for a path You can either use a new location of one with already
33 existing ones. RhodeCode will simply add all new found repositories to
34 it's database. Also make sure You specify correct path to repositories.
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.
28 This will prompt you for a "root" path. This "root" path is the location where
29 RhodeCode will store all of its repositories on the current machine. After
30 entering this "root" path ``setup-app`` will also prompt you for a username and password
31 for the initial admin account which ``setup-app`` sets up for you.
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 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 49 127.0.0.1:5000. This ip and port is configurable via the production.ini
48 50 file created in previous step
49 - Use admin account you created to login.
50 - Default permissions on each repository is read, and owner is admin. So
51 remember to update these if needed. In the admin panel You can toggle ldap,
52 anonymous, permissions settings. As well as edit more advanced options on
53 users and repositories
54
51 - Use the admin account you created above when running ``setup-app`` to login to the web app.
52 - The default permissions on each repository is read, and the owner is admin.
53 Remember to update these if needed.
54 - In the admin panel You can toggle ldap, anonymous, permissions settings. As
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.
66
55 67 Using RhodeCode with SSH
56 68 ------------------------
57 69
58 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.
60 This will allow You to use ssh for accessing repositories quite easy. There
71 as the project, when using repository groups, each group is a subdirectory.
72 This will allow you to use ssh for accessing repositories quite easily. There
61 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
64 permission for directories. Secondly when using ssh rhodecode will not
65 authenticate those requests and permissions set by the web interface will not
66 work on the repositories accessed via ssh. There is a solution to this to use
67 auth hooks, that connects to rhodecode db, and runs check functions for
75 You have to make sure that the web-server as well as the ssh users have unix
76 permission for the appropriate directories. Secondly, when using ssh rhodecode
77 will not authenticate those requests and permissions set by the web interface
78 will not work on the repositories accessed via ssh. There is a solution to this
79 to use auth hooks, that connects to rhodecode db, and runs check functions for
68 80 permissions.
69 81
70 82
71 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`
73
74 The command runned should look like this::
83 If your main directory (the same as set in RhodeCode settings) is for example
84 set to **/home/hg** and the repository you are using is named `rhodecode`, then
85 to clone via ssh you should run::
75 86
76 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
79 fully supported.
89 Using external tools such as mercurial server or using ssh key based
90 authentication is fully supported.
80 91
81 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.
85 You have to specify the config file that stores location of index, and
86 location of repositories (`--repo-location`).
95 Starting from version 1.1 the whoosh index can be build by using the paster
96 command ``make-index``. To use ``make-index`` You must specify the configuration
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
89 to enable full index rebuild. Without that indexing will run always in in
90 incremental mode.
100 You may optionally pass the option `-f` to enable a full index rebuild. Without
101 the `-f` option, indexing will run always in "incremental" mode.
91 102
92 incremental mode::
103 For an incremental index build use::
93 104
94 105 paster make-index production.ini --repo-location=<location for repos>
95 106
96 107
97
98 for full index rebuild You can use::
108 For a full index rebuild use::
99 109
100 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 115 It's recommended to do a crontab entry for incremental indexing.
106 An example entry might look like this
107
108 ::
116 An example entry might look like this::
109 117
110 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
113 of each file and add it to reindex if newer file is available. Also indexing
114 daemon checks for removed files and removes them from index.
120 When using incremental mode (the default) whoosh will check the last
121 modification date of each file and add it to be reindexed if a newer file is
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
117 the `-f` flag passed to paster command or, in admin panel You can check
118 `build from scratch` flag.
125 If you want to rebuild index from scratch, you can use the `-f` flag as above,
126 or in the admin panel you can check `build from scratch` flag.
119 127
120 128
121 129 Setting up LDAP support
122 130 -----------------------
123 131
124 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
126 via pypi, so You can install it by running
133 to use LDAP, you have to install python-ldap_ package. This package is available
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 142 pip install python-ldap
135 143
136 144 .. note::
137 python-ldap requires some certain libs on Your system, so before installing
138 it check that You have at least `openldap`, and `sasl` libraries.
145 python-ldap requires some certain libs on your system, so before installing
146 it check that you have at least `openldap`, and `sasl` libraries.
139 147
140 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 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 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 166 to login would go, it allows admins to specify not standard schema for uid
159 167 variable
160 168
161 169 If all data are entered correctly, and `python-ldap` is properly installed
162 170 Users should be granted to access RhodeCode wit ldap accounts. When
163 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 173 already in RhodeCode database ldap user with the same username would be not
166 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 177 information check out the RhodeCode logs,any error messages sent from
170 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 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 200 that rhodecode runs.
193 201
194 202 HTTPS support
195 203 -------------
196 204
197 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 207 proper https redirections, another way is to set `force_https = true`
200 208 in the ini cofiguration to force using https, no headers are needed than to
201 209 enable https
@@ -216,7 +224,7 b' Sample config for nginx using proxy::'
216 224 if (!-f $request_filename){
217 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 228 proxy_set_header X-Url-Scheme $scheme;
221 229 include /etc/nginx/proxy.conf;
222 230 }
@@ -242,7 +250,7 b' pushes and also on large pushes::'
242 250 proxy_busy_buffers_size 64k;
243 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 254 in production.ini file::
247 255
248 256 [app:main]
@@ -299,7 +307,7 b' Apache subdirectory part::'
299 307 SetEnvIf X-Url-Scheme https HTTPS=1
300 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 312 filter-with = proxy-prefix
305 313
@@ -329,7 +337,7 b' Troubleshooting'
329 337 - missing static files ?
330 338
331 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 341 for example:
334 342 /home/my-virtual-python/lib/python2.6/site-packages/rhodecode/public
335 343
@@ -339,16 +347,16 b' Troubleshooting'
339 347
340 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 351 are caused by https server and not RhodeCode
344 352
345 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 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 361 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
354 362 .. _python: http://www.python.org/
General Comments 0
You need to be logged in to leave comments. Login now