| 1 | Installation of HelpIM |
|---|
| 2 | |
|---|
| 3 | 1) Requirements: |
|---|
| 4 | |
|---|
| 5 | HelpIM has been tested on Debian Sarge and Debian Etch. |
|---|
| 6 | |
|---|
| 7 | It 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 | |
|---|
| 13 | HelpIM uses the following Python non-standard modules: |
|---|
| 14 | |
|---|
| 15 | MySQLdb |
|---|
| 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 | |
|---|
| 20 | PyXMPP 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 | |
|---|
| 31 | Crypt |
|---|
| 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 | |
|---|
| 36 | 2) Installation of the requirements in Debian Etch: |
|---|
| 37 | |
|---|
| 38 | Install servers: |
|---|
| 39 | sudo aptitude install apache2-mpm-prefork mysql-server jabber |
|---|
| 40 | |
|---|
| 41 | Install python libraries needed for HelpIM: |
|---|
| 42 | sudo aptitude install python2.4 libapache2-mod-python python-mysqldb python-crypto |
|---|
| 43 | |
|---|
| 44 | Install requirements for PyXMPP: |
|---|
| 45 | sudo aptitude install python-dnspython python-libxml2 python-m2crypto python-support |
|---|
| 46 | |
|---|
| 47 | If 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 | |
|---|
| 55 | And if you don't like to have gcc floating around on your server: |
|---|
| 56 | sudo aptitude purge gcc |
|---|
| 57 | |
|---|
| 58 | |
|---|
| 59 | 3) Configuration of jabberd1.4 |
|---|
| 60 | |
|---|
| 61 | Edit the file /etc/jabber/jabber.xml |
|---|
| 62 | Replace '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 | |
|---|
| 64 | Other 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 | |
|---|
| 93 | 4) Copy HelpIM to right locations: |
|---|
| 94 | - Download HelpIM from the svn-repository. |
|---|
| 95 | |
|---|
| 96 | cd stable |
|---|
| 97 | sudo cp -r HelpIM /usr/local/lib/python2.4/site-packages/ |
|---|
| 98 | sudo mkdir /usr/local/share/HelpIM/ |
|---|
| 99 | sudo cp -r resources/ /usr/local/share/HelpIM/ |
|---|
| 100 | sudo cp -r settings/templates/ /usr/local/share/HelpIM/ |
|---|
| 101 | sudo mkdir /etc/HelpIM |
|---|
| 102 | sudo mkdir /etc/HelpIM/default |
|---|
| 103 | sudo cp settings/* /etc/HelpIM/default/ |
|---|
| 104 | sudo chown root:www-data /etc/HelpIM/default/baseconfig |
|---|
| 105 | sudo chmod 640 /etc/HelpIM/default/baseconfig |
|---|
| 106 | sudo mkdir /var/log/HelpIM |
|---|
| 107 | sudo chown www-data:adm /var/log/HelpIM |
|---|
| 108 | sudo chmod 750 /var/log/HelpIM |
|---|
| 109 | sudo mkdir /var/run/HelpIM |
|---|
| 110 | sudo chown www-data:adm /var/run/HelpIM |
|---|
| 111 | sudo chmod 750 /var/run/HelpIM |
|---|
| 112 | sudo mkdir /var/cache/HelpIM |
|---|
| 113 | sudo mkdir /var/cache/HelpIM/default |
|---|
| 114 | sudo mkdir /var/cache/HelpIM/default/templates |
|---|
| 115 | sudo chown www-data:www-data /var/cache/HelpIM/default/templates |
|---|
| 116 | sudo chmod 700 /var/cache/HelpIM/default/templates |
|---|
| 117 | sudo cp setup/cronjob /etc/cron.daily/helpim |
|---|
| 118 | sudo chown root:root /etc/cron.daily/helpim |
|---|
| 119 | sudo chmod 755 /etc/cron.daily/helpim |
|---|
| 120 | sudo cp setup/HelpIM /etc/init.d/ |
|---|
| 121 | sudo chown root:root /etc/init.d/HelpIM |
|---|
| 122 | sudo chmod 755 /etc/cron.daily/helpim |
|---|
| 123 | sudo chmod 755 /etc/init.d/HelpIM |
|---|
| 124 | |
|---|
| 125 | create a file /etc/HelpIM/autostart_sites |
|---|
| 126 | In 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 | |
|---|
| 131 | 5) Create Database |
|---|
| 132 | For each installation HelpIM needs an own database. |
|---|
| 133 | |
|---|
| 134 | To 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 | |
|---|
| 143 | 6) Configuration of HelpIM |
|---|
| 144 | |
|---|
| 145 | The documentation of the HelpIM configuration is, to put it mildly, inexistant. To get it |
|---|
| 146 | running you need to change at least: |
|---|
| 147 | settings/baseconfig |
|---|
| 148 | settings/settings_all.py |
|---|
| 149 | settings/settings_intranet.py |
|---|
| 150 | settings/settings_webchat.py |
|---|
| 151 | settings/templates_chatbot.py |
|---|
| 152 | Make shure the hostnames, http-location, en paths to files are correct. |
|---|
| 153 | |
|---|
| 154 | |
|---|
| 155 | 7) Loading the HelpIM configurations in the database: |
|---|
| 156 | |
|---|
| 157 | To access the database HelpIM needs to find its database configuration. To find |
|---|
| 158 | it checks the environment variable 'HELPIMCONFIG'. Set this variable to point to |
|---|
| 159 | your baseconfig file: |
|---|
| 160 | |
|---|
| 161 | export HELPIMCONFIG=/etc/HelpIM/default/baseconfig |
|---|
| 162 | |
|---|
| 163 | An annotated example of the baseconfig file can be found in settings/baseconfig. All other |
|---|
| 164 | configurations are stored in the database. These can be edited and loaded into the database |
|---|
| 165 | with commands like: |
|---|
| 166 | |
|---|
| 167 | cd /etc/HelpIM/default |
|---|
| 168 | python /usr/local/lib/python2.4/site-packages/HelpIM/settings.py put settings_all_example |
|---|
| 169 | |
|---|
| 170 | to load all settings at once, do: |
|---|
| 171 | python /usr/local/lib/python2.4/site-packages/HelpIM/settings.py put *.py |
|---|
| 172 | |
|---|
| 173 | |
|---|
| 174 | 8) Activate a setup-account |
|---|
| 175 | |
|---|
| 176 | Edit the file setup/setupdata.sql. You should at least change the password... |
|---|
| 177 | Now execute: |
|---|
| 178 | mysql -p -u <username> <database_name> < setup/setupdata.sql |
|---|
| 179 | |
|---|
| 180 | |
|---|
| 181 | 9) Configure Apache2 |
|---|
| 182 | |
|---|
| 183 | First 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 | |
|---|
| 193 | The 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 | |
|---|
| 220 | The 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> |
|---|