root/freepbx/branches/2.1/INSTALL

Revision 1979, 9.4 kB (checked in by qldrob, 3 years ago)

Made it a bit less scary

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 ###
2 Installing freePBX
3
4 ###
5 Important Warning!
6 freePBX _will_ overwrite any exisiting asterisk configurations you may have. This project attempts
7 to manage as much of asterisk as it can, and this means lots of automatically generated dialplans.
8 Please visit both the Documentation wiki (http://www.aussievoip.com.au/wiki/freePBX) and the Dev
9 wiki (http://www.freepbx.org/wiki) for instructions, hints and tips. As a rule of thumb, any
10 existing sip, iax, or extensions files can be copied to the same name with _custom.conf appended,
11 and things will continue to work as before.
12
13
14 ###
15 freePBX has several requirements, including the following packages (names may vary based on distro):
16
17         libxml2
18         libxml2-devel
19         libtiff
20         libtiff-devel
21         lame
22         httpd (or Apache2)
23         mysql (or mysql-client)
24         mysql-devel (or libmysqlclient10-dev)
25         mysql-server
26         php (or php4)
27         (on debian, also install libapache2-mod-php4)
28         php4-pear (if pear is not included with your php)
29         php-mysql
30         (on SUSE, also install php4-gettext and php4-session)
31         php-gd
32         openssl
33         openssl-devel (or libssl-dev)
34         kernel-devel (or linux-source)
35         perl
36         perl-CPAN
37         bison
38         ncurses-devel (or libncurses5-dev)
39         audiofile-devel (or libaudiofile-devel)
40         curl
41         sox
42
43 ### Install these Perl modules:
44        
45         perl -MCPAN -e "install Net::Telnet"
46        
47         perl -MCPAN -e "install IPC::Signal"
48        
49         perl -MCPAN -e "install Proc::WaitStat"
50
51 ###
52 Mime-contruct is needed to generate emails with fax file attachments:
53
54
55         - download the latest mime-construct from http://search.cpan.org/~rosch/
56         - install it
57
58 ###
59 Download asterisk-perl from http://asterisk.gnuinter.net and install it
60        
61 ###
62 freePBX requires the following changes to php and apache for uploading new MOH files:
63
64
65         - vi +482 /etc/php.ini  (or /etc/php4/apache2/php.ini)
66                 upload_max_filesize=20M
67         - vi +14 /etc/httpd/conf.d/php.conf (if you have it)
68                 LimitRequestBody 20000000
69
70 ###
71 Download the latest freePBX files:
72
73         - download the latest freePBX tarball to /usr/src
74         - tar -zxvf freepbx<version>.tar.gz
75
76 ###
77 Getting Asterisk and Zaptel from SVN or download the latest Asterisk and Zaptel source archives
78 (freePBX uses the v2.0 branch)
79
80         - cd /usr/src
81         - svn checkout http://svn.digium.com/svn/asterisk/branches/1.2 asterisk-1.2
82         - svn checkout http://svn.digium.com/svn/zaptel/branches/1.2 zaptel-1.2
83         - svn checkout http://svn.digium.com/svn/libpri/branches/1.2 libpri-1.2
84
85 ###
86 For TDM zap devices (FXO/FXS):
87
88         - cd /usr/src/zaptel
89         - make && make install
90
91         If you will be using a Digium telephony card that supports T1/E1 signaling do this step as well:
92         - cd /usr/src/libpri
93         - make && make install
94        
95 ###
96 Patching Asterisk with softfax/spandsp.
97
98         - Download the latest spandsp files from http://www.soft-switch.org
99         - cd /usr/src/spandsp-xxx
100         - ./configure
101         - make && make install
102
103         The spandsp libraries are installed to /usr/local/lib.  Therefore /usr/local/lib must be added to the LD_LIBRARY_PATH environment variable of the user that starts the asterisk process. To be safe, also add it to /etc/ld.so.conf and run ldconfig.
104
105         Copy the following files (from soft-switch.org) to /usr/src/asterisk/apps/ :
106
107         - cp app_rxfax.c /usr/src/asterisk/apps/
108         - cp app_txfax.c /usr/src/asterisk/apps/
109         - cp apps_makefile.patch /usr/src/asterisk/apps/
110
111         - cd /usr/src/asterisk/apps
112         - patch < apps_makefile.patch
113
114                
115 ###
116 Create a group and non-root user:
117
118         - groupadd asterisk
119         - useradd -c "asterisk PBX" -d /var/lib/asterisk -g asterisk asterisk
120        
121        
122 ###
123 Building Asterisk and configuring it to run as a non-root user
124
125         - mkdir /var/run/asterisk
126         - cd /usr/src/asterisk
127         - make clean && make && make install
128
129 ###
130 Get and build cdr_mysql module for asterisk
131
132         - cd /usr/src/asterisk-addons
133         - perl -p -i.bak -e 's/CFLAGS.*D_GNU_SOURCE/CFLAGS+=-D_GNU_SOURCE\nCFLAGS+=-DMYSQL_LOGUNIQUEID/' Makefile
134         - make clean && make && make install
135        
136 ###
137 Install asterisk-sounds
138
139         - cd /usr/src/asterisk-sounds
140         - make install
141        
142 ###
143 Setting up MySQL for CDR and freePBX web interface
144
145         - /usr/bin/mysql_install_db
146         - /etc/init.d/mysqld start (or /etc/init.d/mysql start)
147
148         - mysqladmin -u root password 'db_root_pwd'
149         - mysqladmin create asteriskcdrdb -p
150         - mysql --user=root --password=db_root_pwd asteriskcdrdb < /usr/src/freepbx<version>/SQL/cdr_mysql_table.sql
151        
152         - mysqladmin create asterisk -p
153         - mysql --user root -p asterisk < /usr/src/freepbx<version>/SQL/newinstall.sql
154
155        
156 ###
157 Grant access to these two databases you just created
158
159 **Note the default mysql username/password is asteriskuser/amp109. 
160 **If you change either of these, you will be prompted for them while running ./install below
161
162         - mysql --user root -p
163
164                 mysql> GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY 'amp109';
165                 Query OK, 0 rows affected (0.00 sec)
166
167                 mysql> GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY 'amp109';
168                 Query OK, 0 rows affected (0.00 sec)
169                
170                 mysql> quit
171
172 ###
173 Run the "install" script to install all the freePBX files: 
174
175         - /usr/src/freePBX/install_amp
176        
177 ###
178 Configure zaptel driver:
179
180         a. Edit /etc/zaptel.conf to reflect installed Digium telephony card(s).
181        
182         Only the parameters/values relevant to a TDM400P with 4 FXO modules are included below:
183
184         fxsks=1-4
185         loadzone=us
186         defaultzone=us
187
188         Only the parameters/values relevant to a TE110P (T1 configuration) are included below:
189        
190         span=1,1,0,esf,b8zs
191         bchan=1-23
192         dchan=24
193         loadzone=us
194         defaultzone=us
195
196         b. ztcfg -v
197
198                         Zaptel Configuration
199                         ======================
200                        
201                         1 channels configured.
202        
203         If you get a warning about unable to open master device /dev/zap/ctl, that's ok.  It's a result
204         of the zaptel module(s) not loaded yet.
205
206         Detailed information with regard to Asterisk's configuration files can be found here:
207         http://voip-info.org/wiki-Asterisk+config+files
208
209 ###
210 Configure zapata module in asterisk config.
211
212         - edit /etc/asterisk/zapata.conf to reflect installed digium interfaces (see zapata.conf.template)
213
214         Only the parameters/values relevant to a TDM400P with 4 FXO modules are included below:
215
216         [channels]
217         language=en
218         #include zapata_additional.conf
219         context=from-pstn
220         signalling=fxs_ks
221         faxdetect=incoming
222         usecallerid=yes
223         callerid=asreceived
224         echocancel=yes
225         callprogress=no
226         busydetect=no
227         echocancelwhenbridged=no
228         echotraining=800
229         group=0
230         channel=1-4
231
232
233         Only the parameters/values relevant to a TE110P (T1 configuration) are included below:
234
235         [channels]
236         language=en
237         #include zapata_additional.conf
238         context=from-pstn
239         switchtype=national
240         pridialplan=national
241         signalling=pri_cpe
242         faxdetect=incoming
243         usecallerid=yes
244         echocancel=yes
245         callerid=asreceived
246         echocancelwhenbridged=no
247         echotraining=800
248         group=0
249         channel=1-23
250
251
252         Note: if your configuration is using zap channels as FXS endpoints, zapata.conf must
253         contain the following line in order to provision these endpoints in freePBX's Extensions admin:
254         #include zapata_additional.conf
255
256         Detailed information with regard to Asterisk's configuration files can be found here:
257         http://voip-info.org/wiki-Asterisk+config+files
258
259 ###
260 httpd (Apache) configuration
261
262         - Edit /etc/httpd/conf/httpd.conf (or /etc/apache2/apache2.conf) so that:
263
264                 User asterisk
265                 Group asterisk
266                
267 ###
268 Chown the PHP session.save_path directory:
269
270         - chown asterisk /var/lib/php/session
271
272                
273 ###
274 Amportal Control Script
275
276         FreePBX's amportal control script starts, stops or kills services in the freePBX environment, and sets permissions on directories/files in the
277         freePBX environment:
278
279         [root@pbx root]# amportal
280        
281         ----------AMP Control Script-----------
282         Usage: amportal start|stop|kill|chown
283         start: Starts Asterisk and Flash Operator Panel server
284         stop: Gracefully stops Asterisk and the FOP server
285         kill: Kills Asterisk and the FOP server
286         chown: Sets appropriate permissions on files
287        
288         The amportal script is the recommended way to stop and start asterisk:
289        
290         [root@pbx root]# /usr/sbin/amportal stop
291         [root@pbx root]# /usr/sbin/amportal start
292
293 ###
294 Auto Start
295
296         The module/driver that you load at boot time depends upon whether you are using a
297         TDM400P or TE110P. The wcfxs module should be loaded for the former and the wcte11xp
298         module should be loaded for the latter.
299
300         The following scripts are for RedHat and derivatives that use an rc.local:
301        
302         Edit /etc/rc.d/rc.local to include the following for the TDM400P:
303         #!/bin/sh
304         #
305         # This script will be executed *after* all the other init scripts.
306         # You can put your own initialization stuff in here if you don't
307         # want to do the full Sys V style init stuff.
308         touch /var/lock/subsys/local
309         echo Loading wcfxs
310         /sbin/modprobe wcfxs
311         /usr/sbin/amportal start
312
313         Edit /etc/rc.d/rc.local to include the following for the TE110P:
314
315         #!/bin/sh
316         #
317         # This script will be executed *after* all the other init scripts.
318         # You can put your own initialization stuff in here if you don't
319         # want to do the full Sys V style init stuff.
320         touch /var/lock/subsys/local
321         echo Loading wcte11xp
322         /sbin/modprobe wcte11xp
323         /usr/sbin/amportal start
324
325         For Debian and others (?), you'll have to add startup script(s) to /etc/init.d and link them
326         to the appropriate rc?.d runlevel.
327
328        
329         Also ensure that mysql and apache are set to start at bootup. For RedHat-based systems do the following:
330        
331         - chkconfig --level 3 httpd on
332         - chkconfig --level 3 mysqld on
333
334 ###
335 Start everything (or reboot and it should start automagically):
336
337         - As root run:
338
339                 service httpd restart
340                 (or /etc/init.d/apache2 restart)
341
342         - As root run:
343
344                 amportal start
345
346         - Point your browser to:
347
348                 http://[ip address]  (default login is admin/admin)
349
350 If you notice any errors or updates that are needed to this document, please e-mail:
351 info@coalescentsystems.ca
Note: See TracBrowser for help on using the browser.