Skip to content

How To: Install Asterisk on CentOS 4.x Step by Step Guide

by Jon on October 22nd, 2009

I have searched a lot on the net a lot for an easy to follow asterisk installation guide but never really found one, so I made my own. I have to install asterisk a lot so it makes it really easy to do the install from a script so you don’t have to sit there running command after command. This is basically a step by step command list to install asterisk. The first section is for the prerequisites to install asterisk and the second section is the actual asterisk installation.

1. Asterisk Prerequisits

yum -y install curl-devel bind-utils system-config-securitylevel kernel kernel-devel kernel-smp-devel kernel-smp openssl-devel openssl gcc gcc-c++ gtk+ gtk+-devel libtermcap-devel newt-devel ncurses-devel mysql mysql-server mysql-devel mysql-server-devel php-mysql httpd ntp wget screen

After doing this command do a reboot then do the next set of commands

2. Asterisk Install

echo “Version 1.1 10/22/09 By jonathanmanning.com”
echo “This will install the asterisk 1.4.26.2 and setup the database”
cd /usr/src/
wget http://jonathanmanning.com/wp-content/uploads/2009/10/cdr_mysql.conf.txt
wget http://jonathanmanning.com/wp-content/uploads/2009/10/asteriskdatabasefull.sql.txt
wget http://downloads.asterisk.org/pub/telephony/dahdi-linux/releases/dahdi-linux-2.2.0.2.tar.gz
wget http://downloads.asterisk.org/pub/telephony/dahdi-tools/releases/dahdi-tools-2.2.0.tar.gz
wget http://downloads.asterisk.org/pub/telephony/libpri/releases/libpri-1.4.10.1.tar.gz
wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-1.4.26.2.tar.gz
tar zxf dahdi-linux-2.2.0.2.tar.gz
tar zxf dahdi-tools-2.2.0.tar.gz
tar zxf libpri-1.4.10.1.tar.gz
tar zxf asterisk-1.4.26.2.tar.gz
cd /usr/src/dahdi-linux-2.2.0.2/
make
make install
echo “######### DAHDI Linux: Installed #############################”
cd /usr/src/dahdi-tools-2.2.0/
./configure
make
make install
make config
echo “######### DAHDI Tools: Installed ##############################”
cd /usr/src/libpri-1.4.10.1/
make
make install
echo “######### Libpri: Installed ##############################”
cd /usr/src/asterisk-1.4.26.2/
./configure
make menuselect
make
make install
make samples
echo “######### Asterisk: Installed #############################”
mv /usr/src/asteriskdatabasefull.sql.txt /usr/src/asteriskdatabasefull.sql
cd /usr/src/
service mysqld start
mysqladmin -u root password ‘pick@p@$$w0rd’
mysql -u root -p’pick@p@$$w0rd’ < asteriskdatabasefull.sql
updatedb
rm -f /etc/asterisk/cdr_mysql.conf
cp /usr/src/cdr_mysql.conf.txt /etc/asterisk/cdr_mysql.conf
chkconfig mysqld on
service mysqld start
echo “######### Database Setup ############################”
cp /usr/src/asterisk-1.4.26.2/contrib/init.d/rc.redhat.asterisk /etc/init.d/asterisk
chmod 755 /etc/init.d/asterisk
echo “service asterisk start” >> /etc/rc.local
service asterisk start
echo “######### Asterisk Installed as Service ############################”
echo “date >> /var/log/server_restart.log ” >> /etc/cron.weekly/hardreset
echo “echo reboot server >> /var/log/server_restart.log ” >> /etc/cron.weekly/hardreset
echo “shutdown -r now ” >> /etc/cron.weekly/hardreset
chmod 755 /etc/cron.weekly/hardreset
echo “######### Weekly Server Reboot ############################”

cdr_mysql.conf

asteriskdatabasefull.sql

From → VOIP

One Comment
  1. The writer of http://www.jonathanmanning.com has written a superior article. I got your point and there is nothing to argue about. It is like the following universal truth that you can not disagree with: Nothing sounds more fun than the sound of a primary school at break time. I will be back.

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS

%d bloggers like this: