Anyone who is familiar with Asterisk has probably taken a look at FreePBX at one time or another. I decided to give the newest version of FreePBX a try. Since the Asterisk Driver has only recently come available, there aren’t any good installation guides that I could find. I ended up using the FreeSwitch Installation guide at the FreePBX website as a guide to get started.
I am using Fedora Core 12 with only the standard repos. All software was installed via YUM except for FreePBX which I checked out via subversion. I know a lot of people look at YUM with disgust, but I find it a pretty useful tool. Building from source is fun, but unless I have a real reason to do so I try to stay away from that. I chose Fedora over CentOS because the packages available for CentOS are generally behind (i.e. stable? :P) and FreePBX v3 requires PHP >= 5.2.
So, here are my installation steps to get a working installation of FreePBX v3 and Asterisk 188.8.131.52, which is the latest version available via the Fedora repo.
Loosely based on http://www.freepbx.org/v3/wiki/Installation
Install Fedora Core 12
You can omit nano and use your favorite command line text editor… I like nano.
yum install nano php php-pdo php-mysql php-xml php-xmlrpc php-soap mysql-server mysql libpri libss7 subversion dahdi-tools openssl openssl-devel mod_ssl bind sendmail bison bison-devel gcc gcc-c++ ncurses ncurses-devel zlib zlib-devel gnutls-devel
Optionally install sendmail, bind and configure mod_ssl. Also setup your httpd.conf how you see fit and probably enable AllowOverride All.
service httpd start
service sshd start
service mysqld start
chkconfig mysqld on
chkconfig httpd on
chkconfig sshd on
nano /etc/sysconfig/iptables and ensure you have the rules:
-A INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT
-A INPUT -m state –state NEW -m tcp -p tcp –dport 443 -j ACCEPT
-A input -m state –state NEW -m udp -p udp –dport 5060 -j ACCEPT
-A INPUT -m state –state NEW -m tcp -p tcp –dport 22 -j ACCEPT
nano /selinux/enforce and change 1 to 0
nano /etc/sysconfig/selinux and set selinux=permissive (or disabled)
yum install asterisk
service asterisk start
chkconfig asterisk on
mysqladmin -u root password ‘setyourpasswordhere’
mysql -u root -p
grant all privileges on freepbx.* to freepbx@localhost identified by ‘setpasshere’;
go to your web enabled folder (i.e. /var/www/html) and run: svn co http://www.freepbx.org/v3/svn/trunk freepbx/
chown -R apache:apache freepbx/
enabled=no to enabled = yes
add (i added all privileges which might not be neccessary and made sure i locked down ip / made super secret password):
secret = yoursupersecretpassword
deny = 0.0.0.0/0.0.0.0
permit = 127.0.0.1/255.255.255.0
read = system,call,log,verbose,agent,user,config,command,dtmf,reporting,cdr,dialplan,originate
write = system,call,log,verbose,agent,user,config,command,dtmf,reporting,cdr,dialplan,originate
now go to http://yourhost/freepbx and follow the installer
read, agree, and hit continue
if you get prompted that cache and logs aren’t usable try:
chmod 777 /var/www/html/freepbx/freepbx/cache
chmod 777 /var/www/html/freepbx/freepbx/logs
check to be sure your database settings match what your user / pass was that you granted privileges for and hit continue
select the asterisk driver and enter the info you put in manager.conf
continue, don’t select any modules that arent selected (you can add them later if you want them and can get them to work)
continue through the wizard and you should end up with a working installation.
One nice thing to note is that permissions were greatly simplified with v3 compared to the v2 branch. Essentially, FreePBX now uses Asterisk Manager so it doesnt need access to your /etc/asterisk folder, just the files in your web enabled directory.
Now I know I’m missing some stuff such as asterisk sounds and addons and such but this should be a pretty good start at getting a SIP based Asterisk installation up and running with FreePBX to experiment on. I do not recommend, and niether does FreePBX, using this as a production server yet. The interface is easy to follow so you shouldn’t need any more instructions once you can login.
Good guide to test out FreePBX V3.0