Initial System Setup
When
installing the machine, at package selection make sure you pick - at
least - OpenSSH Server, and 'LAMP Packages'. This installs the base
packages required.
Switch to the Root User
Update Your System
apt-get update && sudo apt-get upgrade -y
|
Install Required Dependencies
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 libmysqlclient-dev mpg123 libxml2-dev libnewt-dev sqlite3\
libsqlite3-dev pkg-config automake libtool autoconf git subversion unixodbc-dev uuid uuid-dev\
libasound2-dev libogg-dev libvorbis-dev libcurl4-openssl-dev libical-dev libneon27-dev libsrtp0-dev\
libspandsp-dev
If there is any issue with the linux header installation, remove the linux-headers-` uname -r` line from the above command
|
Reboot server
Download Asterisk source files.
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-13-current . tar .gz
git clone https: //github .com /akheron/jansson .git
git clone https: //github .com /asterisk/pjproject .git
|
Compile and install DAHDI.
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.
cd /usr/src
tar xvfz libpri-1.4-current. tar .gz
cd libpri-*
make
make install
|
Compile and install pjproject
cd /usr/src/pjproject
. /configure -- enable -shared --disable-sound --disable-resample --disable-video --disable-opencore-amr
make dep
make
make install
|
Compile and Install jansson
cd /usr/src/jansson
autoreconf -i
. /configure
make
make install
|
Compile and install Asterisk
cd /usr/src
tar xvfz asterisk-13-current. tar .gz
cd asterisk-*
. /configure
contrib /scripts/get_mp3_source .sh
make menuselect
|
You will be prompted at the point to pick
which modules to build. Most of them will be enabled, but if you want to
have MP3 support, you need to manually turn on 'format_mp3' on the
first page.
After selecting 'Save & Exit' you can then continue
make
make install
make config
ldconfig
|
Download and extract FreePBX.
export VER_FREEPBX=12.0
cd /usr/src
git clone http: //git .freepbx.org /scm/freepbx/framework .git freepbx
cd freepbx
git checkout release/${VER_FREEPBX}
|
Now create the Asterisk user and set ownership permissions.
useradd -m asterisk
chown asterisk. /var/run/asterisk
chown -R asterisk. /etc/asterisk
chown -R asterisk. /var/ {lib,log,spool} /asterisk
chown -R asterisk. /usr/lib/asterisk
rm -rf /var/www/html
|
A few small modifications to Apache.
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
|
Prepare MySQL
You now need to generate a secure password for FreePBX to use to talk to MySQL.
export ASTERISK_DB_PW= mypassword
|
That will generate a quasi-random 16 character long
password, which should be secure enough for most things. If you had set
the MySQL 'root' password to be something when you were installing the
machine, you will need to add a -p
yourpassword flag to the following lines
mysqladmin -u root create asterisk
mysqladmin -u root create asteriskcdrdb
|
Set permissions on MYSQL database.
mysql -u root -e "GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY '${ASTERISK_DB_PW}';"
mysql -u root -e "GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY '${ASTERISK_DB_PW}';"
mysql -u root -e "flush privileges;"
|
Restart Asterisk and install FreePBX.
. /start_asterisk start
. /install_amp --installdb --username=root --password=${ASTERISK_DB_PW}
For fix the DB voicemail.admin error
amportal a ma download voicemail
amportal a ma install voicemail
Then go to the Freepbx GUI and install the SIP setting module then continue
amportal a ma installall
amportal a reload
amportal chown
|
Finally, one last mod and start FreePBX.
ln -s /var/lib/asterisk/moh /var/lib/asterisk/mohmp3
amportal start
|
Start FreePBX
Navigate:
Now FreePBX is installed, it will be available via Apache. Open up your web browser and visit:
http://
Address.Of.FreePBX.Server/admin
Securing the System
amportal
chown
amportal a ma refreshsignatures
amportal a reload
nano /etc/apache2/apache2.conf
<Directory /var/www/>
Options Indexes FollowSymLinks
#AllowOverride None
AllowOverride All
Require all granted
</Directory>
service apache2 restart
http://wiki.freepbx.org/display/HTGS/Installing+FreePBX+12+on+Ubuntu+Server+14.04+LTS
en el paso de "Restart Asterisk and install FreePBX.", me genera este error "sudo: ./install_amp: command not found"
ResponderEliminaralguna idea de porque no reconoce el comando
del procedimiento solo cambie a instalar asterisk 14..