I HAVE A DREAM incrediblepbx on archlinux vps

hecatae

resident hecatae
Joined
Feb 7, 2014
Messages
760
Reaction score
199
here will follow my notes on installing asterisk 13, freepbx 12 on archlinux, with incrediblepbx added afterwards.

specs of the machine I'm installing on:

cloudatcost 10gb ssd, 512mb ram, 1cpu

I chose the ubuntu 14.04 vps and used https://github.com/drizzt/vps2arch to convert it, I then edited

/etc/pacman.d/mirrorlist
and enabled all the Canadian mirrors, as Cloudatcost is based in Canada.

I ran pacman -Syu to get up to date, and then secured the firewall.

Next I installed Yaourt, as some packages are only available in the Archlinux User Repository,

I edited /etc/pacman.conf

and added the following to the bottom:

Code:
[archlinuxfr]
SigLevel = Never
Server = http://repo.archlinux.fr/$arch

pacman -Syu pulls in the added repository, and pacman -Sy yaourt pulls in yaourt and all dependencies.

packages in the aur cannot be built as root, so I added a local user useradd -m bob and logged out and logged back in as bob.

first I set the variables:

VER_FREEPBX=12.0
ASTERISK_DB_PW=amp109
PHPINI=/etc/php/php.ini
APACHECONF=/etc/httpd/conf/httpd.conf

edit: yaourt uses /tmp to build, /tmp on a 512mb ram install is 247mb, not enough space to build,

temp solution as root:
Code:
mount -o remount,size=1G,noatime /tmp

and then I ran:

yaourt -Sy asterisk mariadb apache php php-apache php-gd php-pear php-ldap php-sqlite php-xsl git fail2ban

will add more when this completes

please note, this is heavily adapted from: http://archlinuxarm.org/forum/viewtopic.php?f=57&t=7480
 
Last edited:

hecatae

resident hecatae
Joined
Feb 7, 2014
Messages
760
Reaction score
199
installed,

ok, next as root:

Code:
systemctl enable mysqld.service
mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
systemctl start mysqld.service
systemctl enable httpd.service
systemctl start httpd.service
systemctl enable fail2ban.service
systemctl start fail2ban.service
pear install db

ok, now we are going to grab and install freepbx 12, recheck the variables:
VER_FREEPBX=12.0
ASTERISK_DB_PW=amp109
PHPINI=/etc/php/php.ini
APACHECONF=/etc/httpd/conf/httpd.conf

and as root:

Code:
cd /usr/src
git clone http://git.freepbx.org/scm/freepbx/framework.git freepbx
cd freepbx
git checkout release/${VER_FREEPBX}

ok, adjusting php.ini now:

Code:
cp ${PHPINI} ${PHPINI}_orig
sed -i 's/;extension=gd.so/extension=gd.so/' $PHPINI
sed -i 's/;extension=ldap.so/extension=ldap.so/' $PHPINI
sed -i 's/;extension=mysqli.so/extension=mysqli.so/' $PHPINI
sed -i 's/;extension=mysql.so/extension=mysql.so/' $PHPINI
sed -i 's/;extension=openssl.so/extension=openssl.so/' $PHPINI
sed -i 's/;extension=pdo_mysql.so/extension=pdo_mysql.so/' $PHPINI
sed -i 's/;extension=pdo_sqlite.so/extension=pdo_sqlite.so/' $PHPINI
sed -i 's/;extension=phar.so/extension=phar.so/' $PHPINI
sed -i 's/;extension=posix.so/extension=posix.so/' $PHPINI
sed -i 's/;extension=sysvmsg.so/extension=sysvmsg.so/' $PHPINI
sed -i 's/;extension=sysvsem.so/extension=sysvsem.so/' $PHPINI
sed -i 's/;extension=sysvshm.so/extension=sysvshm.so/' $PHPINI
sed -i 's/;extension=xmlrpc.so/extension=xmlrpc.so/' $PHPINI
sed -i 's/;extension=xsl.so/extension=xsl.so/' $PHPINI
sed -i 's/;extension=zip.so/extension=zip.so/' $PHPINI
sed -i 's/open_basedir =/; open_basedir =/' $PHPINI
sed -i 's/\(^upload_max_filesize = \).*/\120M/' $PHPINI
sed -i '/session.save_path/asession.save_path=\"\/usr\/include\/php\/ext\/session\"' $PHPINI

adjusting Apache:
Code:
cp ${APACHECONF} ${APACHECONF}_orig
sed -i 's/^\(User\|Group\).*/\1 asterisk/' $APACHECONF
sed -i 's/LoadModule mpm_event_module modules\/mod_mpm_event.so/LoadModule mpm_prefork_module modules\/mod_mpm_prefork.so/' $APACHECONF
sed -i '/LoadModule dir_module modules\/mod_dir.so/aLoadModule php5_module modules\/libphp5.so' $APACHECONF
sed -i '/Include conf\/extra\/httpd-default.conf/aInclude conf\/extra\/php5_module.conf' $APACHECONF
echo " " >> $APACHECONF
echo "# HTAccess for FreePBX" >> $APACHECONF
echo "<Directory \"/srv/http/freepbx\">" >> $APACHECONF
echo "AllowOverride all" >> $APACHECONF
echo "</Directory>" >> $APACHECONF

change webroot directory from /var/www/html to /srv/http/freepbx
Code:
cp install_amp install_amp_orig
sed -i 's/\/var\/www\/html/\/srv\/http\/freepbx/' install_amp

Change permissions on /var/log/asterisk
Code:
chmod 777 /var/log/asterisk

Restart Apache
Code:
systemctl restart httpd.service

Configure MySQL Database
Code:
mysqladmin -u root create asterisk
mysqladmin -u root create asteriskcdrdb
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;"

Finally run the following:
Code:
./start_asterisk start
./install_amp --installdb --username=asteriskuser --password=${ASTERISK_DB_PW}
./start_asterisk stop
./start_asterisk start
amportal a ma installall
amportal a reload
amportal chown

I get stuck at ./install_amp --installdb --username=asteriskuser --password=${ASTERISK_DB_PW}

[root@localhost freepbx]# ./install_amp --installdb --username=asteriskuser --password=${ASTERISK_DB_PW}
Checking for PEAR DB..FAILED
[FATAL] PEAR must be installed (requires DB.php). Include path: .:

any suggestions welcome,

edit found https://github.com/cgueret/Archlinux/blob/master/freepbx/install_amp

reading through,

ok got further,

edit /etc/php/php.ini and update the include_path to find :usr/share/pear

now at:

Code:
[root@localhost freepbx]# ./install_amp --installdb --username=asteriskuser --password=${ASTERISK_DB_PW}
Checking for PEAR DB..OK
Checking for PEAR Console::Getopt..OK
Using username: asteriskuser
Using password: ******
Checking user..OK
Checking if Asterisk is running..running with PID: 24578..OK
Checking for /etc/amportal.conf../etc/amportal.conf does not exist, copying default
Creating new /etc/amportal.conf
Enter your USERNAME to connect to the 'asterisk' database:
 [asteriskuser] asteriskuser
Enter your PASSWORD to connect to the 'asterisk' database:
 [amp109] amp109
Enter the hostname of the 'asterisk' database:
 [localhost] 
Enter a USERNAME to connect to the Asterisk Manager interface:
 [admin] 
Enter a PASSWORD to connect to the Asterisk Manager interface:
 [amp111] amp111
Enter the path to use for your AMP web root:
 [/srv/http/freepbx] 

Created /srv/http/freepbx
Enter the IP ADDRESS or hostname used to access the AMP web-admin:
 [192.168.1.1] 
Use simple Extensions [extensions] admin or separate Devices and Users [deviceanduser]?
 [extensions] 
Enter directory in which to store AMP executable scripts:
 [/var/lib/asterisk/bin] 

Created /var/lib/asterisk/bin
Enter directory in which to store super-user scripts:
 [/usr/local/sbin] 

/etc/amportal.conf writtenAssuming new install, --install-moh added to command line
OK
Reading /etc/amportal.conf..parsed amp_conf variables from /etc/amportal.conf:
amp_conf [AMPDBHOST] => [localhost]
amp_conf [AMPDBENGINE] => [mysql]
amp_conf [AMPENGINE] => [asterisk]
amp_conf [AMPMGRUSER] => [admin]
amp_conf [AMPMGRPASS] => [amp111]
amp_conf [AMPBIN] => [/var/lib/asterisk/bin]
amp_conf [AMPSBIN] => [/usr/local/sbin]
amp_conf [AMPWEBROOT] => [/srv/http/freepbx]
amp_conf [AMPCGIBIN] => [/var/www/cgi-bin ]
amp_conf [FOPWEBROOT] => [/var/www/html/panel]
amp_conf [FOPPASSWORD] => [passw0rd]
amp_conf [AUTHTYPE] => [database]
amp_conf [AMPEXTENSIONS] => [extensions]
amp_conf [AMPDBUSER] => [asteriskuser]
amp_conf [AMPDBPASS] => [amp109]
amp_conf [AMPWEBADDRESS] => [192.168.1.1]
amp_conf [AMPDBNAME] => [asterisk]
OK
Checking for /etc/asterisk/asterisk.conf..OK
Reading /etc/asterisk/asterisk.conf..OK
Using asterisk as PBX Engine
Checking for Asterisk version..13.7.0
Checking for selinux..OK
Connecting to database..FAILED
[FATAL] mysql PHP libraries not installed
 
Last edited:

Members online

No members online now.

Forum statistics

Threads
25,782
Messages
167,509
Members
19,202
Latest member
pbxnewguy
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top