Notice
This is the process I go through to install Asterisk on Fedora Core 6. I repeated the steps and documented them as thoughraly as I could. I would recommend reading over the entire tutorial first as some commands are eithier optional or only to be done if there is a problem. I have added solutions to each problem that I ran into while preforming this on various hardware so not all commands will be used. In addition, the method of placing source files is presented as three options and you will only need preform one. Enjoy! –kanderson
Tutorial
Install FC6 with no pre-configured options checked. NO CHECKS AT ALL, not even base! This will only require disk 1 (unless you have a RAID array then you will also need disk 3).
Take out the cdrom as instructed and reboot the computer, once you are at the terminal re-insert FC6 disk 1
Logon as Root
Mount the CDROM
mount /dev/cdrom /mnt/cdrom
Install YUM
TIP: Ignore the warnings while installing RPMs
rpm -i /mnt/cdrom/Fedora/RPMS/python-elementtree-1.2.6-5.i386.rpm
rpm -i /mnt/cdrom/Fedora/RPMS/python-sqlite-1.1.7-1.2.1.i386.rpm
rpm -i /mnt/cdrom/Fedora/RPMS/python-urlgrabber-2.9.9-2.noarch.rpm
rpm -i /mnt/cdrom/Fedora/RPMS/yum-metadata-parser-1.0-8.fc6.i386.rpm
rpm -i /mnt/cdrom/Fedora/RPMS/yum-3.0-6.noarch.rpm
Install Kernel Sources
TIP: Do not use yum, get the kernel source off Fedora Core disk one!
ln -s /usr/src/kernels/2.6.18-1.2798.fc6-i686/ /usr/src/linux
Install Compilers
Install WGET (optional)
Install SSH
Start the SSH Daemon
Install VSFTP
Start VSFTP Daemon and Start on Boot
chkconfig vsftpd on
Now place your source files for asterisk, mp3 players, zaptel, and other stuff in /usr/src/
A) via CDROM: (see bellow for what is on my “asterisk kit”)
umount /dev/cdrom
Change cd now.
cp /mnt/cdrom/* /usr/src/ -R
TIP: If you get “umount: /mnt/cdrom: device is busy” preform the following commands otherwise skip them (thanks Morpheo)
cd /
kill -9 `lsof -t /dev/cdrom`
umount /dev/cdrom
rpm -e lsof (optional removal of list open files)
B) via FTP:
change SELINUX=enforcing to SELINUX=disabled
remove root from the list
remove root from the list
You can now log in using your root account via FTP, later we will be changing the FTP files but remember to change SELINUX back to enforcing when done.
C) other methods:
Just worth mentioning that you could use SVN repositories, but we have not installed any method to checkout. Furthermore, you can use wget but I do not have the URL for all the files…
wget http://ftp.digium.com/pub/libpri/releases/libpri-1.2.4.tar.gz
wget http://ftp.digium.com/pub/asterisk/releases/asterisk-1.2.17.tar.gz
wget http://ftp.digium.com/pub/asterisk/releases/asterisk-sounds-1.2.1.tar.gz
wget ftp://rpmfind.net/linux/SuSE-Linux/i386/update/9.3/rpm/i586/madplay-0.15.2b-32.i586.rpm
wget http://ftp.freshrpms.net/pub/freshrpms/fedora/linux/6/libmad/libmad-0.15.1b-4.fc6.i386.rpm
Install Madplay (MOH)
rpm -i /usr/src/libmad-0.15.1b-4.fc6.i386.rpm
rpm -i /usr/src/madplay-0.15.2b-32.i586.rpm
Install MPG123 (MOH)
./configure
make
make install
ln -s /usr/local/bin/mpg123 /usr/bin/mpg123
Install Zaptel
”TIP: If you get a you do not appear to have the source installed error try rebooting (if you have not done so) or that the source is for i686. Also ensure that the /li’b/modules/2.6.18-1.2798.fc6-i686/build is linked to /usr/src/2.6.18-1.2798.fc6-i686/’
make clean
make
make install
make install-udev
make config
TIP: (from a unknown forum) if you get a error referring to inode change this file then repeat the zaptel install. Change the code 2,6,19 to 2,6,18 as follows:
- if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) to
- if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
Start Zaptel
Install LibPRI
make clean
make
make install
Install Asterisk
TIP: If you get a cleantest error make sure you have the latest build of 1.2.17! The first build seemed to have compilation errors on FC6.
make clean
make
make install
make samples
make config
Install Asterisk Sound Pack
make install
Setup Provision Folder from Asterisk@Home Handbook Wiki Chapter 7
TIP: This will create a provisioning account named usrprovis with a password 1234
useradd usrprovis
passwd usrprovis
1234 enter
1234 enter
vi /etc/passwd
Change the line starting with usrprovis to read: usrprovis:x:500:500::/tftpboot:/sbin/nologin
change the following:
chroot_list_enable=YES (make sure it is not commented #)
userlist_enable=YES
userlist_deny=NO
remove everything in this file and add usrprovis
remove everything in this file and add usrprovis
~Notice: You must employ provisioning files that implement the same directory structure or phones will not be able to upload logs!~
chmod u-w . (note the period)
mkdir contacts
mkdir log
mkdir overrides
chown usrprovis log
chgrp usrprovis log
chown usrprovis contacts
chgrp usrprovis contacts
chown usrprovis overrides
chgrp usrprovis overrides
Turn off Firewall
TIP: I would recommend changing the rules instead
Disable Services
For services that are on for the varrious levels use the command chkconfig ${service_name} off to match the chart bellow.
If you want to list all the services out like you see bellow issue the command chkconfig –list
haldaemon 0:off 1:off 2:off 3:on 4:on 5:on 6:off
ip6tables 0:off 1:off 2:off 3:off 4:off 5:off 6:off
iptables 0:off 1:off 2:off 3:off 4:off 5:off 6:off
kudzu 0:off 1:off 2:off 3:on 4:on 5:on 6:off
mcstrans 0:off 1:off 2:on 3:on 4:on 5:on 6:off
messagebus 0:off 1:off 2:off 3:on 4:on 5:on 6:off
netfs 0:off 1:off 2:off 3:off 4:off 5:off 6:off
netplugd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
network 0:off 1:off 2:on 3:on 4:on 5:on 6:off
rdisc 0:off 1:off 2:off 3:off 4:off 5:off 6:off
restorecond 0:off 1:off 2:on 3:on 4:on 5:on 6:off
sshd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
syslog 0:off 1:off 2:on 3:on 4:on 5:on 6:off
vsftpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
zaptel 0:off 1:off 2:on 3:on 4:on 5:on 6:off
Disable Root SSH
First create an account that you can use to login with limited permissions.
passwd sshlogin
1234 enter
1234 enter
Then edit the sshd config
Uncomment PermitRootLogin and change the yes to a no.
TIP: I would recommend changing the port number by uncommenting the line and choosing a random port, the larger the safer. When you ssh the command on the remote client will look like
Install Perl Modules (optional – for Perl based AGI scripts)
perl Makefile.PL
make all
make install
Install DHCP Client (for initial DHCP config)
TIP: Always run production systems with a static IP or MAC reservation!! Asterisk and SIP are sensitive to changing IPs, NAT, and poor DNS.
Install Troubleshooting tools
Realtime DEP (work in progress):
Compile the addons using
./configure –with-mysqlclient=/usr
make menuselect
unselected the already installed addons
make
make install
Remote VM (work in progress):
./configure –with-unixODBC=/usr/local –with-mysql-sources=/usr/local/mysql –enable-gui=no
libtool
Jabber DEP (work in progress):
Other (work in progress):
Folders on cdrom mentioned above:
- agi-bin – my agi scripts
- asterisk-1.2.17 – asterisk source files
- asterisk-sounds – asterisk sound pack
- custom-sounds – sounds that I have added to the default pack
- g729 – codec files
- libpri-1.2.4 – pri source files
- mpg123-0.65 – mpg source files
- zaptel-1.2.16 – zaptel source files
- sipp – sipp (SIP debuging tool) source files
- iperf – network performance tool source files
- libmad-0.15.1b-4.fc6.i386.rpm – dependency for madplay
- madplay-0.15.2b-32.i586.rpm – madplay rpm