Installing FreePBX 2.8 with Asterisk 1.8 on CentOS 5.5

本文详细介绍了如何在CentOS 5.5上安装FreePBX 2.8与Asterisk 1.8的步骤,包括准备环境、安装依赖、配置网络、下载并编译软件包等关键步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Installing FreePBX 2.8 with Asterisk 1.8 on CentOS 5.5

FreePBX has become quite popular over the last few years. Unfortunately, the documentation has not quite caught up to the popularity. At the time of this writing, most of the documentation available was for older versions of CentOS, FreePBX and/or Asterix. Below I have outlined the steps required to get FreePBX 2.8 working with Asterisk 1.8 on CentOS 5.5.


If you are reading this as after having followed the steps in my previous article Installing CentOS 5.5 with Linux Integration Services 2.1 on Hyper-V R2 or if you have not selected the following package groups during your installation of CentOS, make sure you do so now by using the following commands.

Preparations

You will need five different passwords.

PASSWORD1 – Your root password.
PASSWORD2 – Used for the asterisk database user.
PASSWORD3 – Used for the FreePBX administrator.
PASSWORD4 – Used for Flash Operator Panel.
PASSWORD5 – Used for the Asterisk Recording Interface.

Requirements

1
2
3
4
5
yum groupinstall "DNS Name Server"
yum groupinstall "Web Server"
yum groupinstall "Mail Server"
yum groupinstall "MySQL Database"
yum groupinstall "Development Tools"

Once you are sure that the needed package groups are installed, you will want to install the prerequisites as follows.

1
2
3
yum install e2fsprogs-devel keyutils-libs-devel krb5-devel libogg libselinux-devel libsepol-devel libxml2-devel libtiff-devel
yum install gmp php-pear php-pear-DB php-gd php-mysql php-pdo kernel-devel ncurses-devel audiofile-devel libogg-devel
yum install openssl-devel mysql-devel zlib-devel perl-DateManip sendmail-cf sox

Make sure you also have wget installed.

1
yum install wget

Next you will setup named.

1
2
3
4
5
6
7
8
9
10
echo "options {" >> /var/named/chroot//etc/named .conf
echo " directory \"/var/named\";" >> /var/named/chroot//etc/named .conf
echo " dump-file \"/var/named/data/cache_dump.db\";" >> /var/named/chroot//etc/named .conf
echo " statistics-file \"/var/named/data/named_stats.txt\";" >> /var/named/chroot//etc/named .conf
echo "};" >> /var/named/chroot//etc/named .conf
echo "include \"/etc/rndc.key\";" >> /var/named/chroot//etc/named .conf
cd /var/named/chroot//etc/
chmod 640 named.conf
chgrp named named.conf
ln -s /var/named/chroot//etc/named .conf /etc/named .conf

You will want to adjust the security settings as per your requirements but for the simplicity of this article, we are going to turn off Security-Enhanced Linux and open the firewall fully.

1
2
3
4
5
6
7
echo "SELINUX=disabled" > /etc/selinux/config
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -F
iptables -X
/etc/init .d /iptables save

LAME is required for Asterisk’s audio related functions. You will want to download LAME to a source directory, compile and then install it.

1
2
3
4
5
6
7
cd /usr/src
wget http: //downloads .sourceforge.net /project/lame/lame/3 .98.4 /lame-3 .98.4. tar .gz?ts=1292626574&use_mirror=cdnetworks-us-1
tar zxvf lame-3.98.4. tar .gz
cd lame-3.98.4
. /configure
make
make install

You can optionally remove the source once you have installed LAME.

1
2
3
cd ..
rm -fr lame-3.98.4
rm lame-3.98.4. tar .gz

Before continuing, insure that all packages are up to date and then reboot.

1
2
yum update
reboot

Installing Asterisk 1.8

Get Asterisk 1.8 and extract it to its own source folder.

1
2
3
4
5
6
7
cd /usr/src
wget http: //downloads .asterisk.org /pub/telephony/asterisk/asterisk-1 .8-current. tar .gz
tar xvfz asterisk-1.8-current. tar .gz
cd asterisk-1.8.0
contrib /scripts/get_mp3_source .sh
. /configure
make menuconfig

The last command will launch the source configuration manager. The only portions you will want to install are app_mysql, app_saycountpl, cdr_mysql, format_mp3, res_config_mysql and EXTRAS-SOUNDS-EN-GSM (which can be found in the Extra Sound Packages sub-menu). Save your selections and exit. Now compile the source and install.

1
2
make
make install

You can optionally remove the source directory once you have installed Asterisk.

1
2
3
cd ..
rm -fR asterisk-1.8.0
rm asterisk-1.8-current. tar .gz

Installing FreePBX 2.8

Get FreePBX 2.8 and extract it to its own source folder.

1
2
3
4
cd /usr/src
wget http: //mirror .freepbx.org /freepbx-2 .8.0. tar .gz
tar xvfz freepbx-2.8.0. tar .gz
cd freepbx-2.8.0

Start MySQL, create the asterisk databases and run the initial SQL setup scripts.

1
2
3
4
5
6
/etc/init .d /mysqld start
chkconfig mysqld on
mysqladmin create asterisk
mysqladmin create asteriskcdrdb
mysql asterisk < SQL /newinstall .sql
mysql asteriskcdrdb < SQL /cdr_mysql_table .sql

Start the MySQL command line.

1
mysql

Define the user and password for each of the databases.

1
2
3
4
GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY 'PASSWORD2' ;
GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY 'PASSWORD2' ;
flush privileges ;
\q

Change the MySQL user to root.

1
mysqladmin -u root password 'PASSWORD1'

Create the Asterisk user and set folder permissions.

1
2
3
4
useradd -c "Asterisk PBX" -d /var/lib/asterisk asterisk
chown -R asterisk:asterisk /var/run/asterisk
chown -R asterisk:asterisk /var/log/asterisk
chown -R asterisk:asterisk /var/lib/php/session/

Update the Apache configuration file.

1
vi /etc/httpd/conf/httpd .conf

Change User apache and Group apache to User asterisk and Group asterisk.

Change AllowOverride None to AllowOverride All.

Update ServerName to use your server’s FQDN.

Start Apache.

1
2
/etc/init .d /httpd start
chkconfig httpd on

Start Asterisk.

1
. /start_asterisk start

Configure FreePBX.

1
. /install_amp --username=asteriskuser --password=PASSWORD2

The next series of prompts will give you default values within square brackets which you can accept by hitting enter. If you wish to change a value, simply type it and hit enter after.

1
[asteriskuser]

This is the database user you specified earlier.

1
[PASSWORD2]

This is the password for the database user.

1
[localhost]

Use the default value.

1
[admin]

The username for the FreePBX administrator.

1
[amp111]

The password for the FreePBX administrator. It is important to change this. (Use PASSWORD3 you prepared earlier.)

1
[/var/www/html]

Use the default value.

1
[xx.xx.xx.xx]

The public IP that will be used.

1
[passw0rd]

The Flash Operator Panel password. It is important to change this. (Use PASSWORD4 you prepared earlier.)

1
[extensions]

Use the default value.

1
[/var/lib/asterisk/bin]

Use the default value.

1
[/usr/local/sbin]

Use the default value.

Change the Asterisk Recording Interface password and turn on user authentication for the web interface by editing the amportal.conf file.

1
vi /etc/amportal .conf

Change the ARI_ADMIN_PASSWORD entry to update the ARI password.

1
ARI_ADMIN_PASSWORD=PASSWORD5

Change the AUTHTYPE entry to database to enable authentication.

1
AUTHTYPE=database

Optionally, you can turn off the FOP completely by changing the following settings.

1
2
FOPRUN=false
FOPDISABLE=true

Save and exit.

Add FreePBX to the boot process.

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

You can ensure that the administrator user has the proper password in the database by navigating to the Administrators tab, choosing the admin user and clicking on the Update password link. Once your password has been updated, logout by clicking the link at the top right of the page.

Finally, reboot the server one last time.

1
reboot

<think>好的,我现在需要帮助用户解决在基于RPM的Linux发行版上安装软件的问题。用户提到了RedHat Enterprise Linux、CentOS、Fedora和openSUSE这些系统。首先,我应该回想一下这些系统常用的包管理工具。记得RPM是这些系统的包管理基础,主要工具包括Yum和DNF,还有zypper在openSUSE中使用。 接下来,我需要整理安装软件的几种方法。通常,用户可以通过官方仓库直接安装,这是最方便的方式。比如使用yum install或者dnf install命令。另外,有时候软件可能不在官方仓库里,这时候可能需要添加第三方仓库,比如EPEL或者RPM Fusion,这些仓库提供了额外的软件包。用户可能需要先安装epel-release或者启用RPM Fusion仓库,然后再用yum或dnf安装。 第三种情况是用户直接下载了RPM包,这时候可以用rpm -i命令来安装,但需要注意依赖问题。如果依赖较多,手动处理会很麻烦,所以可能的话还是建议通过仓库安装。 还有一种方法是使用第三方提供的自动安装脚本,比如像GitLab提供的脚本,不过要提醒用户注意安全,确保来源可信。 然后,我需要结合用户提供的引用内容。引用[2]提到可以通过Yum仓库安装RabbitMQ,引用[3]提到了使用Yum仓库安装GitLab的例子。这些可以作为具体例子来说明如何添加仓库并安装软件。 此外,用户可能想知道不同发行版之间的差异。例如,openSUSE使用zypper而不是yum/dnf,所以需要单独说明。同时,收费和免费版本在稳定性上的区别,如引用[4]提到的收费版更稳定,可能影响软件安装时的选择。 还需要注意一些常见问题,比如依赖解决、GPG密钥的导入,以及更新缓存的重要性。比如在添加新仓库后,需要运行yum makecache或者dnf makecache来更新元数据。 最后,生成相关问题时要覆盖用户可能进一步关心的方面,比如如何解决依赖、第三方仓库推荐、手动安装与仓库安装的优劣比较,以及特定发行版如openSUSE的注意事项。</think>在基于RPM的Linux发行版(如Red Hat Enterprise Linux、CentOS、Fedora、openSUSE)中安装软件主要有以下方法: ### 一、通过包管理器安装 1. **Yum/DNF(RHEL/CentOS/Fedora)** - 基础命令:`sudo yum install package_name`(CentOS 7及以下) 或`sudo dnf install package_name`(Fedora/CentOS 8+) 例如安装Erlang RPM包: ```bash sudo yum install erlang # 通过预设仓库安装[^2] ``` - 添加第三方仓库(如EPEL/RPM Fusion): ```bash sudo yum install epel-release # 安装EPEL仓库 sudo yum install package_name ``` 2. **Zypper(openSUSE)** ```bash sudo zypper refresh # 更新仓库元数据 sudo zypper install package_name ``` ### 二、直接安装RPM包 1. 下载RPM文件后安装: ```bash sudo rpm -ivh package.rpm # 安装单个包 ``` 2. 自动解决依赖(需配置仓库): ```bash sudo yum localinstall package.rpm # 自动处理依赖[^3] ``` ### 三、通过第三方仓库安装 - **示例:GitLab CE安装** ```bash curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash sudo yum install gitlab-ce # 自动配置仓库并安装[^3] ``` ### 四、源码编译安装(较少用) 需安装编译工具链: ```bash sudo yum groupinstall "Development Tools" ./configure && make && sudo make install ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值