Installation Cheat Sheet

If you just want the nitty-gritty on how to get Asterisk up and running quickly, perform the following at the shell prompt. We encourage you to read through the entire chapter at least once, though, in order to better understand the full process.[20]

The instructions provided here assume you’ve already installed either CentOS or Ubuntu using the steps outlined in the section called “Distribution Installation”.

Note

Remember that Ubuntu requires commands to be prefixed with sudo.

  1. Perform a system update and reboot:

    CentOS

    yum update -y && reboot

    CentOS 64-bit

    yum remove *.i386 && yum update -y && reboot

    Ubuntu

    sudo apt-get update && sudo apt-get upgrade && sudo reboot

  2. Synchronize time and install the NTP (Network Time Protocol) daemon:

    CentOS

    yum install -y ntp && ntpdate pool.ntp.org && chkconfig ntpd \

    on && service ntpd start

    CentOS 64-bit

    yum install -y ntp && ntpdate pool.ntp.org && chkconfig ntpd \

    on && service ntpd start

    Ubuntu

    sudo apt-get install ntp

    Note

    Some additional configuration of text files is required on Ubuntu. See the section called “Enable NTP for accurate system time”.

  3. On CentOS, add a new system user:

    CentOS (32 and 64 bit)

    adduser asteriskpbx && passwd asteriskpbx && yum install \

    sudo && visudo

    Note

    See the section called “Adding a system user” for specific information.

    Note

    For an Ubuntu install, we are assuming that the user created during the installation process is asteriskpbx.

  4. Install software dependencies:

    CentOS

    sudo yum install gcc gcc-c++ make wget subversion \

    libxml2-devel ncurses-devel openssl-devel \

    vim-enhanced

    CentOS 64-bit

    sudo yum install gcc.x86_64 gcc-c++.x86_64 \

    make.x86_64 wget.x86_64 subversion.x86_64 \

    libxml2-devel.x86_64 ncurses-devel.x86_64 \

    openssl-devel.x86_64 vim-enhanced.x86_64

    Ubuntu

    sudo apt-get install build-essential subversion \

    libncurses5-dev libssl-dev libxml2-dev vim-nox

  5. Create your directory structure:

    $ mkdir -p ~/src/asterisk-complete/asterisk
    $ cd ~/src/asterisk-complete/asterisk
  6. Get the latest source code via Subversion:

    $ svn co http://svn.asterisk.org/svn/asterisk/branches/1.8

    Or alternatively, you could check out a specific tag:

    $ svn co http://svn.asterisk.org/svn/asterisk/tags/1.8.1

  7. Build and install the software:

    $ cd ~/src/asterisk-complete/asterisk/1.8/
    $ ./configure
    $ make
    $ sudo make install
    $ sudo make config

  8. Install additional sound prompts from menuselect:

    $ cd ~/src/asterisk-complete/asterisk/1.8/
    $ make menuselect
    $ sudo make install

  9. Modify the file permissions of the directories Asterisk was installed to:

    $ sudo chown -R asteriskpbx:asteriskpbx /usr/lib/asterisk/
    $ sudo chown -R asteriskpbx:asteriskpbx /var/lib/asterisk/
    $ sudo chown -R asteriskpbx:asteriskpbx /var/spool/asterisk/
    $ sudo chown -R asteriskpbx:asteriskpbx /var/log/asterisk/
    $ sudo chown -R asteriskpbx:asteriskpbx /var/run/asterisk/
    $ sudo chown asteriskpbx:asteriskpbx /usr/sbin/asterisk
  10. On CentOS, disable SELinux:

    $ sudo vim /etc/selinux/config

    Change the value of SELINUX from enforcing to disabled, then reboot.

  11. Create the /etc/asterisk/ directory and copy the indications.conf sample file into it:

    $ sudo mkdir -p /etc/asterisk
    $ sudo chown asteriskpbx:asteriskpbx /etc/asterisk
    $ cd /etc/asterisk/
    $ cp ~/src/asterisk-complete/asterisk/1.8/configs/indications.conf.sample \
    ./indications.conf

  12. Copy the sample asterisk.conf file into /etc/asterisk and change runuser and rungroup to have values of asteriskpbx:

    $ cp ~/src/asterisk-complete/asterisk/1.8/configs/asterisk.conf.sample \
    /etc/asterisk/asterisk.conf

    $ vim /etc/asterisk/asterisk.conf

    See the section called “indications.conf and asterisk.conf” for more information.

  13. Create the modules.conf file. Enable loading of modules automatically, and disable extra modules:

    $ cat >> /etc/asterisk/modules.conf
    
    ; The modules.conf file, used to define which modules Asterisk should load (or 
    ; not load).
    ;
    [modules]
    autoload=yes
    
    ; Resource modules currently not needed
    noload => res_speech.so
    noload => res_phoneprov.so
    noload => res_ael_share.so
    noload => res_clialiases.so
    noload => res_adsi.so
    
    ; PBX modules currently not needed
    noload => pbx_ael.so
    noload => pbx_dundi.so
    
    ; Channel modules currently not needed
    noload => chan_oss.so
    noload => chan_mgcp.so
    noload => chan_skinny.so
    noload => chan_phone.so
    noload => chan_agent.so
    noload => chan_unistim.so
    noload => chan_alsa.so
    
    ; Application modules currently not needed
    noload => app_nbscat.so
    noload => app_amd.so
    noload => app_minivm.so
    noload => app_zapateller.so
    noload => app_ices.so
    noload => app_sendtext.so
    noload => app_speech_utils.so
    noload => app_mp3.so
    noload => app_flash.so
    noload => app_getcpeid.so
    noload => app_setcallerid.so
    noload => app_adsiprog.so
    noload => app_forkcdr.so
    noload => app_sms.so
    noload => app_morsecode.so
    noload => app_followme.so
    noload => app_url.so
    noload => app_alarmreceiver.so
    noload => app_disa.so
    noload => app_dahdiras.so
    noload => app_senddtmf.so
    noload => app_sayunixtime.so
    noload => app_test.so
    noload => app_externalivr.so
    noload => app_image.so
    noload => app_dictate.so
    noload => app_festival.so
    
    Ctrl+D
  14. Configure musiconhold.conf:

    $ cat >> musiconhold.conf
    
    ; musiconhold.conf
    [default]
    mode=files
    directory=moh
    
    Ctrl+D
  15. Save your changes and your module configuration is done. Your system is ready to configure your dialplan and channels.



[20] Once you have experience with several Asterisk installations, you’ll agree that it’s a quick and painless process. Nevertheless, this chapter may make the process look complex. This is simply because we have an obligation to ensure you are provided with all the information you need to accomplish a successful install.