CentOS6.0下安装Freeiris2/Asterisk全程指导教程

来源:互联网 发布:登录页面sql注入 编辑:程序博客网 时间:2024/06/09 07:26
 

说明:首先在安装CentOS6.0时选择“Software Development Workstation”版本,这样就会在/usr/src/kernels目录下自动生成内核源码树目录,如果是选择其他版本的可能需要下载内核源码包kernel-2.6.32-71.el6.src.rpm,然后手动安装内核源码。关于手动安装内核源码包得方法,google一下,这样的教程还是比较多,而且也不难。本教程中我只针对“Software Development Workstation”版本做介绍。

CentOS6.0的内核版本为2.6.32-71.el6.i686

 

1、下载内核源代码。

这里我们到http://www.kernel.org去下载linux-2.6.32.tar.gz。

[root@maple ~]# cd /usr/src/

[root@maple src]# wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.32.tar.gz    #下载源码包

[root@maple src]# tar -xzf linux-2.6.32.tar.gz                      #解压

[root@maple src]# mv linux-2.6.23 linux                       #目录重命名

因为当编译某些包时它会到/usr/src/linux目录下去找内核源代码,为了解决这样的问题,你可以给它指定内核源码目录,也可以像我这样做重命名。

[root@maple src]# ls kernels/2.6.32-71.el6.i686/
arch    drivers   include  kernel        Makefile         Module.symvers  scripts  System.map virt
block   firmware  init     lib           Makefile.common net             security  tools
crypto  fs        ipc      linux-2.6.32  mm               samples         sound     usr


我们可以看到在/usr/src/kernels/2.6.32-71.el6.i686/目录下有个无效的符号链接linux-2.6.32 ,我们接下来要做的其实就就非常简单了:

[root@maple src]# cd kernels/2.6.32-71.el6.i686/                         #切换目录
[root@maple 2.6.32-71.el6.i686]# rm linux-2.6.32                         #删除无效的符号链接

[root@maple 2.6.32-71.el6.i686]# ln -s ../../linux  linux-2.6.32      #重新建立到内核源代码目录的符号链接

至此,我们的内核环境就已经搭好了。

 

2、搭建基础环境。

如果你的系统没有安装kernel-devel,httpd,mysql-server,mysql,mysql-devel,php,php-mysql,perl,libdbi-dbd-mysql和perl-libwww-perl软件包,那么就按照顺序依次安装它们。

备注:可以用rpm -a “软件包名”(上面列出的那几个软件包) 来检查某个是否已经安装;yum install “软件包名”来安装它。

将上述软件包都成功安装完成后需要将httpd和mysql设置成开机自动启动模式。(设置方法请咨询谷哥或谷姐!)

 

3、安装asterisk相关软件包。

●安装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

[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之旅吧。。。。