ubuntu 16.04.6-安装asterisk和freepbx【1】-准备工作

之前安装过一次,因为某些原因部分国外资源安装失败,导致freepbx总是报错。这次在VPS重新安装。

服务器环境:Ubuntu 16.04.6 LTS

过程记录如下:

参考资料:

https://blog.csdn.net/zwliang98/article/details/90124744

https://blog.csdn.net/hnzwx888/article/details/92669039

https://www.cnblogs.com/youcong/p/10703463.html

1.更新系统:

apt-get update
apt-get upgrade

2.添加ppa源,以便安装php5.6

apt-get install -y language-pack-en-base
LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
add-apt-repository ppa:ondrej/php

3.安装依赖包,为避免再次栽坑,一个一个安装,不错过没一个错误或警告:

apt-get install -y build-essential
apt-get install -y linux-headers-`uname -r`
apt-get install -y openssh-server
apt-get install -y apache2
apt-get install -y mysql-server
apt-get install -y mysql-client
apt-get install -y bison
apt-get install -y flex
apt-get install -y php5.6
apt-get install -y php5.6-curl
apt-get install -y php5.6-cli
apt-get install -y php5.6-xml
apt-get install -y php5.6-mysql
apt-get install -y php-pear
apt-get install -y php5.6-gd
apt-get install -y libapache2-mod-php5.6
apt-get install -y curl
apt-get install -y sox
apt-get install -y libncurses5-dev
apt-get install -y libssl-dev
apt-get install -y libmysqlclient-dev
apt-get install -y mpg123
apt-get install -y libxml2-dev
apt-get install -y libnewt-dev
apt-get install -y sqlite3
apt-get install -y libsqlite3-dev
apt-get install -y pkg-config
apt-get install -y automake
apt-get install -y libtool
apt-get install -y autoconf
apt-get install -y git
apt-get install -y unixodbc-dev
apt-get install -y uuid
apt-get install -y uuid-dev
apt-get install -y libasound2-dev
apt-get install -y libogg-dev
apt-get install -y libvorbis-dev
apt-get install -y libicu-dev
apt-get install -y libcurl4-openssl-dev
apt-get install -y libical-dev
apt-get install -y libneon27-dev
apt-get install -y libsrtp0-dev
apt-get install -y libspandsp-dev
apt-get install -y sudo
apt-get install -y subversion
apt-get install -y libtool-bin
apt-get install -y python-dev

安装MySQL的时候设置空密码。

4.查看php版本并切换:

update-alternatives --config php

我这里只有一个PHP5.6,所以就省下了这一步。

5.安装nodejs

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs

6.下载源码包:

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-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-13-current.tar.gz
wget -O jansson.tar.gz https://github.com/akheron/jansson/archive/v2.7.tar.gz
wget http://mirror.freepbx.org/modules/packages/freepbx/freepbx-14.0-latest.tgz

由于国外资源下载慢,使用finalshell多开几个进程下载上,本地关机睡觉。让VPS自己下载。