A little while ago we mentioned that we had PBX box running trixbox, and that we should probably run the PBX on Ubuntu sooner or later. Well, that time has come. Not only is Ubuntu more familiar and friendly, but I managed to do something bad in the command line with our trixbox. It’s time to bring our PBX a little closer to home.
I’m happy to say that FreePBX and Asterisk are running smoothly on Ubuntu Server 11.04 as I type. The installation is a bit more challenging than trixbox ever was, but hopefully we can reduce some of the sighable moments in this post.
Installing FreePBX/Asterisk on Ubuntu Server 11.04
- Start with this guide from NotANumber. I know it says 10.10, but I followed these instructions EXACTLY on 11.04 and it worked mostly. If things fail, then you probably missed a step (note: you can skip that whole dahdi section if you don’t have the hardware). This may require you to completely re-install Ubuntu Server (I did it about 10 times until I read more carefully).
- Even with the system running and being accessible via the webgui, you will probably notice some errors:
Troubleshooting
- sip_notify.conf symlink error
- Other errors…
The problem should go away once you do the following:
cd /etc/asterisk sudo mv sip_notify.conf sip_notify.conf.old sudo/var/lib/asterisk/bin/retrieve_conf
These should help:
sudo chown www-data:asterisk /etc/amportal.conf
sudo chmod 640 /etc/amportal.conf
sudo amportal chown
Fix the permissions from amportal, add these lines to the end of /etc/amportal.conf:
AMPASTERISKUSER=www-data AMPASTERISKGROUP=asterisk AMPASTERISKWEBUSER=www-data AMPASTERISKWEBGROUP=asterisk
Ports
Based on our past research we recommend (but do not accept responsibility) that you open these ports on your router:
5000-5082 (TCP&UDP)*
8000-20000 (UDP)**
* This covers the standard Asterisk ports 5060 and 5061
** I edited our /etc/asterisk/rtp.conf so that
rtpstart=8000 rtpend=20000
Edit /etc/asterisk/sip_general_custom.conf and add:
nat=yes externip=yourdns.dns.org localnet=192.168.0.0/255.255.255.0
externip is your WAN IP address or static DNS address
localnet is your LAN network “base” and subnetmask. Commonly 192.168.1.0 or 192.168.0.0 .
REBOOT!


Hey, thanks for the follow up on my tutorial. If you have any notes on what was different for Ubuntu 11.04, or suggestions for the tutorial, I would gladly add them to the blog (with the due credits).
Cheers
Hi Pedro! Thanks for your tutorial. It was very helpful. The only part that was a bit confusing was the vhost “pabx.domain” part, so now I have to type in http://ipaddress/pabx.domain/public/
There were no major difference that I noticed between what you wrote and what I needed to do on 11.04. Unfortunately I didn’t really take notes properly when I was working on it. The extra parts I kind of noted at the end. There were quite a few errors to sort through, that I ended up fixing but don’t remember specifically which tweak fixed which error.