useradd asterisk
=================================================================================================================
一:查看系统中是否缺少以下服务,缺少将用 ”yum install 服务名“来安装
yum install bind httpd sendmail mysql mysql-server
=================================================================================================================
二:禁用Selinux
这个是安全级别和防火墙的东东西,启用会影响我们的freepbx的安装,没多大P用,禁用它:
vi /etc/sysconfig/selinux
把 SELINUX=enforcing
改成 SELINUX=disabled
保存, :wq 最好重启下
reboot
=================================================================================================================
三:安装需要的扩展包
1.
yum install e2fsprogs-devel keyutils-libs-devel krb5-devel libogg libselinux-devel libsepol-devel libxml2-devel
yum install libtiff-devel gmp php-pear php-pear-DB php-gd php-mysql php-pdo kernel-devel ncurses-devel audiofile-devel
yum install libogg-devel openssl-devel mysql-devel zlib-devel perl-DateManip sendmail-cf sox
=================================================================================================================
2. 安装 phpmyadmin,可选
注意:CentOS 5.8里面的php是5.1版本的(php -v),phpmyadmin 3版本需要php 5.2。所以这里我们就用phpmyadmin 2.11好了
下载 phpMyAdmin-2.11.11.2-english.ziphttp://sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/
wget http://jaist.dl.sourceforge.net/project/phpmyadmin/phpMyAdmin/2.11.11/phpMyAdmin-2.11.11-english.zip
unzip phpMyAdmin-2.11.11-english.zip
mv phpMyAdmin-2.11.11-english phpmyadmin
chown asterisk:asterisk -R phpmyadmin/
chmod 777 -R phpmyadmin/
mv phpmyadmin /var/www/html
cd /var/www/html/phpmyadmin/libraries/
vi config.default.php
$cfg['blowfish_secret'] = 'xxxx';
$cfg['Servers'][$i]['password'] = 'passw0rd';
service mysqld start
mysqladmin -u root password "passw0rd"
vi /etc/httpd/conf/httpd.conf
加入 ServerName asterisk18rc2
修改
User asterisk
Group asterisk
chmod 777 /var/lib/php/session/
chmod 777 -R /var/lib/php/session/*
service mysqld restart
/etc/init.d/httpd restart
访问 http://asterisk18rc2/phpmyadmin/
排错:
Forbidden
You don't have permission to access /phpmyadmin/ on this server.
原因1:没有关闭SE Linux,或者关闭了SE Linux配置但是没有reboot Linux
原因2:phpmyadmin的owner不是asterisk,mode不是777
# yum install bison
# yum install bison-devel
# yum install ncurses
# yum install ncurses-devel
# yum install zlib
# yum install zlib-devel
# yum install openssl
# yum install openssl-devel
# yum install gnutls-devel
# yum install gcc
# yum install gcc-c++
# yum install mysql-devel
如果你的系统没有安装kernel-devel,httpd,mysql-server,mysql,mysql-devel,php,php-mysql,perl,libdbi-dbd-mysql和perl-libwww-perl软件包,那么就按照顺序依次安装它们。
备注:可以用rpm -a “软件包名”(上面列出的那几个软件包) 来检查某个是否已经安装;yum install “软件包名”来安装它。
将上述软件包都成功安装完成后需要将httpd和mysql设置成开机自动启动模式。(设置方法请咨询谷哥或谷姐!)
安装dahdi驱动
[root@maple 2.6.32-71.el6.i686]# cd ~ #切换到root主目录下
[root@maple ~]# wget http://downloads.asterisk.org/pub/telephony/dahdi-linux/releases/dahdi-linux-2.5.0.tar.gz #这里我用的dahdi-linux-2.5.0.tar.gz版本
[root@maple ~]# tar -xzf dahdi-linux-2.5.0.tar.gz
[root@maple ~]# cd dahdi-linux-2.5.0
[root@maple dahdi-linux-2.5.0]# make
[root@maple dahdi-linux-2.5.0]# make install
[root@maple dahdi-linux-2.5.0]# cd ..
[root@maple ~]# wget http://downloads.asterisk.org/pub/telephony/dahdi-tools/releases/dahdi-tools-2.5.0.tar.gz
[root@maple ~]# tar -xzf dahdi-tools-2.5.0.tar.gz
[root@maple ~]# cd dahdi-tools-2.5.0
[root@maple dahdi-tools-2.5.0]# ./config
[root@maple dahdi-tools-2.5.0]# make
[root@maple dahdi-tools-2.5.0]# make install
[root@maple dahdi-tools-2.5.0]# make config
[root@maple dahdi-tools-2.5.0]# cd ..
[root@maple ~]# wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-1.4.12.tar.gz
[root@maple ~]# tar -xzf libpri-1.4.12.tar.gz
[root@maple ~]# cd libpri-1.4.12
[root@maple libpri-1.4.12]# make
[root@maple libpri-1.4.12]# make install
[root@maple libpri-1.4.12]# cd ..
●安装asterisk
[root@maple ~]# wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-10.0.0-rc1.tar.gz
[root@maple ~]# tar -xzf asterisk-10.0.0-rc1.tar.gz
[root@maple ~]# cd asterisk-10.0.0-rc1
[root@maple asterisk-10.0.0-rc1]# ./configure
yum install sqlite-devel
[root@maple asterisk-10.0.0-rc1]# make
[root@maple asterisk-10.0.0-rc1]# make install
[root@maple asterisk-10.0.0-rc1]# make samples
[root@maple asterisk-10.0.0-rc1]# make config
[root@maple asterisk-10.0.0-rc1]# cd ..
[root@maple ~]# wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-addons-1.6.2.4.tar.gz
[root@maple ~]# tar -xzf asterisk-addons-1.6.2.4.tar.gz
[root@maple ~]# cd asterisk-addons-1.6.2.4
[root@maple asterisk-addons-1.6.2.4]# ./configure
[root@maple asterisk-addons-1.6.2.4]# make cdr
[root@maple asterisk-addons-1.6.2.4]# cp cdr/cdr_addon_mysql.so /usr/lib/asterisk/modules/
[root@maple asterisk-addons-1.6.2.4]# cd ..
4、安装Freeiris2
我们这里通过SVN来下载Freeiris2源代码:
[root@maple ~]# svn checkout http://darwin.freeiris.org/svn/freeiris/branches/freeiris2 ./freeiris2 #这一步时间有点长,网速快的话相对来说要好点。
[root@maple ~]# cd freeiris2
[root@maple freeiris2]# chmod +x install.pl
[root@maple freeiris2]# ./install.pl --install #这一步可能会报错,提示要关闭selinux才能继续安装。
我们先关闭(disable)selinux:
[root@maple freeiris2]# getenforce #查询当前selinux的状态,发现它是enable的。
关闭selinux的方法有两种:
●修改/etc/selinux/config文件,将SELINUX=disabled ,然后重启系统。(推荐)
●修改/etc/grub.conf,找到kernel /vmlinuz-2.6.32-71.el6.i686 ro root=/dev/mapper/vg_maple-lv_root 这一行,将其改为:
kernel /vmlinuz-2.6.32-71.el6.i686 ro selinux=0 root=/dev/mapper/vg_maple-lv_root
●偏方:如果不想重启系统,使用命令setenforce 0 (这种方法我没试过,如果有尝试过的朋友麻烦将结果告知一下,灰常感谢~~~~)
注:
setenforce 1 设置SELinux 成为enforcing模式
setenforce 0 设置SELinux 成为permissive模式
系统重启后我们进到/root/freeiris2目录下,继续执行:
[root@maple freeiris2]# ./install.pl --install
你将看到如下的安装过程:
Freeiris2 Install Stage by hoowa sun 2.2
sun bing
---------------------------------------------------------------------------------------
WARNING:
This is free Open Source software.
IT COMES WITHOUT WARRANTY OF ANY KIND.
--------------------------------------------------------------------------------------
[STEP] Prerequest checking.........
[STEP] Install files.........
[RESPONSE] create folder --> /freeiris2/
[RESPONSE] Copying /home/hoowa/fri2svn/trunk/* ---> /freeiris2/......
`/freeiris2//contrib/init.d/fri2d' -> `/etc/init.d/fri2d'
`/freeiris2//contrib/init.d/hardware' -> `/etc/init.d/hardware'
#==============================================#
# ______ _ _ ___ #
# | ____| (_) (_) |__ \ #
# | |__ _ __ ___ ___ _ _ __ _ ___ ) | #
# | __| '__ / _ \ / _ \ | '__ | / __| / / #
# | | | | | __ / __ / | | | \ __ \ / /_ #
# | _ | |_| \___| \___| _ |_ | |_ | ___ /____| #
# #
#==============================================#
(......此处省略若干字-_-|||)
#==============================================#
[RESPONSE] install G.729 G.723.1 Binary files
[RESPONSE] set freeiris2 services
[RESPONSE] install example
[RESPONSE] all done!
[RESPONSE] Please Reboot your system!
默认情况下系统是以mysql的localhost root方式登陆,并且自动创建freeiris2库.
OK,大功告成!享受你愉快的Freeiris2之旅吧。。。。