filsif

freepbx install on debian 9

Apr 29th, 2020
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.68 KB | None | 0 0
  1. apt install build-essential linux-headers-`uname -r` openssh-server apache2 mariadb-server mariadb-client bison flex php php-curl php-cli php-pdo php-mysql php-pear php-gd php-mbstring php-intl curl sox libncurses5-dev libssl-dev mpg123 libxml2-dev libnewt-dev sqlite3 libsqlite3-dev pkg-config automake libtool autoconf git unixodbc-dev uuid uuid-dev libasound2-dev libogg-dev libvorbis-dev libicu-dev libcurl4-openssl-dev libical-dev libneon27-dev libsrtp0-dev libspandsp-dev sudo subversion libtool-bin python-dev unixodbc dirmngr sendmail-bin sendmail tmux phpmyadmin libapache2-mpm-itk net-tools vim
  2.  
  3.  
  4. curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash -
  5. apt install nodejs
  6.  
  7. reboot
  8.  
  9. wget https://wiki.freepbx.org/download/attachments/122487323/mariadb-connector-odbc_3.0.7-1_amd64.deb
  10.  
  11. wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-16-current.tar.gz
  12. wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz
  13. wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-current.tar.gz
  14. wget http://mirror.freepbx.org/modules/packages/freepbx/freepbx-15.0-latest.tgz
  15.  
  16.  
  17. dpkg -i mariadb-connector-odbc_3.0.7-1_amd64.deb
  18. pear install Console_Getopt
  19.  
  20.  
  21. tar xvzf asterisk-16-current.tar.gz
  22. cd asterisk-16.9.0/
  23. ./contrib/scripts/get_mp3_source.sh
  24. ./contrib/scripts/install_prereq install
  25. ./configure --with-pjproject-bundled --with-jansson-bundled
  26. make menuselect.makeopts
  27. ./menuselect/menuselect --enable app_macro --enable format_mp3 menuselect.makeopts
  28. make
  29. make install
  30. make config
  31. ldconfig
  32. update-rc.d -f asterisk remove
  33.  
  34. useradd -m asterisk
  35. chown asterisk. /var/run/asterisk/
  36. chown -Rfv asterisk. /etc/asterisk/
  37. chown -Rfv asterisk. /var/{lib,log,spool}/asterisk
  38. chown -Rfv asterisk. /usr/lib/asterisk
  39.  
  40. change upload maxfilesize to 256M
  41.  
  42.  
  43.  
  44. cat <<EOF > /etc/odbcinst.ini
  45. [MySQL]
  46. Description = ODBC for MySQL (MariaDB)
  47. Driver = /usr/local/lib/libmaodbc.so
  48. FileUsage = 1
  49. EOF
  50.  
  51. cat <<EOF > /etc/odbc.ini
  52. [MySQL-asteriskcdrdb]
  53. Description = MySQL connection to 'asteriskcdrdb' database
  54. Driver = MySQL
  55. Server = localhost
  56. Database = asteriskcdrdb
  57. Port = 3306
  58. Socket = /var/run/mysqld/mysqld.sock
  59. Option = 3
  60. EOF
  61.  
  62. https://cloudkul.com/blog/apache-virtual-hosting-with-different-users/
  63.  
  64. mkdir -p /opt/freepbx/freepbx15
  65.  
  66. cat <<EOF > /etc/apache2/sites-available/freepbx.conf
  67. Alias /pgasip /opt/freepbx/freepbx15/
  68. <Directory /opt/freepbx/freepbx15/>
  69. <IfModule mpm_itk_module>
  70. AssignUserId asterisk asterisk
  71. </IfModule>
  72. AllowOverride all
  73. Require all granted
  74. Options indexes FollowSymLinks
  75. </Directory>
  76. EOF
  77.  
  78. a2enmod rewrite
  79. a2ensite freepbx.conf
  80.  
  81.  
  82.  
  83. cd /usr/src
  84. tar xvzf freepbx-15.0-latest.tgz
  85. cd freepbx/
  86. touch /etc/asterisk/{modules,cdr}.conf
  87. ./start_asterisk start
  88. ./install --webroot=/opt/freepbx/freepbx15 -n
  89.  
  90.  
  91.  
  92. fwconsole ma disablerepo commercial
  93. fwconsole ma installall
  94. fwconsole ma delete firewall
  95. fwconsole r
  96.  
  97. #creation service
  98.  
  99. cat <<EOF > /lib/systemd/system/pgasip.service
  100. [Unit]
  101. Description=FreePBX based Astronics PGA VoIP Server
  102. After=mariadb.service
  103.  
  104. [Service]
  105. Type=oneshot
  106. RemainAfterExit=yes
  107. ExecStart=/usr/sbin/fwconsole start -q
  108. ExecStop=/usr/sbin/fwconsole stop -q
  109.  
  110. [Install]
  111. WantedBy=multi-user.target
  112. EOF
  113.  
  114. systemctl enable pgasip.service
  115.  
  116. #creation user
  117.  
  118. https://phoenixnap.com/kb/how-to-create-mariadb-user-grant-privileges
  119.  
  120. mysql
  121.  
  122.  
  123. CREATE USER pgaadmin@localhost IDENTIFIED BY 'c6o4vu6g';
  124. GRANT ALL PRIVILEGES ON *.* TO pgaadmin@localhost IDENTIFIED BY 'c6o4vu6g';
  125. FLUSH PRIVILEGES;
  126.  
  127.  
  128. #hack ??
  129.  
  130. chown -Rfv root:root /var/lib/php/sessions
  131. chmod -Rfv 777 /var/lib/php/sessions
Add Comment
Please, Sign In to add comment