How to convert a stock CentOS 6.x to the FreePBX Distro

I had a few people that needed to take a stock CentOS 6.3, 6.4 or 6.5 system and convert them to the FreePBX Distro. I went ahead and created a new wiki for this and whipped up some scripts that you can use to convert a plain non modified standard CentOS 6.3 into a 3.211.63 Distro or a CentOS 6.4 into a 4.211.64 distro and a CentOS 6.5 into a 5.211.65 distro.

This will convert your CentOS machine into a full fledge supported FreePBX Distro.

 

Please see this wiki.

Because of the way my Virtual Cloud provider is working, I have to install a stock CentOS 6.3 (or 6.4) distro, and start from there, which I did. No luck, I end up with a unusable FreePBX environment. So I took up the script, dealing with it line by line to figure out. And I begin to have problems more or less at FreePBX and enable Modules section.

When I reach that section, I should have a module_admin php script. In fact, I have no /var/lib/asterisk/bin directory at all. Where does this should come from exactly?

I’m stopped there, and I really need to make it work. I tried with a stock CentOS 6.3 (and the appropriate script), and I also tested a stock CentOS 6.3, fully updated to CentOS 6.4, and then used the 4.211.64… script. Still no luck. Both fail at the same place. There mus be something missing.

By the way, I see a couple of lines, a little later:

pull in all freepbx modules and load them

echo “pull in all freepbx modules and load them”
which amportal chown

must be an error, since it makes no sense…

Help !

Christian…

I could guess tell I am blue in the face on this but I know its worked for others in the last couple days. Any chance you can give me SSH access to one of them so I can spend 5 mins and figure out what is failing?

If so PM me the root password and IP address.

Command not found.

this is the error on script.

Enable modules that in 2.11 are not being enabled from the RPM

echo "Enable modules that in 2.11 are not being enabled from the RPM"
sudo -u asterisk /var/lib/asterisk/bin/module_admin enable fw_ari
sudo -u asterisk /var/lib/asterisk/bin/module_admin enable framework
sudo -u asterisk /var/lib/asterisk/bin/module_admin disable fw_fop
sudo -u asterisk /var/lib/asterisk/bin/retrieve_conf
sudo -u asterisk /var/lib/asterisk/bin/module_admin reload

pull in all freepbx modules and load them

echo “pull in all freepbx modules and load them”
which amportal chown

Install all core modules and reload

sudo -u asterisk /var/lib/asterisk/bin/module_admin installall
sudo -u asterisk /var/lib/asterisk/bin/module_admin installall
sudo -u asterisk /var/lib/asterisk/bin/module_admin installall
sudo -u asterisk /var/lib/asterisk/bin/retrieve_conf
sudo -u asterisk /var/lib/asterisk/bin/module_admin reload

Install Misc non Core modules and reload

sudo -u asterisk /var/lib/asterisk/bin/module_admin download sysadmin
sudo -u asterisk /var/lib/asterisk/bin/module_admin install sysadmin
sudo -u asterisk /var/lib/asterisk/bin/module_admin install sysadmin
sudo -u asterisk /var/lib/asterisk/bin/module_admin --repos extended download dahdiconfig
sudo -u asterisk /var/lib/asterisk/bin/module_admin --repos extended install dahdiconfig
sudo -u asterisk /var/lib/asterisk/bin/module_admin --repos commercial installall
sudo -u asterisk /var/lib/asterisk/bin/module_admin download motif
sudo -u asterisk /var/lib/asterisk/bin/module_admin install motif
sudo -u asterisk /var/lib/asterisk/bin/retrieve_conf
sudo -u asterisk /var/lib/asterisk/bin/module_admin reload

sudo -u asterisk /var/lib/asterisk/bin/retrieve_conf
sudo -u asterisk /var/lib/asterisk/bin/module_admin reload

Hi Tony,

Sorry for the delay. I’ll send you user, password, and IP for you to check if you find something.

Thanks,

Christian Tardif
Servinfo

That tells me you dont have the FreePBX RPM installed.

The box that you got me into the FreePBX RPM is failing to completly install because the root user for MySQL has a password and the FreePBX RPM assumes no root password for the MySQL user at install time. Looks like your VPS is setup with a root users password for MySQL. Remove that and do a yum erase freepbx then a yum install freepbx and everything should be fixed.

Mbrevda has a good idea to check and see if MySQL has a root password and if so give a error and exit out. So this happens at the first step of the script now.

Thank you very much Tony! I’ve ran the script again (with MySQL/root password removed) and it completed as expected. You made my… oh well, you made my week!!!

Christian Tardif
Servinfo

Thanks for the script Tony. Very useful for me.

I’m not sure if this is related to this installation script, but after the installation, I was able to configure the admin user with password and e-mail and then, after login in FreePBX I get stuck at the faxpro copyright page. I only get a white page with this text:

“faxpro 2.11.2 Copyright 2013 by Schmoozecom, Inc., All rights reserved By installing, copying, downloading, distributing, inspecting or using the materials provided herewith, you agree to all of the terms of use as outlined in our End User Agreement which can be found and reviewed at www.schmoozecom.com/cmeula built Thu, 04 Apr 2013 14:34:56 +0000 (1365086096) @r24089”.

If I look at the source code of the page, I only see this text with no html tags. I can’t get pass this and get access to FreePBX.

Thanks
Daniel

I was able to get around the problem by using the module_admin command and delete all the, I guess, “Schmoozecom” modules: faxpro, calllimit, webcallback, pagingpro, pinsetspro, vqplus, xmpp, conferencespro, parkpro, endpoint, sysadmin.

Then I was able to gain access to FreePBX

You sure this was Centos 6? Sounds like issue was zendguard for php is missing. What version of PHP do you have installed.

[root@xxxx ~]# cat /etc/redhat-release
CentOS release 6.4 (Final)

[root@xxxx ~]# /usr/bin/php -v
PHP 5.3.3 (cli) (built: Feb 22 2013 02:51:11)
Copyright © 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright © 1998-2010 Zend Technologies
with Zend Guard Loader v3.3, Copyright © 1998-2010, by Zend Technologies

After getting this error in FreePBX “Reload failed because retrieve_conf encountered an error: 126” I found out from this post that I forgot to disable SELINUX:

http://support.freepbx.org/forum/freepbx/installation/freepbx-says-asterisk-not-running-and-reload-failed-because-retrieve-conf

For the record, to disable SELINUX edit “/etc/selinux/config” and set the “SELINUX” option to disabled and reboot.

SELINUX=disabled

Do you think it might be the problem with de modules?

Thanks
Daniel

Excuse my poor english
I’m attempt to insttal the Script in DigitalOcean Cloud, with CentOS 6.4 Final. But I have these errors below

Error: Multilib version problems found. This often means that the root
cause is something else and multilib version checking is just
pointing out that there is a problem. Eg.:

     1. You have an upgrade for krb5-libs which is missing some
        dependency that another package requires. Yum is trying to
        solve this by installing an older version of krb5-libs of the
        different architecture. If you exclude the bad architecture
        yum will tell you what the root cause is (which package
        requires what). You can try redoing the upgrade with
        --exclude krb5-libs.otherarch ... this should give you an error
        message showing the root cause of the problem.

     2. You have multiple architectures of krb5-libs installed, but
        yum can only see an upgrade for one of those arcitectures.
        If you don't want/need both architectures anymore then you
        can remove the one with the missing update and everything
        will work.

     3. You have duplicate versions of krb5-libs installed already.
        You can use "yum check" to get yum show these errors.

   ...you can also use --setopt=protected_multilib=false to remove
   this checking, however this is almost never the correct thing to
   do as something else is very likely to go wrong (often causing
   much more problems).

   Protected multilib versions: krb5-libs-1.10.3-10.el6.i686 != krb5-libs-1.10.3-10.el6_4.2.x86_64

Error: Protected multilib versions: mysql-libs-5.1.67-1.el6_3.i686 != mysql-libs-5.1.69-1.el6_4.x86_64
Error: Protected multilib versions: libselinux-2.0.94-5.3.el6.i686 != libselinux-2.0.94-5.3.el6_4.1.x86_64

Please, help me!

sudo: /var/lib/asterisk/bin/module_admin: command not found
sudo: /var/lib/asterisk/bin/module_admin: command not found
sudo: /var/lib/asterisk/bin/module_admin: command not found
sudo: /var/lib/asterisk/bin/retrieve_conf: command not found
sudo: /var/lib/asterisk/bin/module_admin: command not found
pull in all freepbx modules and load them
which: no amportal in (/usr/lib/qt-3.3/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/root/bin)
chown: missing operand
Try `chown --help’ for more information.
sudo: /var/lib/asterisk/bin/module_admin: command not found
sudo: /var/lib/asterisk/bin/module_admin: command not found
sudo: /var/lib/asterisk/bin/module_admin: command not found
sudo: /var/lib/asterisk/bin/retrieve_conf: command not found
sudo: /var/lib/asterisk/bin/module_admin: command not found
sudo: /var/lib/asterisk/bin/module_admin: command not found
sudo: /var/lib/asterisk/bin/module_admin: command not found
sudo: /var/lib/asterisk/bin/module_admin: command not found
sudo: /var/lib/asterisk/bin/module_admin: command not found
sudo: /var/lib/asterisk/bin/module_admin: command not found
sudo: /var/lib/asterisk/bin/module_admin: command not found
sudo: /var/lib/asterisk/bin/module_admin: command not found
sudo: /var/lib/asterisk/bin/module_admin: command not found
sudo: /var/lib/asterisk/bin/retrieve_conf: command not found
sudo: /var/lib/asterisk/bin/module_admin: command not found

I’ve tried it on a VirtualBox VM with Centos 6.5 minimal and an OVH dedicated server with their Centos 6.5 image and both work great.
Thanks

Hi the script has a little typo at line 146, should be

yum -y install asterisk11 asterisk11-addons asterisk11-addons-bluetooth asterisk11-addons-core asterisk11-addons-mysql asterisk11-addons-ooh323 asterisk11-core asterisk11-curl asterisk11-dahdi asterisk11-flite asterisk11-doc asterisk11-flite-debuginfo asterisk11-voicemail asterisk11-odbc

regards

Nice work.

Inquiring minds what to know. Exactly what is the typo? Before and after would be nice.

Line 146 before :

yum -y install asterisk11-11.6.0 asterisk11-addons-11.6.0 asterisk11-addons-bluetooth-11.6.0 asterisk11-addons-core-11.6.0 asterisk11-addons-mysql-11.6.0 asterisk11-addons-ooh323-11.6.0 asterisk11-core-11.6.0 asterisk11-curl-11.6.0 asterisk11-dahdi-11.6.0 asterisk11-flite-11.6.0 asterisk11-doc-11.6.0 asterisk11-flite-debuginfo-11.6.0 asterisk11-voicemail-11.6.0 asterisk11-odbc-11.6.0

Line 146 after :

yum -y install asterisk11 asterisk11-addons asterisk11-addons-bluetooth asterisk11-addons-core asterisk11-addons-mysql asterisk11-addons-ooh323 asterisk11-core asterisk11-curl asterisk11-dahdi asterisk11-flite asterisk11-doc asterisk11-flite-debuginfo asterisk11-voicemail asterisk11-odbc

Then works perfectly, many thanks