+1-323-909-4740 blog@hegars.com

CentOS Install and basic setup


Install from CD


Install Xentools

# mkdir /media/cdrom

# mount /dev/xvdd /media/cdrom

# /media/cdrom/Linux/install.sh

# reboot


Set Hostname

# vim /etc/sysconfig/network

Edit HOSTNAME= to hostname.domain


Enable Network at boot

# vi /etc/sysconfig/network-scripts/ifcfg-eth0

Edit ONBOOT= to yes


# sed -i s/ONBOOT=no/ONBOOT=yes/g /etc/sysconfig/network-scripts/ifcfg-eth0


#service network restart


Disable selinux

Disable SELinux by changing “enforcing” to “disabled” in /etc/selinux/config.


# vi /etc/selinux/config

Edit SELINUX=enforcing to SELINUX=disabled   


# ping

# reboot


Disable Firewall

# service iptables save

# service iptables stop

# chkconfig iptables off


# service ip6tables save

# service ip6tables stop

# chkconfig ip6tables off


Install Network config scripts

# yum install system-config-network*


Install VIM

# yum install vim


Install Web tools

# yum install wget w3m


Install network tools

# yum install tcpdump


Install NTP

# yum install ntp

# chkconfig ntpd on

# ntpdate au.pool.ntp.org

# service ntpd start


Install MySQL

# yum install mysql-server

# service mysqld start

# chkconfig –levels 235 mysqld on  

# mysqladmin -u root password ‘[setpassword]’

# mysql -u root -p


Install Apache

# yum install httpd

# chkconfig –levels 235 httpd on


Install VSFTPD

# yum install vsftpd

# chkconfig vsftpd on



Setup logging and conf


Fixing the home dir issue.

getsebool -a | grep ftp
setsebool -P ftp_home_dir on


fixing “426 Failure writing network stream”.



Install PHP

# yum install php php-mysql


Install JRE

# wget jre-7u25-linux-i586.rpm

# rpm -Uvh jre-7u25-linux-i586.rpm

# java -version


Install phpMyadmin

# rpm -ivh http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/6/i386/epel-release-6-8.noarch.rpm  

# yum update

# yum install phpMyAdmin

# service httpd restart


Comment out Deny alls

# vim /etc/httpd/conf.d/phpMyAdmin.conf

Install openssl

# yum install openssl openssl-devel


Install Webmin

# wget http://prdownloads.sourceforge.net/webadmin/webmin-1.650-1.noarch.rpm

# rpm -Uvh webmin-1.630-1.noarch.rpm


Install Splunk

# rpm -Uvh splunk-5.0.4-172409.i386.rpm

# /opt/splunk/bin/splunk start

# /opt/splunk/bin/splunk enable boot-start

# chkconfig –list | grep splunk



Install OpenFire


# yum install nss-softokn-freebl.i686yum install glibc.i686


Install the database from



# mysql -u root -p

mysql> create database openfire;

mysql> use openfire;

Database Changed

mysql> show tables;

Empty set (0.00 sec)

mysql> source openfire_mysql.sql;

Query OK, 0 rows affected (0.01 sec)


mysql> show tables;


| Tables_in_openfire   |


| ofExtComponentConf   |

| ofGroup              |

| ofGroupProp          |

| ofGroupUser          |

| ofID                 |

| ofMucAffiliation     |

| ofMucConversationLog |

| ofMucMember          |

| ofMucRoom            |

| ofMucRoomProp        |

| ofMucService         |

| ofMucServiceProp     |

| ofOffline            |

| ofPresence           |

| ofPrivacyList        |

| ofPrivate            |

| ofProperty           |

| ofPubsubAffiliation  |

| ofPubsubDefaultConf  |

| ofPubsubItem         |

| ofPubsubNode         |

| ofPubsubNodeGroups   |

| ofPubsubNodeJIDs     |

| ofPubsubSubscription |

| ofRemoteServerConf   |

| ofRoster             |

| ofRosterGroups       |

| ofSASLAuthorized     |

| ofSecurityAuditLog   |

| ofUser               |

| ofUserFlag           |

| ofUserProp           |

| ofVCard              |

| ofVersion            |


34 rows in set (0.00 sec)

mysql> exit



# chown daemon:daemon /opt/openfire/conf/openfire.xml

# service openfire start

# chkconfig –level 235 openfire on



Install Asterisk


For this install I am using Asterisk 11.0.0 and will be compiling from source on CentOS 6.3. This tutorial should also work on Fedora and RHEL (Red Hat Enterprise Linux) systems with little or no modification.


First, you will want to be sure that your server OS is up to date.

yum update -y


Disable SELinux by changing “enforcing” to “disabled” in /etc/selinux/config. Use a text editor or copy and paste this command.

sed -i s/SELINUX=enforcing/SELINUX=disabled/g /etc/selinux/config


After you update and disable SELinux, you’ll need to reboot.



Next, you will want to resolve basic dependencies. (More information on Asterisk dependencies.)

yum install -y make wget openssl-devel ncurses-devel  newt-devel libxml2-devel kernel-devel gcc gcc-c++ sqlite-devel libuuid-devel


Change into the /usr/src/ directory to store your source code.

cd /usr/src/


Download the source tarballs. These commands will get the current release of DAHDI 2.6, libpri 1.4 and Asterisk 11.

wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-1.4-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-11-current.tar.gz


Extract the files from the tarballs.

tar zxvf dahdi-linux-complete*
tar zxvf libpri*
tar zxvf asterisk*


kernel sources for RHEL

yum install kernel-devel-`uname -r`


For the next set of commands it is important to follow the proper order: DAHDI first, then libpri, then Asterisk.

Install DAHDI.

cd /usr/src/dahdi-linux-complete*
make && make install && make config


Install libpri.

cd /usr/src/libpri*
make && make install


Change to the Asterisk directory.

cd /usr/src/asterisk*


In the next step, running the “configure” script will vary depending on whether your system is 32-bit or 64-bit. (Watch the video for more details.) When the menuselect command runs, select your options, then choose “Save and Exit” and the install will continue.


Install Development packages for app_mysql use

yum install mysql-devel


Install Subversion and MP3 sources

yum install subversion



Use this command if you are installing Asterisk on 32bit CentOS.

./configure && make menuselect && make && make install


Use this command if you are installing Asterisk on 64bit CentOS.

&& make && make install


Optional: If ./configure –libdir=/usr/lib64 && make menuselectyou ran into errors you will want to clean the install directory before recompiling.

make clean && make distclean


Once you have an error-free install, copy the sample files from the configs subdirectory into /etc/asterisk.

make samples


Then add the Asterisk start script to the /etc/init.d/ directory

make config


Start DAHDI.

service dahdi start


Start Asterisk.

service asterisk start


Connect to the Asterisk CLI.

asterisk -rvvv


And now you have Asterisk 11 running on CentOS 6! If you’d like to continue configuring Asterisk you can check out this guide to setting up basic pbx functionality



yum install unixODBC unixODBC-devel mysql-connector-odbc php-odbc libtool-ltdl libtool-ltdl-devel