文章索引
Please follow this link to complete it
http://zoetrope.speakermouth.com/200...install-script
更新:2011-7-24
安裝預裝好的 CentOS 5.5 AMI (ami-eb807682: CentOS5.5 i386 10G)
Download Elastix ISO
http://www.elastix.org/en/downloads/main-distro.html
Prerequisties before intallation starting
cd /mnt
wget http://sourceforge.net/projects/elastix/files/Tools/Cent2Elastix%20%28CentOS%205.4%20to%20Elastix%201.6%20stable%29/ElastiXCorE-1.6-i386-22dec2009.iso/download
mkdir ISO/
mount -o loop ElastiXCorE-1.6-i386-22dec2009.iso ISO/
I modified the official install script to be able to complete the installation of all rpms on EC2.
Turn off firewall
service iptables stop setenforce 0
Install kernel package
註:必須安裝 ISO 內的 kernel-2.6.18-164 及 kernel-xen-2.6.18-164,其餘版本不可使用。
yum remove kernel yum remove kernel-xen cd /mnt/ISO rpm -ivh CentOS/kernel-2.6.18-164.el5.i686.rpm rpm -ivh CentOS/kernel-xen-2.6.18-164.el5.i686.rpm vi /etc/yum.repos.d/ElastixCore.repo
ElastixCore.repo:
[elastix-core] name=Elastix RPM Repository for CentOS baseurl=file:///mnt/ISO/Elastix gpgcheck=0 enabled=1 [epel-elastix] name=EPEL RPM dependencies for Elastix baseurl=file:///mnt/ISO/epel gpgcheck=0 enabled=1
Install Elastix Core
service yum-updatesd stop yum clean all yum groupupdate "Epel Elastix" yum groupupdate "Elastix Core" rm -f /etc/yum.repos.d/ElastixCore.repo
Clean up and reboot
rm -f /etc/yum.repos.d/ElastixCore.repo umount /mnt/ISO reboot
// Install gcc-4.0.2
cd /usr/src wget http://ftp.gnu.org/gnu/gcc/gcc-4.0.2/gcc-4.0.2.tar.bz2 tar -xjf gcc-4.0.2.tar.bz2 cd gcc-4.0.2 mkdir tmp cd tmp ../configure --program-suffix=-4.0.2 make make install
The above will take 20+ minutes, so take a break let's enjoy a coffee.
// Install kernel source (xen-3.1.0-src-ec2-v1.0)
yum install ncurses-devel cd /usr/src wget http://ec2-downloads.s3.amazonaws.com/xen-3.1.0-src-ec2-v1.0.tgz tar xzvf xen-3.1.0-src-ec2-v1.0.tgz cd xen-3.1.0-src-ec2-v1.0 make linux-2.6-xenU-config
rm -f /lib/modules/2.6.18-xenU-ec2-v1.0/build ln -s /usr/src/xen-3.1.0-src-ec2-v1.0/build-linux-2.6.18-xenU_x86_32 \ /lib/modules/2.6.18-xenU-ec2-v1.0/build rm -f /lib/modules/2.6.18-xenU-ec2-v1.0/source ln -s /usr/src/xen-3.1.0-src-ec2-v1.0/linux-2.6.18-xen \ /lib/modules/2.6.18-xenU-ec2-v1.0/source
cd /usr/src/xen-3.1.0-src-ec2-v1.0 mv linux-2.6.18-xen/Makefile linux-2.6.18-xen/Makefile.orig sed -e 's_^\(HOSTCC.*=\).*_\1 /usr/local/bin/gcc-4.0.2_' \ -e 's_^\(CC.*=\).*_\1 /usr/local/bin/gcc-4.0.2_' \ <linux-2.6.18-xen/Makefile.orig >linux-2.6.18-xen/Makefile
make linux-2.6-xenU-build make linux-2.6-xenU-install
// Install dahdi
cd /usr/src/digium wget http://downloads.digium.com/pub/telephony/dahdi-linux/dahdi-linux-current.tar.gz tar xzvf dahdi-linux-current.tar.gz cd dahdi-linux* make clean make all make install
// Install dahdi-tools
cd /usr/src/digium wget http://downloads.asterisk.org/pub/telephony/dahdi-tools/dahdi-tools-current.tar.gz tar xzf dahdi-tools-current.tar.gz cd dahdi-tools* ./configure make make install make config
// 設定只啟動 dahdi_dummy 模組
mv /etc/dahdi/modules /etc/dahdi/modules.orig
echo '# only launch dahdi_dummy' > /etc/dahdi/modules
// 測試 dahdi_dummy 運作
#> service dahdi restart #> dahdi_test -v Opened pseudo dahdi interface, measuring accuracy... 8192 samples in 8198.648 system clock sample intervals (100.081%) 8192 samples in 8205.841 system clock sample intervals (100.169%) 8192 samples in 8182.408 system clock sample intervals (99.883%) 8192 samples in 8190.424 system clock sample intervals (99.981%) 8192 samples in 8190.352 system clock sample intervals (99.980%)
Notes: 數值應該要接近 100%
// 在 EC2 的 Linux 系統環境取得 Public IP
curl http://169.254.169.254/latest/meta-data/public-ipv4