-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL
213 lines (157 loc) · 7.68 KB
/
INSTALL
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
1.) Ensure the necessary applications are installed on your system. You'll need:
* Webserver (e.g. Apache 2)
* LDAP server (e.g. OpenLDAP 2)
* SQL server (e.g. MySQL 5)
For the Django version:
* Django (see installation guide on www.djangoproject.com)
* python-paramiko
* python-crypto / pycrypto (Needed by paramiko and also by Mango)
For the PHP version:
* PHP5 with LDAP and MySQL support
* PEAR (see below for a list of packages required)
On a recent Debian system, install the following packages:
* apache2
* slapd
* ldap-utils
* mysql-server
* mysql-client
PHP:
* php5-cgi
* php5-ldap
* php5-mysql
* php-pear
Python:
* Django from SVN (they don't release often enough)
* python-paramiko (guessing)
* python-crypto (guessing)
You might want to reconfigure web, LDAP and MySQL servers to only listen on
localhost, if you plan to use your Mango installation for development purposes
only.
Necessary PEAR packages are listed below (Fedora package names this time):
* php-pear
* php-pear-Net-Socket
* php-pear-XML-Parser
* php-pear-Mail-Mime
* php-pear-XML-Util
* php-pear-Auth-SASL
* php-pear-Mail
* php-pear-HTML-Common
* php-pear-Net-SMTP
2.) Check out Mango sources, if you didn't already:
svn co http://svn.gnome.org/svn/mango/trunk mango
3.) Create a session directory
mkdir /where/you/checked/out/mango/sessions
chmod 777 /where/you/checked/out/mango/sessions
4.) Configure the LDAP server
The ldif files in the Mango docs directory assume that you use dc=example,dc=org
as the suffix for your LDAP directory. Start with editing the suffix variable and
all subsequent occurences of dc=nodomain in /etc/ldap/slapd.conf to say
"dc=example,dc=org" instead of "dc=nodomain".
Create a local administrator account to import the initial example LDAP data and
for later use with the Mango application. Insert into /etc/ldap/slapd.conf:
rootdn "cn=admin,dc=example,dc=org"
rootpw {SSHA}B3MTCdJ+bDiAUUzMuhPzcrmKG33+8Wkj
You can generate a password string using the slappasswd utility.
The Mango application needs a number of custom LDAP schemas to work. Import all
schemas in docs/schemas by inserting into /etc/ldap/slapd.conf
# Mango schemas
include /where/you/checked/out/mango/docs/schemas/cvs.schema
include /where/you/checked/out/mango/docs/schemas/module.schema
include /where/you/checked/out/mango/docs/schemas/sshd.schema
In the future there might be even more custom schemas. Check the directory
docs/schemas and import all schemas you can find.
Restart slapd for the changes to take effect.
5.) Edit the example LDAP data to your liking
In docs/ldif is a ldif file that contains example LDAP data you can use for
your development installation of Mango. You might want to edit the data of the
example user to your liking. Check docs/ldif/ou.ldif for the following section:
# Initial User Account
dn: uid=bcicek,ou=people,dc=example,dc=org
objectClass: inetOrgPerson
objectClass: posixAccount
uid: bcicek
uidNumber: 6000
gidNumber: 6000
cn: Baris Cicek
sn: Baris Cicek
mail: [email protected]
description: Mango Dev
loginShell: /bin/bash
homeDirectory: /home/directory
userPassword: e1NNRDV9aGV0QUdsdkZUdGtlSmM1YXpHQnFLRmMvY3NvPQ==
You might want to edit uid (in dn and uid attributes), cn, sn, mail and
userPassword. Again, use the slappasswd utility to generate the password string.
Now search for every occurence of the string bcicek and replace it with the user
id that you chose. If this works out, you will later be able to login using
the uid and password you chose and you will be the maintainer of the Mango
module. Congratulations ;).
6.) Import example LDAP data into the LDAP directory
You can use ldapadd to import example LDAP data (LDAP server should be running):
ldapadd -x -W -D "cn=admin,dc=example,dc=org" -f docs/ldif/ou.ldif
Use the cn and password of the root account to import the data. If you encounter
errors (e.g. you made a mistake when editing the file) use the -c option in
subsequent imports to skip the objects already created.
7.) Configure MySQL server
Connect to the MySQL server using the mysql command line utility and create
a user and a database for Mango (in this case we used the name mango for both):
mysql -u root -p
> CREATE DATABASE mango;
> GRANT ALL PRIVILEGES ON mango.* TO 'mango'@'localhost' IDENTIFIED BY 'some_pass';
> quit
8.) Import example MySQL data into database
In docs/sql are the sql files that contain the example sql data. Import these
files into the database you just created.
mysql -u root -p mango < /where/you/checked/out/mango/docs/sql/ftpmirrors.sql
mysql -u root -p mango < /where/you/checked/out/mango/docs/sql/foundationmembers.sql
mysql -u root -p mango < /where/you/checked/out/mango/docs/sql/mango.sql
There might be more sql files in the future. Check the docs/sql directory and
import all sql files you can find.
9.) Configure web server
Create a new entry in /etc/hosts:
127.0.0.123 mango.gnome.local
You can use whatever you want for the IP and hostname, as long as your web server
will respond to it. If you use Apache 2, add a virtualhost file in your Apache
sites dir (/etc/httpd/sites.d for RedHat, /etc/apache2/sites-available for
Debian/Ubuntu). In Debian/Ubuntu, create a symlink to your virtualhost file in
/etc/apache2/sites-enabled to enable the site. If you use the server only for
Mango development, you might want to remove the symlink for the default site.
<VirtualHost 127.0.0.123:80>
ServerName mango.gnome.local
DocumentRoot /where/you/checked/out/mango/www
Options Includes ExecCGI
AddHandler cgi-script .php
</VirtualHost>
Restart Apache for changes to take effect.
10.) Copy 'config-gnome.xml' to 'config.xml' and configure to taste.
This is an overview about the configuration options:
* mode is either development, live or preview.
* base_url is the url of your web server
* secure_url is the same as base_url, just https (if you set that up).
* accounts_db_url, mirrors_db_url and membership_db_url is the url
of your MySQl server (see step 7). The syntax is as follows:
mysql://user:password@hostname:port/database
* mail_backend chooses the mail backend to use (either sendmail or smtp)
* mail_sendmail_path is the path to sendmail, if sendmail backend is used
* mail_sendmail_args are additional arguments for sendmail (sendmail backend)
* mail_smtp_host is the SMTP server hostname (smtp backend)
* mail_smtp_port is the SMTP server port (smtp backend)
* mail_smtp_auth specifies whether or not to use SMTP authentication,
use 0 for false and 1 for true (smtp backend)
* mail_smtp_username is the username to use for SMTP authentication (smtp backend)
* mail_smtp_password is the password to use for SMTP authentication (smtp backend)
* mail_smtp_localhost is the value to give when sending EHLO or HELO (smtp backend)
* mail_smtp_timeout is a timeout for the SMTP connection (smtp backend)
* mail_smtp_persist specifies whether or not to use persistent SMTP connections,
use 0 for false and 1 for true (smtp backend)
* ldap_url is the url of your ldap server
* ldap_binddn is your ldap root account (see step 4)
* ldap_bindpw is the password of your ldap root account (see step 4)
* ldap_usrs_basedn, ldap_groups_basedn, ldap_modules_basedn is where the
user, groups and module data is stored in your ldap directory (see step 5)
* no idea what token_salt is, probably some kind of salt ;)
* support_email is the email address of your support team (probably your own)
* account_email is the email address of those who handle account management
* session_path is the path where sessions should be stored (see step 3)
11.) Connect to http://mango.gnome.local/ (or whatever you set it up to be)
and off you go. If everything worked, you should be able to login using the
example user you created earlier in step 6.