##// END OF EJS Templates
merge
marcink -
r882:ec8262ba merge beta
parent child Browse files
Show More
@@ -1,268 +1,294
1 .. _setup:
1 .. _setup:
2
2
3 Setup
3 Setup
4 =====
4 =====
5
5
6
6
7 Setting up the application
7 Setting up the application
8 --------------------------
8 --------------------------
9
9
10 First You'll ned to create RhodeCode config file. Run the following command
10 First You'll ned to create RhodeCode config file. Run the following command
11 to do this
11 to do this
12
12
13 ::
13 ::
14
14
15 paster make-config RhodeCode production.ini
15 paster make-config RhodeCode production.ini
16
16
17 - This will create `production.ini` config inside the directory
17 - This will create `production.ini` config inside the directory
18 this config contains various settings for RhodeCode, e.g proxy port,
18 this config contains various settings for RhodeCode, e.g proxy port,
19 email settings, usage of static files, cache, celery settings and logging.
19 email settings, usage of static files, cache, celery settings and logging.
20
20
21
21
22
22
23 Next we need to create the database.
23 Next we need to create the database.
24
24
25 ::
25 ::
26
26
27 paster setup-app production.ini
27 paster setup-app production.ini
28
28
29 - This command will create all needed tables and an admin account.
29 - This command will create all needed tables and an admin account.
30 When asked for a path You can either use a new location of one with already
30 When asked for a path You can either use a new location of one with already
31 existing ones. RhodeCode will simply add all new found repositories to
31 existing ones. RhodeCode will simply add all new found repositories to
32 it's database. Also make sure You specify correct path to repositories.
32 it's database. Also make sure You specify correct path to repositories.
33 - Remember that the given path for mercurial_ repositories must be write
33 - Remember that the given path for mercurial_ repositories must be write
34 accessible for the application. It's very important since RhodeCode web
34 accessible for the application. It's very important since RhodeCode web
35 interface will work even without such an access but, when trying to do a
35 interface will work even without such an access but, when trying to do a
36 push it'll eventually fail with permission denied errors.
36 push it'll eventually fail with permission denied errors.
37
37
38 You are ready to use rhodecode, to run it simply execute
38 You are ready to use rhodecode, to run it simply execute
39
39
40 ::
40 ::
41
41
42 paster serve production.ini
42 paster serve production.ini
43
43
44 - This command runs the RhodeCode server the app should be available at the
44 - This command runs the RhodeCode server the app should be available at the
45 127.0.0.1:5000. This ip and port is configurable via the production.ini
45 127.0.0.1:5000. This ip and port is configurable via the production.ini
46 file created in previous step
46 file created in previous step
47 - Use admin account you created to login.
47 - Use admin account you created to login.
48 - Default permissions on each repository is read, and owner is admin. So
48 - Default permissions on each repository is read, and owner is admin. So
49 remember to update these if needed. In the admin panel You can toggle ldap,
49 remember to update these if needed. In the admin panel You can toggle ldap,
50 anonymous, permissions settings. As well as edit more advanced options on
50 anonymous, permissions settings. As well as edit more advanced options on
51 users and repositories
51 users and repositories
52
52
53
53
54 Setting up Whoosh full text search
54 Setting up Whoosh full text search
55 ----------------------------------
55 ----------------------------------
56
56
57 Index for whoosh can be build starting from version 1.1 using paster command
57 Index for whoosh can be build starting from version 1.1 using paster command
58 passing repo locations to index, as well as Your config file that stores
58 passing repo locations to index, as well as Your config file that stores
59 whoosh index files locations. There is possible to pass `-f` to the options
59 whoosh index files locations. There is possible to pass `-f` to the options
60 to enable full index rebuild. Without that indexing will run always in in
60 to enable full index rebuild. Without that indexing will run always in in
61 incremental mode.
61 incremental mode.
62
62
63 ::
63 ::
64
64
65 paster make-index production.ini --repo-location=<location for repos>
65 paster make-index production.ini --repo-location=<location for repos>
66
66
67 for full index rebuild You can use
67 for full index rebuild You can use
68
68
69 ::
69 ::
70
70
71 paster make-index production.ini -f --repo-location=<location for repos>
71 paster make-index production.ini -f --repo-location=<location for repos>
72
72
73 - For full text search You can either put crontab entry for
73 - For full text search You can either put crontab entry for
74
74
75 This command can be run even from crontab in order to do periodical
75 This command can be run even from crontab in order to do periodical
76 index builds and keep Your index always up to date. An example entry might
76 index builds and keep Your index always up to date. An example entry might
77 look like this
77 look like this
78
78
79 ::
79 ::
80
80
81 /path/to/python/bin/paster /path/to/rhodecode/production.ini --repo-location=<location for repos>
81 /path/to/python/bin/paster /path/to/rhodecode/production.ini --repo-location=<location for repos>
82
82
83 When using incremental(default) mode whoosh will check last modification date
83 When using incremental(default) mode whoosh will check last modification date
84 of each file and add it to reindex if newer file is available. Also indexing
84 of each file and add it to reindex if newer file is available. Also indexing
85 daemon checks for removed files and removes them from index.
85 daemon checks for removed files and removes them from index.
86
86
87 Sometime You might want to rebuild index from scratch. You can do that using
87 Sometime You might want to rebuild index from scratch. You can do that using
88 the `-f` flag passed to paster command or, in admin panel You can check
88 the `-f` flag passed to paster command or, in admin panel You can check
89 `build from scratch` flag.
89 `build from scratch` flag.
90
90
91
91
92 Setting up LDAP support
92 Setting up LDAP support
93 -----------------------
93 -----------------------
94
94
95 RhodeCode starting from version 1.1 supports ldap authentication. In order
95 RhodeCode starting from version 1.1 supports ldap authentication. In order
96 to use ldap, You have to install python-ldap package. This package is available
96 to use ldap, You have to install python-ldap package. This package is available
97 via pypi, so You can install it by running
97 via pypi, so You can install it by running
98
98
99 ::
99 ::
100
100
101 easy_install python-ldap
101 easy_install python-ldap
102
102
103 ::
103 ::
104
104
105 pip install python-ldap
105 pip install python-ldap
106
106
107 .. note::
107 .. note::
108 python-ldap requires some certain libs on Your system, so before installing
108 python-ldap requires some certain libs on Your system, so before installing
109 it check that You have at least `openldap`, and `sasl` libraries.
109 it check that You have at least `openldap`, and `sasl` libraries.
110
110
111 ldap settings are located in admin->ldap section,
111 ldap settings are located in admin->ldap section,
112
112
113 Here's a typical ldap setup::
113 Here's a typical ldap setup::
114
114
115 Enable ldap = checked #controls if ldap access is enabled
115 Enable ldap = checked #controls if ldap access is enabled
116 Host = host.domain.org #actual ldap server to connect
116 Host = host.domain.org #actual ldap server to connect
117 Port = 389 or 689 for ldaps #ldap server ports
117 Port = 389 or 689 for ldaps #ldap server ports
118 Enable LDAPS = unchecked #enable disable ldaps
118 Enable LDAPS = unchecked #enable disable ldaps
119 Account = <account> #access for ldap server(if required)
119 Account = <account> #access for ldap server(if required)
120 Password = <password> #password for ldap server(if required)
120 Password = <password> #password for ldap server(if required)
121 Base DN = uid=%(user)s,CN=users,DC=host,DC=domain,DC=org
121 Base DN = uid=%(user)s,CN=users,DC=host,DC=domain,DC=org
122
122
123
123
124 `Account` and `Password` are optional, and used for two-phase ldap
124 `Account` and `Password` are optional, and used for two-phase ldap
125 authentication so those are credentials to access Your ldap, if it doesn't
125 authentication so those are credentials to access Your ldap, if it doesn't
126 support anonymous search/user lookups.
126 support anonymous search/user lookups.
127
127
128 Base DN must have %(user)s template inside, it's a placer where Your uid used
128 Base DN must have %(user)s template inside, it's a placer where Your uid used
129 to login would go, it allows admins to specify not standard schema for uid
129 to login would go, it allows admins to specify not standard schema for uid
130 variable
130 variable
131
131
132 If all data are entered correctly, and `python-ldap` is properly installed
132 If all data are entered correctly, and `python-ldap` is properly installed
133 Users should be granted to access RhodeCode wit ldap accounts. When
133 Users should be granted to access RhodeCode wit ldap accounts. When
134 logging at the first time an special ldap account is created inside RhodeCode,
134 logging at the first time an special ldap account is created inside RhodeCode,
135 so You can control over permissions even on ldap users. If such user exists
135 so You can control over permissions even on ldap users. If such user exists
136 already in RhodeCode database ldap user with the same username would be not
136 already in RhodeCode database ldap user with the same username would be not
137 able to access RhodeCode.
137 able to access RhodeCode.
138
138
139 If You have problems with ldap access and believe You entered correct
139 If You have problems with ldap access and believe You entered correct
140 information check out the RhodeCode logs,any error messages sent from
140 information check out the RhodeCode logs,any error messages sent from
141 ldap will be saved there.
141 ldap will be saved there.
142
142
143
143
144
144
145 Setting Up Celery
145 Setting Up Celery
146 -----------------
146 -----------------
147
147
148 Since version 1.1 celery is configured by the rhodecode ini configuration files
148 Since version 1.1 celery is configured by the rhodecode ini configuration files
149 simply set use_celery=true in the ini file then add / change the configuration
149 simply set use_celery=true in the ini file then add / change the configuration
150 variables inside the ini file.
150 variables inside the ini file.
151
151
152 Remember that the ini files uses format with '.' not with '_' like celery
152 Remember that the ini files uses format with '.' not with '_' like celery
153 so for example setting `BROKER_HOST` in celery means setting `broker.host` in
153 so for example setting `BROKER_HOST` in celery means setting `broker.host` in
154 the config file.
154 the config file.
155
155
156 In order to make start using celery run::
156 In order to make start using celery run::
157 paster celeryd <configfile.ini>
157 paster celeryd <configfile.ini>
158
158
159
159
160
160
161 .. note::
161 .. note::
162 Make sure You run this command from same virtualenv, and with the same user
162 Make sure You run this command from same virtualenv, and with the same user
163 that rhodecode runs.
163 that rhodecode runs.
164
164
165
165
166 Nginx virtual host example
166 Nginx virtual host example
167 --------------------------
167 --------------------------
168
168
169 Sample config for nginx using proxy::
169 Sample config for nginx using proxy::
170
170
171 server {
171 server {
172 listen 80;
172 listen 80;
173 server_name hg.myserver.com;
173 server_name hg.myserver.com;
174 access_log /var/log/nginx/rhodecode.access.log;
174 access_log /var/log/nginx/rhodecode.access.log;
175 error_log /var/log/nginx/rhodecode.error.log;
175 error_log /var/log/nginx/rhodecode.error.log;
176 location / {
176 location / {
177 root /var/www/rhodecode/rhodecode/public/;
177 root /var/www/rhodecode/rhodecode/public/;
178 if (!-f $request_filename){
178 if (!-f $request_filename){
179 proxy_pass http://127.0.0.1:5000;
179 proxy_pass http://127.0.0.1:5000;
180 }
180 }
181 #this is important for https !!!
181 #this is important if You want to use https !!!
182 proxy_set_header X-Url-Scheme $scheme;
182 proxy_set_header X-Url-Scheme $scheme;
183 include /etc/nginx/proxy.conf;
183 include /etc/nginx/proxy.conf;
184 }
184 }
185 }
185 }
186
186
187 Here's the proxy.conf. It's tuned so it'll not timeout on long
187 Here's the proxy.conf. It's tuned so it'll not timeout on long
188 pushes and also on large pushes::
188 pushes and also on large pushes::
189
189
190 proxy_redirect off;
190 proxy_redirect off;
191 proxy_set_header Host $host;
191 proxy_set_header Host $host;
192 proxy_set_header X-Host $http_host;
192 proxy_set_header X-Host $http_host;
193 proxy_set_header X-Real-IP $remote_addr;
193 proxy_set_header X-Real-IP $remote_addr;
194 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
194 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
195 proxy_set_header Proxy-host $proxy_host;
195 proxy_set_header Proxy-host $proxy_host;
196 client_max_body_size 400m;
196 client_max_body_size 400m;
197 client_body_buffer_size 128k;
197 client_body_buffer_size 128k;
198 proxy_buffering off;
198 proxy_buffering off;
199 proxy_connect_timeout 3600;
199 proxy_connect_timeout 3600;
200 proxy_send_timeout 3600;
200 proxy_send_timeout 3600;
201 proxy_read_timeout 3600;
201 proxy_read_timeout 3600;
202 proxy_buffer_size 8k;
202 proxy_buffer_size 8k;
203 proxy_buffers 8 32k;
203 proxy_buffers 8 32k;
204 proxy_busy_buffers_size 64k;
204 proxy_busy_buffers_size 64k;
205 proxy_temp_file_write_size 64k;
205 proxy_temp_file_write_size 64k;
206
206
207 Also when using root path with nginx You might set the static files to false
207 Also when using root path with nginx You might set the static files to false
208 in production.ini file::
208 in production.ini file::
209
209
210 [app:main]
210 [app:main]
211 use = egg:rhodecode
211 use = egg:rhodecode
212 full_stack = true
212 full_stack = true
213 static_files = false
213 static_files = false
214 lang=en
214 lang=en
215 cache_dir = %(here)s/data
215 cache_dir = %(here)s/data
216
216
217 To not have the statics served by the application. And improve speed.
217 To not have the statics served by the application. And improve speed.
218
218
219 Apache reverse proxy
219
220 --------------------
220 Apache virtual host example
221 Tutorial can be found here
221 ---------------------------
222
223 Sample config for apache using proxy::
224
225 <VirtualHost *:80>
226 ServerName hg.myserver.com
227 ServerAlias hg.myserver.com
228
229 <Proxy *>
230 Order allow,deny
231 Allow from all
232 </Proxy>
233
234 #important !
235 #Directive to properly generate url (clone url) for pylons
236 ProxyPreserveHost On
237
238 #rhodecode instance
239 ProxyPass / http://127.0.0.1:5000/
240 ProxyPassReverse / http://127.0.0.1:5000/
241
242 #to enable https use line below
243 #SetEnvIf X-Url-Scheme https HTTPS=1
244
245 </VirtualHost>
246
247
248 Additional tutorial
222 http://wiki.pylonshq.com/display/pylonscookbook/Apache+as+a+reverse+proxy+for+Pylons
249 http://wiki.pylonshq.com/display/pylonscookbook/Apache+as+a+reverse+proxy+for+Pylons
223
250
224
251
225 Apache's example FCGI config
252 Apache's example FCGI config
226 ----------------------------
253 ----------------------------
227
254
228 TODO !
255 TODO !
229
256
230 Other configuration files
257 Other configuration files
231 -------------------------
258 -------------------------
232
259
233 Some extra configuration files and examples can be found here:
260 Some example init.d script can be found here, for debian and gentoo:
234 http://hg.python-works.com/rhodecode/files/tip/init.d
235
261
236 and also an celeryconfig file can be use from here:
262 https://rhodeocode.org/rhodecode/files/tip/init.d
237 http://hg.python-works.com/rhodecode/files/tip/celeryconfig.py
263
238
264
239 Troubleshooting
265 Troubleshooting
240 ---------------
266 ---------------
241
267
242 - missing static files ?
268 - missing static files ?
243
269
244 - make sure either to set the `static_files = true` in the .ini file or
270 - make sure either to set the `static_files = true` in the .ini file or
245 double check the root path for Your http setup. It should point to
271 double check the root path for Your http setup. It should point to
246 for example:
272 for example:
247 /home/my-virtual-python/lib/python2.6/site-packages/rhodecode/public
273 /home/my-virtual-python/lib/python2.6/site-packages/rhodecode/public
248
274
249 - can't install celery/rabbitmq
275 - can't install celery/rabbitmq
250
276
251 - don't worry RhodeCode works without them too. No extra setup required
277 - don't worry RhodeCode works without them too. No extra setup required
252
278
253 - long lasting push timeouts ?
279 - long lasting push timeouts ?
254
280
255 - make sure You set a longer timeouts in Your proxy/fcgi settings, timeouts
281 - make sure You set a longer timeouts in Your proxy/fcgi settings, timeouts
256 are caused by https server and not RhodeCode
282 are caused by https server and not RhodeCode
257
283
258 - large pushes timeouts ?
284 - large pushes timeouts ?
259
285
260 - make sure You set a proper max_body_size for the http server
286 - make sure You set a proper max_body_size for the http server
261
287
262
288
263
289
264 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
290 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
265 .. _python: http://www.python.org/
291 .. _python: http://www.python.org/
266 .. _mercurial: http://mercurial.selenic.com/
292 .. _mercurial: http://mercurial.selenic.com/
267 .. _celery: http://celeryproject.org/
293 .. _celery: http://celeryproject.org/
268 .. _rabbitmq: http://www.rabbitmq.com/ No newline at end of file
294 .. _rabbitmq: http://www.rabbitmq.com/
General Comments 0
You need to be logged in to leave comments. Login now