Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Install Ubuntu 12.04 Server LTS 32 or 64-bit

Warning
titleCommercial Modules

Commercial modules and add-ons are not currently supported on the Ubuntu platform. Commercial Modules can be purchased in the FreePBX Distro Market Place and are only supported on the FreePBX Distro platform.

 

Table of Contents

Initial System Setup

Configure your root password.

Code Block
languagebash
sudo passwd root

Switch to the Root User

Code Block
languagebash
sudo -i

Update Your System

Code Block
languagebash
apt-get update && sudo apt-get upgrade -y 

Install Required Dependencies

Code Block
languagebash
apt-get install -y build-essential linux-headers-`uname -r` openssh-server apache2 mysql-server mysql-client bison flex php5 php5-curl php5-cli php5-mysql php-pear php-db php5-gd curl sox libncurses5-dev libssl-dev libmysqlclient15-dev mpg123 libxml2-dev libnewt-dev sqlite3 libsqlite3-dev pkg-config automake libtool autoconf git subversion uuid uuid-dev

Install PearDB

Code Block
languagebash
pear uninstall db
pear install db-1.7.14
Note

You may receive a warning:

Code Block
languagebash
WARNING: "pear/DB" is deprecated in favor of "pear/MDB2"

At this time it is safe to ignore that message

Reboot server

Code Block
languagebash
reboot

Install Dependencies for Google Voice

Install iksemel

Code Block
languagebash
cd /usr/src
wget https://iksemel.googlecode.com/files/iksemel-1.4.tar.gz
tar xf iksemel-1.4.tar.gz
cd iksemel-*
./configure
make
make install

Install and Configure Asterisk

Download Asterisk source files.

Code Block
languagebash
cd /usr/src
wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-1.4-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-11-current.tar.gz

Compile and install DAHDI.

Code Block
languagebash
cd /usr/src
tar xvfz dahdi-linux-complete-current.tar.gz
cd dahdi-linux-complete-*
make all
make install 
make config

Compile and install LIBPRI.

Code Block
languagebash
cd /usr/src
tar xvfz libpri-1.4-current.tar.gz
cd libpri-*
make
make install

Compile and install Asterisk

Code Block
languagebash
cd /usr/src
tar xvfz asterisk-11-current.tar.gz
cd asterisk-*
./configure
contrib/scripts/get_mp3_source.sh
make menuselect
make
make install
make config

Install Asterisk-Extra-Sounds

Code Block
languagebash
cd /var/lib/asterisk/sounds
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-gsm-current.tar.gz
tar xfz asterisk-extra-sounds-en-gsm-current.tar.gz
rm asterisk-extra-sounds-en-gsm-current.tar.gz

Install and Configure FreePBX

Download and extract FreePBX.

Code Block
languagebash
export VER_FREEPBX=2.11
cd /usr/srcsrcwget git clone http://gitmirror.freepbx.org/scm/freepbx/framework.git freepbx
cd freepbx
git checkout release/${VER_FREEPBX}-2.11.0.43.tgz
tar vxfz freepbx-2.11.0.43.tgz

Now create the Asterisk user and set ownership permissions.

Code Block
languagebash
adduser asterisk --disabled-password --gecos "Asterisk User"
chown asterisk. /var/run/asterisk
chown -R asterisk. /etc/asterisk
chown -R asterisk. /var/{lib,log,spool}/asterisk
chown -R asterisk. /usr/lib/asterisk
mkdir /var/www/html
chown -R asterisk. /var/www/

A few small modifications to Apache.

Code Block
languagebash
sed -i 's/\(^upload_max_filesize = \).*/\120M/' /etc/php5/apache2/php.ini
cp /etc/apache2/apache2.conf /etc/apache2/apache2.conf_orig
sed -i 's/^\(User\|Group\).*/\1 asterisk/' /etc/apache2/apache2.conf
service apache2 restart

Configure Asterisk database in MYSQL. 

Code Block
languagebash
export ASTERISK_DB_PW=amp109 
mysqladmin -u root create asterisk -p
mysqladmin -u root create asteriskcdrdb -p
mysql -u root asterisk -p < SQL/newinstall.sql 
mysql -u root asteriskcdrdb -p < SQL/cdr_mysql_table.sql 

Set permissions on MYSQL database.

Code Block
languagebash
mysql -u root -p -e "GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY '${ASTERISK_DB_PW}';"
mysql -u root -p -e "GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY '${ASTERISK_DB_PW}';"
mysql -u root -p -e "flush privileges;"

Restart Asterisk and install FreePBX.

Code Block
languagebash
./start_asterisk start
./install_amp --webroot /var/www
amportal a ma installall
amportal a reload
Note

** If “. /install_amp” fails to run correctly, in terminal type:

Code Block
languagebash
./install_amp --username=asteriskuser --password=$ASTERISK_DB_PW --webroot /var/www

Finally, one last mod and start FreePBX.

Code Block
languagebash
ln -s /var/lib/asterisk/moh /var/lib/asterisk/mohmp3
amportal start 

Start FreePBX

Navigate: 

http://yourlocalipaddress/html or if you prefer http://localhost/admin

...