Installing freePBX on Ubuntu Server (Feisty)

Install feisty as usual, add the following repositories to /etc/apt/sources.list:

deb http://archive.canonical.com/ubuntu feisty-commercial main
deb http://archive.ubuntu.com/ubuntu feisty-backports main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu feisty-updates universe multiverse
deb http://archive.ubuntu.com/ubuntu feisty-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu feisty universe multiverse

note/TODO: not sure which of the above are specifically needed, but asterisk is provided in this somewhere

Install required modules:

sudo apt-get install asterisk asterisk-mysql php5-mysql php-db mysql-server libapache2-mod-php5 php5-gd php-pear php-pear-DB sox curl 

You may need to set up apache appropriately, at the least be sure php5 is enabled:

sudo a2enmod php5

For the localization to work properly you may have to edit /etc/php5/apache2/php.ini and modify as follow (leny/sid):

; PHP's built-in default is text/html
default_mimetype = "text/html"
;default_charset = "ISO-8859-1"
default_charset = "utf8";

Adding the last line force the default charset for php pages (override apache charset) to be utf8. (I had the problem with others i18n php websites too and this modification works fine for all of them)

Start installation of freepbx: (this has been tested with 2.3beta1)

cd /usr/src/freepbx
sudo ./install_amp

Here are some of the relevant settings I changed to work with ubuntu's asterisk and apache packages:

AMPBIN=/var/lib/asterisk/bin
ASTAGIDIR=/usr/share/asterisk/agi-bin
AMPWEBROOT=/var/www/freepbx
FOPWEBROOT=/var/www/freepbx/panel

Make sure apache can access freepbx files (it changes ownership to the asterisk user/group, this puts apache in the asterisk group) and reload apache:

sudo adduser www-data asterisk
sudo apache2ctl graceful

Other References

See also: http://www.chemlab.org/2008/10/08/experience-the-love-of-ubuntu-804-freepbx-25