Search:  
Gentoo Wiki

HOWTO_freepbx

There's a start at http://aussievoip.com.au/wiki/Freepbx-Gentoo, but it needs work.

Warning: This is not yet complete but it should be enough with the install doc to get it to work

My apologies if this is brief or not concise, this is my first howto.

Contents

Package Download

To start go to http://sourceforge.net/project/showfiles.php?group_id=121515&package_id=132595 to download the latest version is the project homepage.

As the freepbx instructions recommend I wget the file to /usr/src and untar there:

Note: The wget link may be out of date make sure to check the sourceforge page for updates
cd /usr/src/
wget http://downloads.sourceforge.net/amportal/freepbx-2.2.3.tar.gz?modtime=1184774316&big_mirror=0
tar xzf freepbx-2.2.3.tar.gz


USE Flags

Next is the matter of the USE flags needed. Here are the flags I have added:

alsa doc mmx mysql pri zaptel uclibc postgres vmdbmysql vmdbpostgres
hardened speex resperl apache2 cli pcre xml zlib posix session simplexml
soap sockets spl ssl tokenizer truetype unicode xml xmlreader xmlwriter
xsl zlib ncurses curl perl php ctype
Note: ctype is required if you want to use the parking lot feature.

This is designed to be for a strictly asterisk Gentoo server. It is not an authoritative list of all the possible use flags and it may contain a few unnecessary flags but this list seems to work.


Packages to Install

There are quite a few packages that need to be installed for freepbx to work correctly. This is the list of programs I have installed and I believe this is the minimal list of programs needed but again this may not be the case.

dev-db/mysql

dev-lang/perl
dev-perl/DBD-mysql
dev-perl/DBI
dev-perl/libxml-perl

dev-lang/php
dev-php/PEAR-DB
dev-php/PEAR-PEAR

media-libs/speex
media-libs/tiff

media-sound/lame
media-sound/mpg123
media-sound/sox

net-misc/asterisk
net-misc/asterisk-addons
net-misc/asterisk-app_conference
net-misc/asterisk-app_event
net-misc/asterisk-app_iconv
net-misc/asterisk-app_intercept
net-misc/asterisk-app_notify
net-misc/asterisk-app_nv_faxdetect
net-misc/asterisk-app_rtxfax
net-misc/asterisk-chan_sccp
net-misc/asterisk-sounds

net-libs/libpri
net-libs/zapata

net-misc/curl
net-misc/openssh
net-misc/zaptel

www-servers/apache

This page has a list of all the supported Asterisks [net-misc/asterisk-*] packages: http://www.voip-info.org/wiki/index.php?page=Asterisk+Linux+Gentoo

Config Changes

FreePBX is not designed with Gentoo paths in mind so a few changes need to be made. All these changes are assuming that apache is going to be only used for FreePBX. These changes are for portage installed Apache2, Apache1 or a custom install may have different file locations.

This first file that needs to be modified is /etc/apache2/httpd.conf: The owning user and group of the running apache server needs to be changed to asterisk -

 "User apache" needs to be changed to "User asterisk"
 "Group apache" needs to be changed to "Group asterisk"

Next is /etc/apache2/vhosts.d/00_default_vhost.conf: The web root needs to be changed to /var/www/html -

 'DocumentRoot "/var/www/localhost/htdocs' needs to be changed to 'DocumentRoot "/var/www/html"'
 '<Directory "/var/www/localhost/htdocs">' needs to be changed to '<Directory "/var/www/html">'
 'AssignUserID apache apache' needs to be changed to 'AssignUserID asterisk asterisk'

The final change is the shell for the asterisk user from /sbin/nologin to /bin/bash to the perl scripts to run correctly. This needs to be changed in /etc/passwd: [### will be different on each system]

 'asterisk:x:###:###:added by portage for asterisk:/var/lib/asterisk:/sbin/nologin' needs to be changed to 'asterisk:x:###:###:added by portage for asterisk:/var/lib/asterisk:/bin/bash'


Setting up MySQL for CDR and FreePBX web interface

Initialize database

  /usr/bin/mysql_install_db
  /etc/init.d/mysql start

Add CDR tables

  mysqladmin -u root password 'db_root_pwd'
  mysqladmin create asteriskcdrdb -p
  mysql --user=root --password=db_root_pwd asteriskcdrdb < /usr/src/freepbx<version>/SQL/cdr_mysql_table.sql

Add freepbx tables

  mysqladmin create asterisk -p
  mysql --user root -p asterisk < /usr/src/freepbx<version>/SQL/newinstall.sql

Grant access to these two databases you just created

  mysql --user root -p
  mysql> GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY 'amp109';
  Query OK, 0 rows affected (0.00 sec)
  mysql> GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY 'amp109';
  Query OK, 0 rows affected (0.00 sec)
  mysql> quit


Before Running Install Script

The rest of the install is in the INSTALL file in the freepbx tar. I will try to finish this howto page later :)

Retrieved from "http://www.gentoo-wiki.info/HOWTO_freepbx"

Last modified: Sun, 07 Sep 2008 00:25:00 +0000 Hits: 4,202