##// END OF EJS Templates
docs update for celeryd
marcink -
r871:7f9e006a beta
parent child Browse files
Show More
@@ -1,262 +1,268 b''
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
161 .. note::
162 Make sure You run this command from same virtualenv, and with the same user
163 that rhodecode runs.
164
165
160 Nginx virtual host example
166 Nginx virtual host example
161 --------------------------
167 --------------------------
162
168
163 Sample config for nginx using proxy::
169 Sample config for nginx using proxy::
164
170
165 server {
171 server {
166 listen 80;
172 listen 80;
167 server_name hg.myserver.com;
173 server_name hg.myserver.com;
168 access_log /var/log/nginx/rhodecode.access.log;
174 access_log /var/log/nginx/rhodecode.access.log;
169 error_log /var/log/nginx/rhodecode.error.log;
175 error_log /var/log/nginx/rhodecode.error.log;
170 location / {
176 location / {
171 root /var/www/rhodecode/rhodecode/public/;
177 root /var/www/rhodecode/rhodecode/public/;
172 if (!-f $request_filename){
178 if (!-f $request_filename){
173 proxy_pass http://127.0.0.1:5000;
179 proxy_pass http://127.0.0.1:5000;
174 }
180 }
175 #this is important for https !!!
181 #this is important for https !!!
176 proxy_set_header X-Url-Scheme $scheme;
182 proxy_set_header X-Url-Scheme $scheme;
177 include /etc/nginx/proxy.conf;
183 include /etc/nginx/proxy.conf;
178 }
184 }
179 }
185 }
180
186
181 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
182 pushes and also on large pushes::
188 pushes and also on large pushes::
183
189
184 proxy_redirect off;
190 proxy_redirect off;
185 proxy_set_header Host $host;
191 proxy_set_header Host $host;
186 proxy_set_header X-Host $http_host;
192 proxy_set_header X-Host $http_host;
187 proxy_set_header X-Real-IP $remote_addr;
193 proxy_set_header X-Real-IP $remote_addr;
188 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
194 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
189 proxy_set_header Proxy-host $proxy_host;
195 proxy_set_header Proxy-host $proxy_host;
190 client_max_body_size 400m;
196 client_max_body_size 400m;
191 client_body_buffer_size 128k;
197 client_body_buffer_size 128k;
192 proxy_buffering off;
198 proxy_buffering off;
193 proxy_connect_timeout 3600;
199 proxy_connect_timeout 3600;
194 proxy_send_timeout 3600;
200 proxy_send_timeout 3600;
195 proxy_read_timeout 3600;
201 proxy_read_timeout 3600;
196 proxy_buffer_size 8k;
202 proxy_buffer_size 8k;
197 proxy_buffers 8 32k;
203 proxy_buffers 8 32k;
198 proxy_busy_buffers_size 64k;
204 proxy_busy_buffers_size 64k;
199 proxy_temp_file_write_size 64k;
205 proxy_temp_file_write_size 64k;
200
206
201 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
202 in production.ini file::
208 in production.ini file::
203
209
204 [app:main]
210 [app:main]
205 use = egg:rhodecode
211 use = egg:rhodecode
206 full_stack = true
212 full_stack = true
207 static_files = false
213 static_files = false
208 lang=en
214 lang=en
209 cache_dir = %(here)s/data
215 cache_dir = %(here)s/data
210
216
211 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.
212
218
213 Apache reverse proxy
219 Apache reverse proxy
214 --------------------
220 --------------------
215 Tutorial can be found here
221 Tutorial can be found here
216 http://wiki.pylonshq.com/display/pylonscookbook/Apache+as+a+reverse+proxy+for+Pylons
222 http://wiki.pylonshq.com/display/pylonscookbook/Apache+as+a+reverse+proxy+for+Pylons
217
223
218
224
219 Apache's example FCGI config
225 Apache's example FCGI config
220 ----------------------------
226 ----------------------------
221
227
222 TODO !
228 TODO !
223
229
224 Other configuration files
230 Other configuration files
225 -------------------------
231 -------------------------
226
232
227 Some extra configuration files and examples can be found here:
233 Some extra configuration files and examples can be found here:
228 http://hg.python-works.com/rhodecode/files/tip/init.d
234 http://hg.python-works.com/rhodecode/files/tip/init.d
229
235
230 and also an celeryconfig file can be use from here:
236 and also an celeryconfig file can be use from here:
231 http://hg.python-works.com/rhodecode/files/tip/celeryconfig.py
237 http://hg.python-works.com/rhodecode/files/tip/celeryconfig.py
232
238
233 Troubleshooting
239 Troubleshooting
234 ---------------
240 ---------------
235
241
236 - missing static files ?
242 - missing static files ?
237
243
238 - make sure either to set the `static_files = true` in the .ini file or
244 - make sure either to set the `static_files = true` in the .ini file or
239 double check the root path for Your http setup. It should point to
245 double check the root path for Your http setup. It should point to
240 for example:
246 for example:
241 /home/my-virtual-python/lib/python2.6/site-packages/rhodecode/public
247 /home/my-virtual-python/lib/python2.6/site-packages/rhodecode/public
242
248
243 - can't install celery/rabbitmq
249 - can't install celery/rabbitmq
244
250
245 - don't worry RhodeCode works without them too. No extra setup required
251 - don't worry RhodeCode works without them too. No extra setup required
246
252
247 - long lasting push timeouts ?
253 - long lasting push timeouts ?
248
254
249 - make sure You set a longer timeouts in Your proxy/fcgi settings, timeouts
255 - make sure You set a longer timeouts in Your proxy/fcgi settings, timeouts
250 are caused by https server and not RhodeCode
256 are caused by https server and not RhodeCode
251
257
252 - large pushes timeouts ?
258 - large pushes timeouts ?
253
259
254 - make sure You set a proper max_body_size for the http server
260 - make sure You set a proper max_body_size for the http server
255
261
256
262
257
263
258 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
264 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
259 .. _python: http://www.python.org/
265 .. _python: http://www.python.org/
260 .. _mercurial: http://mercurial.selenic.com/
266 .. _mercurial: http://mercurial.selenic.com/
261 .. _celery: http://celeryproject.org/
267 .. _celery: http://celeryproject.org/
262 .. _rabbitmq: http://www.rabbitmq.com/ No newline at end of file
268 .. _rabbitmq: http://www.rabbitmq.com/
General Comments 0
You need to be logged in to leave comments. Login now