Starting Asterisk IP PBX on Amazon AWS EC2 Automatically on Startup

Configuring Asterisk IP PBX running on Amazon AWS EC2 to Start Automatically on Reboot

After I install Asterisk IP PBX on Amazon AWS EC2 Cloud Servers for testing, I usually run a command “make config” to modify the config files so that Asterisk starts automatically upon Server Reboot.  Well this time, it did not work as planned and my Asterisk failed to start resulting in me manually starting Asterisk every time.  On a Production environment, this is a big No No so I had to figure this out.

It turns out that since I am running a Paravirtual instance on AWS, Asterisk was trying to run as ec2-user instead of root user.  Since the ec2-user does not have root access, what changes I made to rc.local file had no affect.  I scoured Google looking for answers to no avail which bring up a point:  It is very hard to find good information on Asterisk out there.  I tried many solutions offered including adding ec2-user to root group membership, changing folder permissions on key Asterisk paths and even modifying the rc.local file to:  “sudo asterisk”.Finally, after some tinkering and thinking about this, the solution was very simple.

Solution that finally worked was to modify the rc.local file located in /etc/and add the following commands:

sudo -i
asterisk

What the commands above does is to elevate to root user then start Asterisk service.  After the edit, a reboot brought up Asterisk automatically.  Perfect!

I hope this article helps you and I would like to hear your comments and also about your experiences with Amazon AWS EC2 servers.

 

——————————

About Express Interconnect: We are a Portland, Oregon based Small Business VoIP Phone Consultant specializing in implementing quality VoIP PBX system based on Asterisk IP PBX. We can be reached at 503-820-3513 or via email at: support@ExpressInterconnect.com and can help with any questions you might have.

Due to Demand, we have finally branched out into Hosted VoIP Phone Service for Small Businesses.  Our Hosted VoIP Service provides full Asterisk IP PBX functionality in a simple Plug and Play system.

Also, please make sure to visit our on-line store at VoIP Phones Direct for all of your IP Phone needs. We carry Grandstream, Polycom, Snom, Aastra, and Yealink IP Phones with a 14 day money back guarantee and FREE UPS Ground Shipping.

Finally, please join the conversation on Facebook AND Twitter

 

Share and Enjoy

Tags: , , , , , , ,

Trackbacks/Pingbacks

  1. ExpressVoice Asterisk AMI Available for Amazon AWS EC2 « Amazon Aws « Small Business VoIP Phone Systems - July 22, 2012

    […] Sound for Asterisk on Amazon AWS EC2 – BLF implementation for Yealink and Grandstream IP Phones – Automatically Starting Asterisk PBX on Amazon AWS EC2 – Transferring Calls Directly to […]

WordPress SEO fine-tune by Meta SEO Pack from Poradnik Webmastera