root/stable/setup/README

Revision 477, 8.7 kB (checked in by winfried, 3 years ago)

- fixing bug in intranet sessions
- disabling default use of debuglogger in bot
- updating README

Line 
1Installation of HelpIM
2
31) Requirements:
4
5HelpIM has been tested on Debian Sarge and Debian Etch.
6
7It needs:
8- python2.3 or python2.4
9- apache2 with mod_python. Be aware that early versions of mod_python v 3 have lots of nasty bugs and memory-leaks. IT is advisable to use at least version 3.1.x of mod_python.
10- MySQL database. Right now it supports MySQL from 3.23 up to 5.0 (5.1 should work too). In the near future support for versions before 4.1 will be dropped.
11- an jabber-server, it is tested with jabberd1.4, but any jabberserver should work.
12
13HelpIM uses the following Python non-standard modules:
14
15MySQLdb
16    Tested with version 1.2.1
17    Should be available in your distribution, source-package can be found at:
18    http://sourceforge.net/project/showfiles.php?group_id=22307
19
20PyXMPP version 1.0 build 645 (snapshot 20060819) or higher
21    Note that PyXMPP versions below build 658 work with M2Crypto version 1.4, from build 659 and up it needs
22    M2Crypto version 1.6. PyXMPP is available at: http://pyxmpp.jajcus.net/
23    For Debian Sarge there is no package available for this, nor for some of its
24    dependencies. To install on Debian Sarge:
25    - install from Sarge: libxml2 libxml2-dev python2.3-libxml2 and m2crypto
26    - install from Etch: python2.3-dnspython:
27             download it from: http://packages.debian.org/etch/python-dnspython/all/download
28             install it with: sudo dpkg -i python-dnspython_1.3.5-3.1_all.deb
29    - download pyxmpp and install it according to the instructions on http://pyxmpp.jajcus.net/
30
31Crypt
32    This is available at http://www.amk.ca/python/code/crypto or at your distribution
33    Tested with version 2.0.1
34
35
362) Installation of the requirements in Debian Etch:
37
38Install servers:
39 sudo aptitude install apache2-mpm-prefork mysql-server jabber
40
41Install python libraries needed for HelpIM:
42 sudo aptitude install python2.4 libapache2-mod-python python-mysqldb python-crypto
43
44Install requirements for PyXMPP:
45 sudo aptitude install python-dnspython python-libxml2 python-m2crypto python-support
46
47If you build PyXMPP on same computer, install requirements to build PyXMPP:
48 sudo aptitude install gcc python-dev libxml2-dev
49 wget http://pyxmpp.jajcus.net/downloads/snapshots/pyxmpp-1.0.0.s20070831.tar.gz
50 tar -xzf pyxmpp-1.0.0.s20070831.tar.gz
51 cd pyxmpp-1.0.0.s20070831/
52 python setup.py build
53 sudo python setup.py install
54
55And if you don't like to have gcc floating around on your server:
56 sudo aptitude purge gcc
57
58
593) Configuration of jabberd1.4
60
61Edit the file /etc/jabber/jabber.xml
62Replace 'localhost' with the hostname of your server, you might do virtual hosting with jabberd. Update the ip-numbers and ports to listen to, update the location of your ssl-certificates.
63
64Other recommended changes to jabber.xml:
65
66- change the register part to:
67      <register notify="no">
68        <instructions>Choose a username and password to register with this server.</instructions>
69      </register>
70- comment out the welcome-function
71- comment out <vcard2jud/>
72- in the browse-section, comment out:
73        <service type="jud" jid="users.jabber.org" name="Jabber User Directory">
74          <ns>jabber:iq:search</ns>
75          <ns>jabber:iq:register</ns>
76        </service>
77- comment out <mod_auth_plain>./jsm/jsm.so</mod_auth_plain>
78- change the 'karma' section to:
79      <karma>
80        <init>100</init>
81        <max>1000</max>
82        <inc>100</inc>
83        <dec>1</dec>
84        <penalty>-1</penalty>
85        <restore>100</restore>
86      </karma>
87- comment out the External asychronous DNS resolver
88- comment out the s2s communication
89- change the rate-points section to:
90    <rate points="1000" time="1"/>
91
92
934) Copy HelpIM to right locations:
94- Download HelpIM from the svn-repository.
95
96cd stable
97sudo cp -r HelpIM /usr/local/lib/python2.4/site-packages/
98sudo mkdir /usr/local/share/HelpIM/
99sudo cp -r resources/ /usr/local/share/HelpIM/
100sudo cp -r settings/templates/ /usr/local/share/HelpIM/
101sudo mkdir /etc/HelpIM
102sudo mkdir /etc/HelpIM/default
103sudo cp settings/* /etc/HelpIM/default/
104sudo chown root:www-data /etc/HelpIM/default/baseconfig
105sudo chmod 640 /etc/HelpIM/default/baseconfig
106sudo mkdir /var/log/HelpIM
107sudo chown www-data:adm /var/log/HelpIM
108sudo chmod 750 /var/log/HelpIM
109sudo mkdir /var/run/HelpIM
110sudo chown www-data:adm /var/run/HelpIM
111sudo chmod 750 /var/run/HelpIM
112sudo mkdir /var/cache/HelpIM
113sudo mkdir /var/cache/HelpIM/default
114sudo mkdir /var/cache/HelpIM/default/templates
115sudo chown www-data:www-data /var/cache/HelpIM/default/templates
116sudo chmod 700 /var/cache/HelpIM/default/templates
117sudo cp setup/cronjob /etc/cron.daily/helpim
118sudo chown root:root /etc/cron.daily/helpim
119sudo chmod 755 /etc/cron.daily/helpim
120sudo cp setup/HelpIM /etc/init.d/
121sudo chown root:root /etc/init.d/HelpIM
122sudo chmod 755 /etc/cron.daily/helpim
123sudo chmod 755 /etc/init.d/HelpIM
124
125create a file /etc/HelpIM/autostart_sites
126In it there should be for each installation of HelpIM on this machine a line with the full path of the
127'baseconfig' file of that installation. E.g:
128/etc/HelpIM/default/baseconfig
129
130
1315) Create Database
132For each installation HelpIM needs an own database.
133
134To create the database:
135- log in to MySQL with enough permissions (probably as root)
136- execute the following SQL:
137    CREATE DATABASE <database_name>;
138    GRANT all ON <database_name>.* TO <username> IDENTIFIED BY '<password>';
139- log out of mysql and execute the following at your shell prompt:
140    mysql -p -u <username> <database_name> < setup/skeleton.sql
141
142
1436) Configuration of HelpIM
144
145The documentation of the HelpIM configuration is, to put it mildly, inexistant. To get it
146running you need to change at least:
147settings/baseconfig
148settings/settings_all.py
149settings/settings_intranet.py
150settings/settings_webchat.py
151settings/templates_chatbot.py
152Make shure the hostnames, http-location, en paths to files are correct.
153
154
1557) Loading the HelpIM configurations in the database:
156
157To access the database HelpIM needs to find its database configuration. To find
158it checks the environment variable 'HELPIMCONFIG'. Set this variable to point to
159your baseconfig file:
160
161export HELPIMCONFIG=/etc/HelpIM/default/baseconfig
162
163An annotated example of the baseconfig file can be found in settings/baseconfig. All other
164configurations are stored in the database. These can be edited and loaded into the database
165with commands like:
166
167cd /etc/HelpIM/default
168python /usr/local/lib/python2.4/site-packages/HelpIM/settings.py put settings_all_example
169
170to load all settings at once, do:
171python /usr/local/lib/python2.4/site-packages/HelpIM/settings.py put *.py
172
173
1748) Activate a setup-account
175
176Edit the file setup/setupdata.sql. You should at least change the password...
177Now execute:
178mysql -p -u <username> <database_name> < setup/setupdata.sql
179
180
1819) Configure Apache2
182
183First make the resources acessible:
184    Alias /resources /usr/local/share/HelpIM/resources
185    Alias /intranet /usr/local/share/HelpIM/resources
186    <Directory /usr/local/share/HelpIM/resources>
187        Options None
188        AllowOverride None
189        Order allow,deny
190        Allow from all
191    </Directory>
192
193The webchat:
194
195        <Location /chat>
196                Options None
197                Order allow,deny
198                Allow from all
199                AddDefaultCharset utf-8
200                SetHandler python-program
201                PythonHandler HelpIM.webchat.handler::handlereq
202        PythonOption HelpIMconfig /etc/HelpIM/default/baseconfig
203               
204                # Crucial to set this one to a unique value for each site
205                PythonInterpreter "default"
206               
207                # Should apache check for changes in HelpIM? If Off, a reload of apache
208                # is needed to make the new version active, but apache should gain
209                # performance. Should be set to 'Off' once in production.
210                PythonAutoReload On
211               
212                # Should apache and HelpIM present error-messages to the client if
213                # HelpIM encounters a bug? For testing this is great, but when it in
214                # production it is an information-disclosure bug (and a security
215                # hazard).
216                PythonDebug On
217               
218        </Location>
219       
220The intranet:
221
222    <Location /intranet>
223        Options None
224        Order allow,deny
225        Allow from all
226        AddDefaultCharset iso-8859-1
227        AddCharset utf-8 .html
228        ErrorDocument 404 /intranet/404
229        SetHandler python-program
230        PythonHandler HelpIM.intranet.handler::handlereq
231        PythonOption HelpIMconfig /etc/HelpIM/default/baseconfig
232               
233                # Crucial to set this one to a unique value for each site
234                PythonInterpreter "default"
235
236                # Should apache check for changes in HelpIM? If Off, a reload of apache
237                # is needed to make the new version active, but apache should gain
238                # performance. Should be set to 'Off' once in production.
239                PythonAutoReload On
240               
241                # Should apache and HelpIM present error-messages to the client if
242                # HelpIM encounters a bug? For testing this is great, but when it in
243                # production it is an information-disclosure bug (and a security
244                # hazard).
245                PythonDebug On
246        </Location>
Note: See TracBrowser for help on using the browser.