root/freepbx/tags/2.6.0/INSTALL

Revision 8421, 9.9 kB (checked in by mickecarlsson, 4 years ago)

Closes #3943 removed obsolete links in INSTALL file

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