Using FreePBX Back End for trixbox CE Authentication

Introduction

One of the cool features of FreePBX that seems to get lost when it goes in to trixbox is the ability to have multiple users. The following article explains how to make teixbox CE 2.4/2.6 use the "administrators" module of FreePBX rather than the standard .htaccess (maint/passw0rd) This obviously is not supported by Rhino, trixbox, or FreePBX and is for informational purposes only that said if you do this make backups of everything. You can not back up the trixbox.conf into the same directory or apache will look at both files. Before doing this go in to FreePBX and make sure you know the username and password, default is admin/admin.

Information

1. Install apache's MySQL auth module:
yum install mod_auth_mysql

2. set authtype=webserver in your amportal.conf
nano -w /etc/amportal.conf

3. Replace the contents of /etc/trixbox/httpdconf/trixbox.conf
nano -w /etc/trixbox/httpdconf/trixbox.conf

Your file should look like this:

<directory>
AllowOverride AuthConfig
Options Indexes FollowSymLinks
order allow,deny
allow from all
AuthType Basic
AuthGroupFile /dev/null
AuthName "Restricted Area"
AuthMySQLEnable                 On
AuthMySQLHost                   localhost
AuthMySQLDB                     asterisk
AuthMySQLUserTable              ampusers
AuthMySQLUser                   asteriskuser
AuthMySQLPassword               amp109
AuthMySQLNameField              username
AuthMySQLPasswordField          password
AuthMySQLAuthoritative          On
AuthMySQLPwEncryption           none
Require valid-user
</directory>

<directory>
AllowOverride AuthConfig
Options Indexes FollowSymLinks
order allow,deny
allow from all
AuthType Basic
AuthGroupFile /dev/null
AuthName "Restricted Area"
AuthMySQLEnable                 On
AuthMySQLHost                   localhost
AuthMySQLDB                     asterisk
AuthMySQLUserTable              ampusers
AuthMySQLUser                   asteriskuser
AuthMySQLPassword               amp109
AuthMySQLNameField              username
AuthMySQLPasswordField          password
AuthMySQLAuthoritative          On
AuthMySQLPwEncryption           none
Require valid-user
</directory>

These use default mysql passwords. If you have changed these you will want to update amp109 above

4. Restart apache and FreePBX
/etc/init.d/httpd restart
amportal restart
Applies To
FreePBX
trixbox CE 2.4
trixbox CE 2.6
Keywords
trixbox CE, FreePBX, Authentication

Author James Finstrom

Original posting at https://support.rhinoequipment.com


Related Content


Comment viewing options

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

Problems

namm86's picture

After I issue /etc/init.d/httpd restart
I get

[trixbox1.localdomain ~]# /etc/init.d/httpd restart
Stopping httpd: [FAILED]
Starting httpd: Syntax error on line 1 of /etc/trixbox/httpdconf/trixbox.conf:
directive requires additional arguments
[FAILED]

I am doing this from a trixbox 2.6 ISO, fresh installation

Thanks in advance For the help in this problem...


namm86, The problem is that

fskrotzki's picture

namm86,

The problem is that the first line in /etc/trixbox/httpdconf/trixbox.conf is not acceptable to apache. It is telling you it needs additional arguments.


I think the two directory

pyclaudio's picture

I think the two directory directives are wrong.
Perhaps they should be:
< directory /var/www/html/admin >
....
< directory /var/www/html/maint >
...