CentOS 5.8 asterisk-1.8.10.1 安装之安装freepbx

接上部:CentOS 5.8 asterisk-1.8.10.1 安装之一:安装,添加蓝牙支持,添加AMR-NB audio codec

参考: CentOS 5.8 Aasterisk 1.8 rc2 安装freepbx

http://blog.csdn.net/jianghao616/article/details/6059658


环境:

CentOS 5.8

asterisk-1.8.10.1


=================================================================================================================


一:查看系统中是否缺少以下服务,缺少将用 ”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-server 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.zip
http://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://asterisk18/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


=================================================================================================================
2:安装 lame
       #  wget http://sourceforge.net/projects/lame/files/lame/3.99/lame-3.99.5.tar.gz/download
or  http://nchc.dl.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz
       #  tar zxvf lame-3.99.5.tar.gz
       #  cd lame-3.99.5
       #  ./configure
       #  make
       #  make install

=================================================================================================================

四:安装FreePBX
    这个必须在asterisk 完全安装后才能装
    下载地址:可以到 http://www.freepbx.org(官方)
wget http://mirror.freepbx.org/freepbx-2.9.0.tar.gz
 # tar -xvf freepbx-2.9.0.tar.gz
     # cd freepbx-2.9.0
     # ./start_asterisk start



这里要注意的是。首先我们必须吧mysql密码设置为空,方便运行以下命令(建立相关asterisk 数据库)
/etc/init.d/mysqld start
mysql  -u root -ppassw0rd
mysql> set password for root@localhost=password('');

mysql> exit;


mysql  -u root   (测试可以空口令登录)



     # mysqladmin create asterisk 


     # mysqladmin create asteriskcdrdb


     # mysql asterisk < SQL/newinstall.sql


     # mysql asteriskcdrdb < SQL/cdr_mysql_table.sql


     # mysql


mysql> GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY 'passw0rd';

mysql> GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY 'passw0rd';

mysql>  flush privileges;
mysql> quit;




好了,现在我们又得把mysql密码设置不能为空(   mysqladmin -u root password "passw0rd"      ),方便运行以下命令


 # ./install_amp --username=root --password=passw0rd          //这里我的mysql用名为root,密码是passw0rd
Checking for PEAR DB..OK
Checking for PEAR Console::Getopt..OK
Using username: root
Using password: ********
Checking user..OK
Checking if Asterisk is running..running with PID: 4173..OK
Checking for /etc/amportal.conf../etc/amportal.conf does not exist, copying defa
ult
Creating new /etc/amportal.conf
Enter your USERNAME to connect to the 'asterisk' database:
 [root]
Enter your PASSWORD to connect to the 'asterisk' database:
 [passw0rd]
Enter the hostname of the 'asterisk' database:
 [localhost]
Enter a USERNAME to connect to the Asterisk Manager interface:
 [admin]
Enter a PASSWORD to connect to the Asterisk Manager interface:
 [amp111]
Enter the path to use for your AMP web root:
 [/var/www/html]


Enter the IP ADDRESS or hostname used to access the AMP web-admin:
 [xx.xx.xx.xx] asterisk18
Enter a PASSWORD to perform call transfers with the Flash Operator Panel:
 [passw0rd]
Use simple Extensions [extensions] admin or separate Devices and Users [devicean
duser]?
 [extensions]
Created /var/lib/asterisk/bin
Enter directory in which to store super-user scripts:
 [/usr/local/sbin]






    #  echo "/usr/local/sbin/amportal start" >> /etc/rc.local


    # chkconfig httpd on


    # chkconfig mysqld on


OK 安装完成 # reboot




chmod 777 /var/www/html -R
cd /var/lib/asterisk/
 chmod 777 bin 
 chmod -R 777 bin/*


chmod 777 /var/lib/php/session/
chmod 777 -R /var/lib/php/session/*




http://192.168.100.128

缺省用户名口令为admin/admin

第一次登陆管理界面,需要apply configuration


============================================================
现在你可以创建SIP号码,trunk了

============================================================

排错:日志:
tail -f /var/log/httpd/access_log 
tail -f /var/log/httpd/error_log


/var/log/mysqld.log
asterisk 日志
tail -f /var/log/asterisk/full
tail -f /var/log/asterisk/freepbx.log


排错:检查数据访问
mysql -h localhost -u root -ppassw0rd
use asterisk;

排错:
http://192.168.158.134/phpmyadmin/

============================================================
提示:

 /etc/amportal.conf

控制谁能用amp 管理协议访问asterisk服务器
/etc/asterisk/manager.conf



freepbx 忘记密码的解决办法:按照文章修改口令为freepbx后,登录FreePBX Administration页面并修改口令。

http://hi.baidu.com/qiqi7036/item/a83f10cda2ef1416b67a2422


你可能感兴趣的:(CentOS 5.8 asterisk-1.8.10.1 安装之安装freepbx)