Not Logged in - No Account?

Don't have an account? Registering an account with us allows you to post to the forums, easily track new posts, subscribe to threads, pm (private message) other forum members, and receive periodic news letters (you can opt out if you desire). Once you are logged in this message will no longer appear. If you don't have an account, you can create one by registering here. Lost your password, request a new password. We respect your privacy which means we collect minimal information when you register and we do not resell that information or use it in any objectionable way. You can review our privacy policy for full details.


Install process for CentOS 5.1

1. Install CentOS, enabling the following packages:

 

*DNS Server

*Web Server

*Mail Server

*MySQL Database

*Development Tools

 

yum install nano

reboot

 

2. Edit Network settings

 

nano /etc/sysconfig/network

 

HOSTNAME=internal.hostname.DOMAIN.com (Set your internal hostname name here)

 

Ctrl-X to save, 'Y' to confirm

 

nano /etc/sysconfig/network-scripts/ifcfg-eth0

 

IPADDDR=192.168.1.20

NETMASK=255.255.255.0

NETWORK=192.168.1.0

 

Ctrl-X to save, 'Y' to confirm

 

 

echo "options {" >> /etc/named.conf

echo " directory \"/var/named\";" >> /etc/named.conf

echo " dump-file \"/var/named/data/cache_dump.db\";" >> /etc/named.conf

echo " statistics-file \"/var/named/data/named_stats.txt\";" >> /etc/named.conf

echo "};" >> /etc/named.conf

echo "include \"/etc/rndc.key\";" >> /etc/named.conf

 

service named start

 

chkconfig named on

 

nano /etc/resolv.conf

 

search internal.DOMAIN.com (Set your internal domain name here)

nameserver 192.168.1.5

nameserver 127.0.0.1

 

nano /etc/hosts

 

127.0.0.1 internal.hostname.DOMAIN.com (Set your internal hostname name here)

127.0.0.1 asterisk1.local

127.0.0.1 localhost

 

Ctrl-X to save, 'Y' to confirm

 

iptables -P INPUT ACCEPT

iptables -P OUTPUT ACCEPT

iptables -P FORWARD ACCEPT

iptables -F

iptables -X

 

/etc/init.d/iptables save

 

service network restart

 

3. Update:

 

yum -y update

 

4. Disable Selinux:

 

echo "selinux=disabled" > /etc/selinux/config

 

reboot

 

5. Install dependencies and extra packages:

 

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

 

cd /usr/src

 

wget http://easynews.dl.sourceforge.net/sourceforge/lame/lame-3.97.tar.gz

tar zxvf lame-3.97.tar.gz

cd lame-3.97

./configure

make

make install

 

6. Install Asterisk and FreePBX:

 

cd /usr/src

 

wget http://downloads.digium.com/pub/asterisk/asterisk-1.4-current.tar.gz

wget http://downloads.digium.com/pub/asterisk/asterisk-addons-1.4-current.tar...

wget http://downloads.digium.com/pub/zaptel/zaptel-1.4-current.tar.gz

wget http://downloads.digium.com/pub/libpri/libpri-1.4-current.tar.gz

wget http://easynews.dl.sourceforge.net/sourceforge/amportal/freepbx-2.3.1.ta...

 

tar zxvf asterisk-1.4-current.tar.gz

tar zxvf asterisk-addons-1.4-current.tar.gz

tar zxvf zaptel-1.4-current.tar.gz

tar zxvf libpri-1.4-current.tar.gz

tar zxvf freepbx-2.3.1.tar.gz

 

cd /usr/src/zaptel-1.4-current

 

./configure

make

make install

make config

/sbin/ztcfg

 

echo "/sbin/ztcfg" >> /etc/rc.d/rc.local

 

cd /usr/src/libpri-1.4-current

 

./configure

make

make install

 

cd /usr/src/asterisk-1.4-current

 

useradd -c "Asterisk PBX" -d /var/lib/asterisk asterisk

mkdir /var/run/asterisk

mkdir /var/log/asterisk

chown -R asterisk:asterisk /var/run/asterisk

chown -R asterisk:asterisk /var/log/asterisk

chown -R asterisk:asterisk /var/lib/php/session/

 

nano +231 /etc/httpd/conf/httpd.conf

 

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

 

Ctrl-X to save, 'Y' to confirm

 

nano +329 /etc/httpd/conf/httpd.conf

 

Change AllowOverride None to AllowOverride All

 

Ctrl-X to save, 'Y' to confirm

 

./configure

make

make install

 

/etc/init.d/mysqld start

 

cd /usr/src/freepbx-2.3.1

 

mysqladmin create asterisk

mysqladmin create asteriskcdrdb

mysql asterisk < SQL/newinstall.sql

mysql asteriskcdrdb < SQL/cdr_mysql_table.sql

 

mysql

 

GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY 'SOMEPASSWORD';

GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY 'SOMEPASSWORD';

flush privileges;

 

\q

 

mysqladmin -u root password 'SOMEPASSWORD'

 

cd /usr/src/asterisk-addons

 

./configure

make

make install

 

cd /usr/src/freepbx-2.3.1

 

./start_asterisk start

 

./install_amp --username=asteriskuser --password=SOMEPASSWORD

 

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

 

chkconfig httpd on

 

chkconfig mysqld on

 

Open browser to http://ipaddressofpbx/admin

 

Click red bar in FreePBX

 

7. Fix ARI password:

 

nano -w /var/www/html/recordings/includes/main.conf.php

 

$ari_admin_password = "SOMEPASSWORD";

 

Ctrl-X to save, 'Y' to confirm

 

8. Configure Sendmail:

 

nano /etc/mail/sendmail.mc

 

define(`SMART_HOST', `relay.DOMAIN.com)dnl

 

MASQUERADE_AS(`pbx.DOMAIN.com')dnl

 

FEATURE(`masquerade_envelope')dnl

 

Ctrl-X to save, 'Y' to confirm

 

make -C /etc/mail

 

9. Edit sip_nat.conf for proper NAT:

 

nano /etc/asterisk/sip_nat.conf

 

localnet=192.168.1.0/255.255.255.0

externhost=pbx.DOMAIN.com (Set your external hostname name here)

externrefresh=10

fromdomain=DOMAIN.com (Set your external domain name here)

nat=yes

qualify=yes

canreinvite=no

 

Ctrl-X to save, 'Y' to confirm

 

10. Add extra codecs to config:

 

nano /etc/asterisk/sip_custom.conf

 

allow=gsm

allow=h261

allow=h263

allow=h263p

videosupport=yes

 

Ctrl-X to save, 'Y' to confirm

 

nano /etc/asterisk/iax_custom.conf

 

allow=gsm

allow=h261

allow=h263

allow=h263p

videosupport=yes

 

Ctrl-X to save, 'Y' to confirm

 

asterisk -rx reload

 

11. Edit voicemail config:

 

nano /etc/amportal.conf

 

If the web interface on your PBX will be accessible on the internet:

 

AMPWEBADDRESS=pbx.DOMAIN.com (Set your external hostname name here)

 

If the web interface on your PBX will be accessible only on your internal network:

 

AMPWEBADDRESS=internal.hostname.DOMAIN.com (Set your internal hostname name here)

 

Ctrl-X to save, 'Y' to confirm

 

or if your users will NOT have access to the web interface:

 

nano /etc/asterisk/vm_email.inc

 

remove "Visit http://AMPWEBADDRESS/cgi-bin/vmail.cgi?action=login&mailbox=${VM_MAILBOX} to check your voicemail with a web browser.\n"

 

Ctrl-X to save, 'Y' to confirm

 

nano /etc/asterisk/vm_general.inc

 

serveremail=pbx@DOMAIN.com ; Who the e-mail notification should appear to come from

fromstring=DOMAIN PBX ; Real name of email sender

 

Ctrl-X to save, 'Y' to confirm

 

12. Fix MOH directory:

 

ln -s /var/lib/asterisk/moh /var/lib/asterisk/mohmp3

 

asterisk -rx reload

 

14. Open browser to http://ipaddressofpbx

Done!

 

 

Optional Package:

 

ConfControl is a partial rewrite of Web-MeetMe which includes only the conference control page and not all the scheduling options. It includes a replacement index.html page which adds a link to ConfControl from the FreePBX home page.

 

cd /var/www/html

wget http://www.2l2o.com/asterisk/ConfControl1.0.tar.gz

tar zxvf ConfControl1.0.tar.gz

rm ConfControl1.0.tar.gz

Related Content


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

These instructions are outdated and don't work

zeeshan's picture

Somebody seriously need to fix these instructions. They are outdated and don't work.

For example, zaptel doesn't get installed the way it says here (maybe if you have a zaptel device, it will, but for only ztdummy it doesn't). Similarly when you reach to 'mysqld start', you find out that it is not working either, although it is installed on your system. Apparently these instructions were written for some old version of CestOS, not for 5.1. I gave up after trying for a whole day, and will install trixbox instead.


They are not that old. A

fskrotzki's picture

They are not that old. A less then a month old. Some edits just occured a little over a week ago. drmessano I know has several boxes all built after the first of this year using these instructions so they should work.

It is possible that there is a step or two missing by accident. So before accusing somebody of something like posting old instructions it would have been helpful to have posted questions about exactly why your build didn't work at step x, describe what your issue is and how you ran into it. I know he is a very helpful person and would have gladly responded to any request for more information or help if it was just asked.

Yes last I knew he was using zaptel based hardware so that might be one issue is you are not. The other is it looks like he missed a single line before:
make install
that should have:
make
to build the zaptel code. Which if you read the README in the zaptel tarball it would have shown you that.

99% of all posts on this site are from fellow users here and you are getting his information for free. So please be kind to others.

another fellow user.


My apologizes.. Something

drmessano's picture

My apologizes.. Something got lost in translation when I posted this from the doc I keep.

I started off with the old 4.x install guide on another site, and painfully updated it as I went during the 5.1 install. The instructions are not far from the 4.x, but there are very obvious updated between the two, so it actually WORKS on 5.1.

Please let me know if you have any more problems.


Error during installation process

alberto's picture

Hello,
I'm trying to follow your installation procedure.
Some info about my box:

MB: M2N-SLI Deluxe ASUS
CPU: AMD64 4.8 GHz

Here's the output of "make config" when configuring zaptel:

Zaptel has been configured.

If you have any zaptel hardware it is now recommended to
edit /etc/default/zaptel or /etc/sysconfig/zaptel and set there an
optimal value for the variable MODULES .

I think that the zaptel hardware you have on your system is:
pci:0000:01:08.0 zaphfc- 1397:2bd0 HFC-S ISDN BRI card

The following step (/sbin/ztcfg) reports one error, which I don't know how to solve:

Notice: Configuration file is /etc/zaptel.conf
line 0: Unable to open master device '/dev/zap/ctl'

1 error(s) detected

Thanks anticipately for your help.


Modprobe wasn't run...

wanman75's picture

Try this at a terminal prompt:

modprobe wctdm

That should create the /dev/zap/* stuff.


PHP Pear DB

chris.mylonas's picture

Hi,

What will happen with php-pear-DB? Will this be replaced soon?

Cheers
Chris


CDRs and Reports

Joaors01's picture

Hi,
I install everything but the Reports don't work.
I install everything and then reinstall again just in case don't made something good and then the systems don't give me reports, I don't have CDRs
Do you Guys Know Why?
Thank you
Joao


can not access /admin from localhost

dragondad's picture

Your instruction is really good, although it still can be better if more details can be presented.
After follow your instruction, and spend couple of days, now I almost reach the end of the game. Now I face the permission problem, when I try to access the http://localhost, I can not access any one of the three choice.
I try to change the .htaccess, it didn't work, I try to log in as root or asterisk user, no luck.
Could you please give me some hint, thanks in advance.


Re : can not access /admin from localhost

orangisengbanget's picture

just change the permission inside "/var/www/html" with user "asterisk" by using "chown" command.


pidof: command not found

SgtJake's picture

Hi All,

I've followed the install instructions for CentOS 5.1 and get to the install_amp. I get the following.

[root@localhost freepbx-2.3.1]# ./install_amp --username=asteriskuser --password=SOMEPASSWORD
Checking for PEAR DB..OK
Checking for PEAR Console::Getopt..OK
Using username: asteriskuser
Using password: ************
Checking user..OK
Checking if Asterisk is running..sh: pidof: command not found
FAILED
[FATAL] ./install_amp
Asterisk must be running. If this is a first time install, you should start
Asterisk by typing './start_asterisk start'
For upgrading, you should run 'amportal start'

If i run the start_asterisk start i get the following.
STARTING ASTERISK
./start_asterisk: line 36: pidof: command not found
./start_asterisk: line 18: pidof: command not found
./start_asterisk: line 18: pidof: command not found
Asterisk Started

[root@localhost freepbx-2.3.1]# /sbin/pidof asterisk
20560

Any assistance would be great...

Thanks in advance

SGT.


pidof: command not found

orangisengbanget's picture

"pidof" command is located in "/sbin" and default PATH for centos 5.1 doesn't include "/sbin" as its path, so you have to add it manual by using "export PATH=(directory)".


Reports is grayed out

falves2's picture

I had it working fine, but since a few days ago, the reports section is grayed out. I tried to reinstall everything, but it does not work. Th addons are installed, and mysql is working. I have 15 virtual units , here is the strange part, all of them have the same issue. Please give me a clue as how can this happen. My clients are fuming. I don't feel that I need to pay for support twice on the same issue.