aboutsummaryrefslogtreecommitdiff
path: root/INSTALL
blob: 8e539657fdf63da7942c61af76cabe43a6ea0301 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
RhodeCode Installation and Setup
================================

RhodeCode is an open soruce git hosting solution written in Python. Linaro
uses its own RhodeCode instance to server git repositories.

Installation
============

TL;DR
-----

There is a script that can automate all the installation and setup process:

* Download the 'rhodecode-config' branch from git.linaro.org
* Move into the 'rhodecode-config' directory
* Modify the file 'config/production.ini' changing at least the PostreSQL
 password at the following line:
 sqlalchemy.db1.url = postgresql://rhodecode:XXXX@localhost/rhodecode
* Run the following command inserting the correct values:
python scritps/rhodecode-setup --rhodecode-config config/production.ini \
--rhodecode-admin-email $EMAIL --rhodecode-admin-pwd $ADMIN_PWD --assume-yes \
--rabbitmq-pwd $PWD --postgres-role-pwd $PWD

The above command will install all the necessary depencencies and setup RhodeCode
with the default provided values. At the end, the script will print all the
installation details.

Dependencies
------------

 * apache2
 * build-essential
 * git-core
 * mercurial (v2.4.1, not in Ubuntu repositories, need to install via pip)
 * pgadmin3
 * postgresql-9.1
 * postgresql-server-dev-9.1
 * python
 * python-babel
 * python-bcrypt
 * python-celery
 * python-dateutil
 * python-dev
 * python-docutils
 * python-formencode
 * python-markdown
 * python-nose
 * python-pastescript
 * python-pip
 * python-psycopg2
 * python-pylons
 * python-webhelpers
 * python-webob
 * rabbitmq-server
 * waitress (v0.8.1, not in Ubuntu repositories, need to install via pip)

The package git-core can also be installed via the Ubuntu Git Maintainers PPA
that usually has more updated versions of git. The PPA is: ppa:git-core/ppa

Users Configuration
-------------------

The RhodeCode installation will be done with a dedicated system user and group.

 * System user: rhodecode
 * Group: rhodecode
 * Home: /home/rhodecode

Necessary Directories
---------------------

The following directories need to be writable at least by the 'rhodecode' user
and/or group:

 * /var/log/celery
 * /var/log/rhodecode
 * /opt/rhodecode
 * /opt/git_repos

The '/opt/rhodecode' directory is where RhodeCode will store its local data and
caches.

The '/opt/git_repos' directory is where RhodeCode will store the git
repositories directories.

PostgreSQL Configuration
------------------------

For PostgreSQL it is necessary to create a role called 'rhodecode' with its
own password and the permit to create databases, and a database always called
'rhodecode'.

Once this is done, modify the file 'config/production.ini' at the line:

    sqlalchemy.db1.url = postgresql://rhodecode:XXXX@localhost/rhodecode

with the correct values.

The default config file assumes PostreSQL to be installed on the same host of
RhodeCode.

Celery and RabbitMQ
-------------------

For better performance with more than 10 repositories hosted on RhodeCode, it
is recommended to use Celery with RabbitMQ.

Once RabbitMQ has been installed, it is necessary to set up the correct user
and vhost. Commands have to be run as root.

 * Add a new user called 'rhodecode' to RabbitMQ, set up its own password:
    rabbitmqctl add_user rhodecode $PASSWORD

 * Create a new RabbitMQ vhost called 'rhodecode-vhost':
    rabbitmqctl add_vhost rhodecode-vhost

 * Set the correct permission to the new user for the created vhost:
    rabbitmqctl set_permissions -p rhodecode-vhost rhodecode ".*" ".*" ".*"

Once RabbitMQ has been configured, modify the file 'config/production.ini' with
the correct values. The lines to modify are:

    broker.vhost = rhodecode-vhost
    broker.user = rhodecode
    broker.password = XXXX

The default config file assumes RabbitMQ to be installed on the same host of
RhodeCode.

== Clone Rhodecode from git ==

git clone git://github.com/marcinkuzminski/rhodecode.git
cd rhodecode && git checkout v1.5.1

== Install Rhodecode ==

python setup.py install

= Setup rhodecode =

#Get our configuration from git repository instructions should go here.

== Start Rhodecode ==

paster serve production.ini