Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash -
- apt install nodejs
- reboot
- wget https://wiki.freepbx.org/download/attachments/122487323/mariadb-connector-odbc_3.0.7-1_amd64.deb
- wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-16-current.tar.gz
- 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://mirror.freepbx.org/modules/packages/freepbx/freepbx-15.0-latest.tgz
- dpkg -i mariadb-connector-odbc_3.0.7-1_amd64.deb
- pear install Console_Getopt
- tar xvzf asterisk-16-current.tar.gz
- cd asterisk-16.9.0/
- ./contrib/scripts/get_mp3_source.sh
- ./contrib/scripts/install_prereq install
- ./configure --with-pjproject-bundled --with-jansson-bundled
- make menuselect.makeopts
- ./menuselect/menuselect --enable app_macro --enable format_mp3 menuselect.makeopts
- make
- make install
- make config
- ldconfig
- update-rc.d -f asterisk remove
- useradd -m asterisk
- chown asterisk. /var/run/asterisk/
- chown -Rfv asterisk. /etc/asterisk/
- chown -Rfv asterisk. /var/{lib,log,spool}/asterisk
- chown -Rfv asterisk. /usr/lib/asterisk
- change upload maxfilesize to 256M
- cat <<EOF > /etc/odbcinst.ini
- [MySQL]
- Description = ODBC for MySQL (MariaDB)
- Driver = /usr/local/lib/libmaodbc.so
- FileUsage = 1
- EOF
- cat <<EOF > /etc/odbc.ini
- [MySQL-asteriskcdrdb]
- Description = MySQL connection to 'asteriskcdrdb' database
- Driver = MySQL
- Server = localhost
- Database = asteriskcdrdb
- Port = 3306
- Socket = /var/run/mysqld/mysqld.sock
- Option = 3
- EOF
- https://cloudkul.com/blog/apache-virtual-hosting-with-different-users/
- mkdir -p /opt/freepbx/freepbx15
- cat <<EOF > /etc/apache2/sites-available/freepbx.conf
- Alias /pgasip /opt/freepbx/freepbx15/
- <Directory /opt/freepbx/freepbx15/>
- <IfModule mpm_itk_module>
- AssignUserId asterisk asterisk
- </IfModule>
- AllowOverride all
- Require all granted
- Options indexes FollowSymLinks
- </Directory>
- EOF
- a2enmod rewrite
- a2ensite freepbx.conf
- cd /usr/src
- tar xvzf freepbx-15.0-latest.tgz
- cd freepbx/
- touch /etc/asterisk/{modules,cdr}.conf
- ./start_asterisk start
- ./install --webroot=/opt/freepbx/freepbx15 -n
- fwconsole ma disablerepo commercial
- fwconsole ma installall
- fwconsole ma delete firewall
- fwconsole r
- #creation service
- cat <<EOF > /lib/systemd/system/pgasip.service
- [Unit]
- Description=FreePBX based Astronics PGA VoIP Server
- After=mariadb.service
- [Service]
- Type=oneshot
- RemainAfterExit=yes
- ExecStart=/usr/sbin/fwconsole start -q
- ExecStop=/usr/sbin/fwconsole stop -q
- [Install]
- WantedBy=multi-user.target
- EOF
- systemctl enable pgasip.service
- #creation user
- https://phoenixnap.com/kb/how-to-create-mariadb-user-grant-privileges
- mysql
- CREATE USER pgaadmin@localhost IDENTIFIED BY 'c6o4vu6g';
- GRANT ALL PRIVILEGES ON *.* TO pgaadmin@localhost IDENTIFIED BY 'c6o4vu6g';
- FLUSH PRIVILEGES;
- #hack ??
- chown -Rfv root:root /var/lib/php/sessions
- chmod -Rfv 777 /var/lib/php/sessions
Add Comment
Please, Sign In to add comment