Chapter 3. Installing Asterisk

Table of Contents

Installation Cheat Sheet
Distribution Installation
CentOS Server
Base system installation
Base system update
Enabling NTP for accurate system time
Adding a system user
Ubuntu Server
Base system installation
Base system update
Enable NTP for accurate system time
Software Dependencies
Downloading What You Need
Getting the Source via Subversion
Getting the Source via wget
How to Install It
LibPRI
DAHDI
Asterisk
Setting File Permissions
Base Configuration
Disable SELinux
Initial Configuration
indications.conf and asterisk.conf
modules.conf
musiconhold.conf
make menuselect
Uses for menuselect
menuselect interfaces
Using menuselect
Scripting menuselect
Updating Asterisk
Common Issues
-bash: wget: command not found
configure: error: no acceptable C compiler found in $PATH
make: gcc: command not found
configure: error: C++ preprocessor “/lib/cpp” fails sanity check
configure: error: *** Please install GNU make. It is required to build Asterisk!
configure: *** XML documentation will not be available because the ‘libxml2’ development package is missing.
configure: error: *** termcap support not found
You do not appear to have the sources for the 2.6.18-164.6.1.el5 kernel installed.
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
Upgrading Asterisk
Conclusion

I long to accomplish great and noble tasks, but it is my chief duty to accomplish humble tasks as though they were great and noble. The world is moved along, not only by the mighty shoves of its heroes, but also by the aggregate of the tiny pushes of each honest worker.

Helen Keller

In this chapter we’re going to walk through the installation of Asterisk from the source code. Many people shy away from this method, claiming that it is too difficult and time-consuming. Our goal here is to demonstrate that installing Asterisk from source is not actually that difficult to do. More importantly, we want to provide you with the best Asterisk platform on which to learn.

In this book we will be helping you build a functioning Asterisk system from scratch. In this chapter you will build a base platform for your Asterisk system. Given that we are installing from source, there is potentially a lot of variation in how you can do this. The process we discuss here is one that we’ve used for many years, and following it will provide you with a suitable foundation for Asterisk.

As part of this process we will also explain installation of some of the software dependencies on the Linux platform that will be needed for topics covered later in this book (such as database integration). We will show instructions for installing Asterisk on both CentOS (a Red Hat–based distribution) and Ubuntu (a Debian-based distribution), which we believe covers the vast majority of Linux distributions being installed today. We’ll try to keep the instructions general enough that they should be useful on any distribution of your choice.[17]

We have chosen to install on CentOS and Ubuntu because they are the most popular options, but Asterisk is generally distribution-agnostic. Asterisk will even install on Solaris, BSD, or OS X[18] if you like. We won’t be covering them in this book, though, as Asterisk is most heavily developed on the Linux platform.

Some commands you see in this chapter will be split into separate rows, each labeled for the distribution on which the command should be performed. Commands for which distributions are not specified are for common commands that can be run on both distributions.



[17] If you are using another distribution, we’re willing to bet you are quite comfortable with Linux and should have no trouble installing Asterisk.

[18] Leif calls this “Oh-Eh-Sex,” but Jim thinks it should be pronounced “OS Ten.” We wasted several precious minutes arguing about this.

[19] After you read our book, of course.