centos 7 install freepbx 14 – howto

    1  df
    2  more /etc/centos-release
    3  sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/sysconfig/selinux
    4  sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/selinux/config
    5  reboot
    6  yum update -y 
    7  sestatus
    8  yum -y update
    9  yum -y groupinstall core base "Development Tools"
   10  adduser asterisk -m -c "Asterisk User"
   11  systemctl stop firewalld
   12  systemctl disable firewalld
   13  systemctl mask --now firewalld
   14  yum install iptables-services
   15  systemctl start iptables
   16  systemctl enable iptables
   17  ifconfig
   18  yum -y install lynx tftp-server unixODBC mysql-connector-odbc mariadb-server mariadb   httpd ncurses-devel sendmail sendmail-cf sox newt-devel libxml2-devel libtiff-devel   audiofile-devel gtk2-devel subversion kernel-devel git crontabs cronie   cronie-anacron wget vim uuid-devel sqlite-devel net-tools gnutls-devel python-devel texinfo   libuuid-devel
   19  rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
   20  rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
   21  yum remove php*
   22  yum install php56w php56w-pdo php56w-mysql php56w-mbstring php56w-pear php56w-process php56w-xml php56w-opcache php56w-ldap php56w-intl php56w-soapyum remove php*
   23  yum install php56w php56w-pdo php56w-mysql php56w-mbstring php56w-pear php56w-process php56w-xml php56w-opcache php56w-ldap php56w-intl php56w-soap
   24  php --version
   25  curl -sL https://rpm.nodesource.com/setup_8.x | bash -
   26  yum install -y nodejs
   27  systemctl enable mariadb.service
   28  systemctl start mariadb
   29  mysql_secure_installation
   30  systemctl enable httpd.service
   31  systemctl start httpd.service
   32  pear install Console_Getopt
   33  pwd
   34  cd /usr/src
   35  wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz
   36  wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-current.tar.gz
   37  wget -O jansson.tar.gz https://github.com/akheron/jansson/archive/v2.10.tar.gz
   38  ls
   39  tar xvf dahdi-linux-complete-current.tar.gz 
   40  cd dahdi-linux-complete-
   41  cd dahdi-linux-complete-3.1.0+3.1.0/
   42  ls
   43  make all
   44  make install
   45  make config
   46  make install-config
   47  cd ..
   48  ls
   49  tar xvf libpri-current.tar.gz 
   50  cd libpri-1.6.0/
   51  ls
   52  make
   53  make install
   54  cd ..
   55  ls
   56  tar xvf jansson.tar.gz 
   57  cd jansson-2.10/
   58  yum install jansson-devel
   59  autoreconf -i
   60  ./configure --libdir=/usr/lib64
   61  make
   62  make install
   63  ls
   64  cd ..
   65  wget https://downloads.asterisk.org/pub/telephony/asterisk/old-releases/asterisk-16.9.0.tar.gz
   66  ls
   67  tar xvf asterisk-16.9.0.tar.gz 
   68  cd asterisk-16.9.0
   69  ls
   70  contrib/scripts/install_prereq install
   71  ./configure --libdir=/usr/lib64 --with-pjproject-bundled
   72  contrib/scripts/get_mp3_source.sh
   73  make menuselect
   74  ./configure --libdir=/usr/lib64 --with-jansson-bundled
   75  contrib/scripts/get_mp3_source.sh
   76  make menuselect
   77  make
   78  make 
   79  make  install
   80  make config
   81  ldconfig
   82  chkconfig asterisk off
   83  chown asterisk. /var/run/asterisk
   84  chown -R asterisk. /etc/asterisk
   85  chown -R asterisk. /var/{lib,log,spool}/asterisk
   86  chown -R asterisk. /usr/lib64/asterisk
   87  chown -R asterisk. /var/www/chown asterisk. /var/run/asterisk
   88  chown -R asterisk. /etc/asterisk
   89  chown -R asterisk. /var/{lib,log,spool}/asterisk
   90  chown -R asterisk. /usr/lib64/asterisk
   91  chown -R asterisk. /var/www/
   92  sed -i 's/\(^upload_max_filesize = \).*/\120M/' /etc/php.ini
   93  sed -i 's/^\(User\|Group\).*/\1 asterisk/' /etc/httpd/conf/httpd.conf
   94  sed -i 's/AllowOverride None/AllowOverride All/' /etc/httpd/conf/httpd.conf
   95  systemctl restart httpd.service
   96  cd ..
   97  df
   98  wget http://mirror.freepbx.org/modules/packages/freepbx/freepbx-14.0-latest.tgz
   99  tar xvf freepbx-14.0-latest.tgz 
  100  cd freepbx
  101  ./start_asterisk start
  102  ./install -n
  103  cd ../asterisk-16.9.0
  104  make config
  105  cd ../freepbx
  106  ls
  107  ps -aux|grep asterisk
  108  asterisk -vvvr
  109  kill -9 26312
  110  ./start_asterisk start
  111  ./install -n
  112  asterisk -vvvr
  113  cd /etc/asterisk/
  114  ls
  115  vi asterisk.conf
  116  asterisk -vvvr
  117  pwd
  118  ps -aux|grep asterisk
  119  asterisk -vvvr
  120  exit
  121  df
  122  ps -aux|grep asterisk
  123  kill -9 26836
  124  cp /usr/src/asterisk-16.9.0/configs/basic-pbx/modules.conf  /etc/asterisk
  125  chown -R asterisk:asterisk /etc/asterisk
  126  cd /usr/src/freepbx/
  127  ./start_asterisk start
  128  asterisk -vvvr
  129  ./install -n
  130  vi /etc/systemd/system/freepbx.service
  131  systemctl enable freepbx.service
  132  systemctl start freepbx
  133  cd ..
  134  yum install gcc gcc-c++ make automake unzip zip xz kernel-devel-`uname -r`
  135  ifconfig
  136  iptables -L -n
  137  telnet localhost 80
  138  yum install telnet
  139  yum install tcpdump
  140  telnet localhost 80
  141  service iptables stop
  142  yum install gcc gcc-c++ make automake unzip zip xz kernel-devel-`uname -r` wget unzip iptables-devel perl-Text-CSV_XS
  143  wget https://sourceforge.net/projects/xtables-addons/files/Xtables-addons/xtables-addons-2.14.tar.xz/download
  144  ls -l
  145  tar xvf download 
  146  rm -f download 
  147  ls
  148  df
  149  cd xtables-addons-2.14/
  150  ls
  151   ./configure
  152  sed -i '/xt_TARPIT.o$/s/^/#/' extensions/Kbuild
  153  make
  154  make install
  155  mkdir -p /usr/share/xt_geoip
  156  cd /usr/share/xt_geoip
  157  pwd
  158  ifconfig
  159  mv /tmp/a .
  160  tar xvf a
  161  rm -f a
  162  pwd
  163  cd /etc/sysconfig
  164  ls
  165  vi iptables
  166  vi /tmp/a
  167  yum install fail2ban
  168  cd /etc/fail2ban/
  169  mv jail.conf jail.local
  170  vi jail.local
  171  cd /etc/sysconfig
  172  ls
  173  vi iptables
  174  ping sip.ovh.fr
  175  vi iptables
  176  service iptables start
  177  iptables -L -n
  178  ifconfig
  179  ping wuyifan.com
  180  iptables -L -n
  181  ls
  182  vi iptables
  183  service iptables reload
  184  uptime
  185  systemctl enable iptables
  186  uptime
  187  iptables -L -n
  188  asterisk -vvvr
  189  reboot
  190  pwd
  191  df
  192  iptabls -L -n
  193  iptables -L -n
  194  service fail2ban start
  195  iptables -L -n
  196  cd /etc/fail2ban
  197  ls -l
  198  ps -aux|grep fail2ban
  199  cd /etc/fail2ban
  200  iptables -L -n
  201  cd /var/log/asterisk/
  202  ls -l
  203  iptables -L -n
  204  ps -aux|grep fail2ban
  205  iptables -L -n
  206  cd /etc/fail2ban/
  207  ls
  208  vi jail.local
  209  service iptables restart
  210  iptables -L -n
  211  history
  212  systemctl status iptables
  213  vi jail.local
  214  cd /etc/sysconfig
  215  ls
  216  vi iptables
  217  service iptables reload
  218  iptables -L -n
  219  fwconsole stop
  220  fwconsole start
  221  asterisk -vvvr
  222  uptime
  223  df
  224  cd /usr/src
  225  ls
  226  iptables -L -n
  227  ls
  228  history
  229  history > /tmp/a.txt