##// END OF EJS Templates
fixed docs
marcink -
r926:344f7485 rhodecode-0.0.1.1.1 default
parent child Browse files
Show More
@@ -1,299 +1,299 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 HTTPS support
160 HTTPS support
161 -------------
161 -------------
162
162
163 There are two ways to enable https, first is to set HTTP_X_URL_SCHEME in
163 There are two ways to enable https, first is to set HTTP_X_URL_SCHEME in
164 Your http server headers, than rhodecode will recognise this headers and make
164 Your http server headers, than rhodecode will recognise this headers and make
165 proper https redirections, another way is to set `force_https = true`
165 proper https redirections, another way is to set `force_https = true`
166 in the ini cofiguration to force using https, no headers are needed than to
166 in the ini cofiguration to force using https, no headers are needed than to
167 enable https
167 enable https
168
168
169
169
170 Nginx virtual host example
170 Nginx virtual host example
171 --------------------------
171 --------------------------
172
172
173 Sample config for nginx using proxy::
173 Sample config for nginx using proxy::
174
174
175 server {
175 server {
176 listen 80;
176 listen 80;
177 server_name hg.myserver.com;
177 server_name hg.myserver.com;
178 access_log /var/log/nginx/rhodecode.access.log;
178 access_log /var/log/nginx/rhodecode.access.log;
179 error_log /var/log/nginx/rhodecode.error.log;
179 error_log /var/log/nginx/rhodecode.error.log;
180 location / {
180 location / {
181 root /var/www/rhodecode/rhodecode/public/;
181 root /var/www/rhodecode/rhodecode/public/;
182 if (!-f $request_filename){
182 if (!-f $request_filename){
183 proxy_pass http://127.0.0.1:5000;
183 proxy_pass http://127.0.0.1:5000;
184 }
184 }
185 #this is important for https !!!
185 #this is important for https !!!
186 proxy_set_header X-Url-Scheme $scheme;
186 proxy_set_header X-Url-Scheme $scheme;
187 include /etc/nginx/proxy.conf;
187 include /etc/nginx/proxy.conf;
188 }
188 }
189 }
189 }
190
190
191 Here's the proxy.conf. It's tuned so it'll not timeout on long
191 Here's the proxy.conf. It's tuned so it'll not timeout on long
192 pushes and also on large pushes::
192 pushes and also on large pushes::
193
193
194 proxy_redirect off;
194 proxy_redirect off;
195 proxy_set_header Host $host;
195 proxy_set_header Host $host;
196 proxy_set_header X-Host $http_host;
196 proxy_set_header X-Host $http_host;
197 proxy_set_header X-Real-IP $remote_addr;
197 proxy_set_header X-Real-IP $remote_addr;
198 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
198 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
199 proxy_set_header Proxy-host $proxy_host;
199 proxy_set_header Proxy-host $proxy_host;
200 client_max_body_size 400m;
200 client_max_body_size 400m;
201 client_body_buffer_size 128k;
201 client_body_buffer_size 128k;
202 proxy_buffering off;
202 proxy_buffering off;
203 proxy_connect_timeout 3600;
203 proxy_connect_timeout 3600;
204 proxy_send_timeout 3600;
204 proxy_send_timeout 3600;
205 proxy_read_timeout 3600;
205 proxy_read_timeout 3600;
206 proxy_buffer_size 8k;
206 proxy_buffer_size 8k;
207 proxy_buffers 8 32k;
207 proxy_buffers 8 32k;
208 proxy_busy_buffers_size 64k;
208 proxy_busy_buffers_size 64k;
209 proxy_temp_file_write_size 64k;
209 proxy_temp_file_write_size 64k;
210
210
211 Also when using root path with nginx You might set the static files to false
211 Also when using root path with nginx You might set the static files to false
212 in production.ini file::
212 in production.ini file::
213
213
214 [app:main]
214 [app:main]
215 use = egg:rhodecode
215 use = egg:rhodecode
216 full_stack = true
216 full_stack = true
217 static_files = false
217 static_files = false
218 lang=en
218 lang=en
219 cache_dir = %(here)s/data
219 cache_dir = %(here)s/data
220
220
221 To not have the statics served by the application. And improve speed.
221 To not have the statics served by the application. And improve speed.
222
222
223
223
224 Apache virtual host example
224 Apache virtual host example
225 ---------------------------
225 ---------------------------
226
226
227 Sample config for apache using proxy::
227 Sample config for apache using proxy::
228
228
229 <VirtualHost *:80>
229 <VirtualHost *:80>
230 ServerName hg.myserver.com
230 ServerName hg.myserver.com
231 ServerAlias hg.myserver.com
231 ServerAlias hg.myserver.com
232
232
233 <Proxy *>
233 <Proxy *>
234 Order allow,deny
234 Order allow,deny
235 Allow from all
235 Allow from all
236 </Proxy>
236 </Proxy>
237
237
238 #important !
238 #important !
239 #Directive to properly generate url (clone url) for pylons
239 #Directive to properly generate url (clone url) for pylons
240 ProxyPreserveHost On
240 ProxyPreserveHost On
241
241
242 #rhodecode instance
242 #rhodecode instance
243 ProxyPass / http://127.0.0.1:5000/
243 ProxyPass / http://127.0.0.1:5000/
244 ProxyPassReverse / http://127.0.0.1:5000/
244 ProxyPassReverse / http://127.0.0.1:5000/
245
245
246 #to enable https use line below
246 #to enable https use line below
247 #SetEnvIf X-Url-Scheme https HTTPS=1
247 #SetEnvIf X-Url-Scheme https HTTPS=1
248
248
249 </VirtualHost>
249 </VirtualHost>
250
250
251
251
252 Additional tutorial
252 Additional tutorial
253 http://wiki.pylonshq.com/display/pylonscookbook/Apache+as+a+reverse+proxy+for+Pylons
253 http://wiki.pylonshq.com/display/pylonscookbook/Apache+as+a+reverse+proxy+for+Pylons
254
254
255
255
256 Apache's example FCGI config
256 Apache's example FCGI config
257 ----------------------------
257 ----------------------------
258
258
259 TODO !
259 TODO !
260
260
261 Other configuration files
261 Other configuration files
262 -------------------------
262 -------------------------
263
263
264 Some extra configuration files and examples can be found here:
264 Some extra configuration files and examples can be found here:
265 http://hg.python-works.com/rhodecode/files/tip/init.d
265 http://hg.python-works.com/rhodecode/files/tip/init.d
266
266
267 and also an celeryconfig file can be use from here:
267 and also an celeryconfig file can be use from here:
268 http://hg.python-works.com/rhodecode/files/tip/celeryconfig.py
268 http://hg.python-works.com/rhodecode/files/tip/celeryconfig.py
269
269
270 Troubleshooting
270 Troubleshooting
271 ---------------
271 ---------------
272
272
273 - missing static files ?
273 - missing static files ?
274
274
275 - make sure either to set the `static_files = true` in the .ini file or
275 - make sure either to set the `static_files = true` in the .ini file or
276 double check the root path for Your http setup. It should point to
276 double check the root path for Your http setup. It should point to
277 for example:
277 for example:
278 /home/my-virtual-python/lib/python2.6/site-packages/rhodecode/public
278 /home/my-virtual-python/lib/python2.6/site-packages/rhodecode/public
279
279
280 - can't install celery/rabbitmq
280 - can't install celery/rabbitmq
281
281
282 - don't worry RhodeCode works without them too. No extra setup required
282 - don't worry RhodeCode works without them too. No extra setup required
283
283
284 - long lasting push timeouts ?
284 - long lasting push timeouts ?
285
285
286 - make sure You set a longer timeouts in Your proxy/fcgi settings, timeouts
286 - make sure You set a longer timeouts in Your proxy/fcgi settings, timeouts
287 are caused by https server and not RhodeCode
287 are caused by https server and not RhodeCode
288
288
289 - large pushes timeouts ?
289 - large pushes timeouts ?
290
290
291 - make sure You set a proper max_body_size for the http server
291 - make sure You set a proper max_body_size for the http server
292
292
293
293
294
294
295 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
295 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
296 .. _python: http://www.python.org/
296 .. _python: http://www.python.org/
297 .. _mercurial: http://mercurial.selenic.com/
297 .. _mercurial: http://mercurial.selenic.com/
298 .. _celery: http://celeryproject.org/
298 .. _celery: http://celeryproject.org/
299 .. _rabbitmq: http://www.rabbitmq.com/ No newline at end of file
299 .. _rabbitmq: http://www.rabbitmq.com/
General Comments 0
You need to be logged in to leave comments. Login now