freePBX login error

Discussion in 'General' started by swamarama, Jan 28, 2010.

  1. swamarama

    Joined:
    Jan 24, 2010
    Messages:
    12
    Likes Received:
    0
    first time posting!

    i have setup a new elastix box and made some security updates according to engineer tim's guide.

    after few trial-and-error, it seems to work fine finally, for both ssh and https. i am able to login remotely with non-standard ports and all.

    though for some reason, i cannot access unembedded freepbx! it's keep asking for, login and password over and over again.

    i wonder if you could give me a hand on this. tail of ssl_error_log is as shown below. i'm not much of a coder and it is difficult for me to undertand.

    thanks in advance.

    [Thu Jan 28 10:44:18 2010] [error] [client 12.12.12.200] PHP Notice: Undefined variable: title in /var/www/html/admin/views/freepbx.php on line 46, referer: https://my.domain.name:1991/index.php?menu=pbxconfig
    [Thu Jan 28 10:44:18 2010] [error] [client 12.12.12.200] PHP Notice: Undefined variable: amp_conf in /var/www/html/admin/views/freepbx.php on line 168, referer: https://my.domain.name:1991/index.php?menu=pbxconfig
    [Thu Jan 28 10:46:54 2010] [error] [client 12.12.12.200] PHP Notice: Undefined variable: title in /var/www/html/admin/views/freepbx.php on line 46, referer: https://my.domain.name:1991/admin/config.php
    [Thu Jan 28 10:46:54 2010] [error] [client 12.12.12.200] PHP Notice: Undefined variable: amp_conf in /var/www/html/admin/views/freepbx.php on line 168, referer: https://my.domain.name:1991/admin/config.php
    [Thu Jan 28 10:47:02 2010] [error] [client 12.12.12.200] MySQL user admin not found: /admin/config.php, referer: https://my.domain.name:1991/admin/config.php
    [Thu Jan 28 10:47:02 2010] [error] [client 12.12.12.200] PHP Notice: Undefined variable: title in /var/www/html/admin/views/freepbx.php on line 46, referer: https://my.domain.name:1991/admin/config.php
    [Thu Jan 28 10:47:02 2010] [error] [client 12.12.12.200] PHP Notice: Undefined variable: amp_conf in /var/www/html/admin/views/freepbx.php on line 168, referer: https://my.domain.name:1991/admin/config.php
    [Thu Jan 28 10:47:14 2010] [error] [client 12.12.12.200] MySQL user admin not found: /admin/config.php, referer: https://my.domain.name:1991/admin/config.php
    [Thu Jan 28 10:47:25 2010] [error] [client 12.12.12.200] PHP Notice: Undefined variable: title in /var/www/html/admin/views/freepbx.php on line 46, referer: https://my.domain.name:1991/admin/config.php
    [Thu Jan 28 10:47:25 2010] [error] [client 12.12.12.200] PHP Notice: Undefined variable: amp_conf in /var/www/html/admin/views/freepbx.php on line 168, referer: https://my.domain.name:1991/admin/config.php
    [Thu Jan 28 10:47:38 2010] [error] [client 12.12.12.200] MySQL user admin not found: /admin/config.php, referer: https://my.domain.name:1991/admin/config.php
     
  2. rafael

    Joined:
    May 14, 2007
    Messages:
    1,454
    Likes Received:
    1
    The default user and password is admin/admin, that you should change too ;)

    Please check the book Elastix Without Tears in the download area, it would be very helpful.

    Welcome to the Elastix forums :)

    regards,

    Rafael
     
  3. swamarama

    Joined:
    Jan 24, 2010
    Messages:
    12
    Likes Received:
    0
    i've tried with admin/admin as well as admin/elastix456.
    neither working. and the key is that it's keep on asking as if they are wrong password...
    and i have not changed freepbx password, i mind you.
    any idea?
     
  4. Patrick_elx

    Joined:
    Dec 14, 2008
    Messages:
    1,120
    Likes Received:
    0
    how did you install your system?
    Did you by any chance upgraded freePBX then did a yum update? (regression from FreePBX 2.6 to 2.5 with broken database)

    can you access the pbx tab in the Elastix GUI?
     
  5. swamarama

    Joined:
    Jan 24, 2010
    Messages:
    12
    Likes Received:
    0
    how did you install your system? ---> elastix 1.6 iso

    Did you by any chance upgraded freePBX then did a yum update? (regression from FreePBX 2.6 to 2.5 with broken database) ---> no

    can you access the pbx tab in the Elastix GUI? ---> yes. just that when i select unembedded freepbx, it keep asking me for login/pass.

    maybe the easiest way to resolve this is to re-install...

    i'll try for a day or two more.
     
  6. Patrick_elx

    Joined:
    Dec 14, 2008
    Messages:
    1,120
    Likes Received:
    0
    if it's only a password problem, you can have a look at the mysql database.

    Install phpmyadmin and look at the ampusers table. What entries do you have? You can try to reset the password by creating a new MD5 password.
     
  7. rafael

    Joined:
    May 14, 2007
    Messages:
    1,454
    Likes Received:
    1
  8. swamarama

    Joined:
    Jan 24, 2010
    Messages:
    12
    Likes Received:
    0
    thanks folks.
    i'll give it a shot at it over the weekend.
     
  9. swamarama

    Joined:
    Jan 24, 2010
    Messages:
    12
    Likes Received:
    0
    i've re-installed v1.6 and it is giving me the same error.

    (i should have mentioned this earlier.... :-0)
    i'm thinking it must be due to some sort of conflicts between engineertim's mod_auth_mysql settings and freepbx's own authentication (is it also mod_auth_mysql?).

    when i implement engineertim's mod_auth_mysql setup, should i have somehow excluded /var/www/html/admin directory or something? or is disabling freepbx's authentication easier?
     
  10. rafael

    Joined:
    May 14, 2007
    Messages:
    1,454
    Likes Received:
    1
    Try a clean setup and don't change nothing. Then admin/admin should work.After that you must do something to not be able to change the password.

    Regards,

    Rafael
     
  11. swamarama

    Joined:
    Jan 24, 2010
    Messages:
    12
    Likes Received:
    0
    thanks again for your reply, but i assure you, i was able to login to freePBX with no problem.

    but after applying "securing http" per engineer tim's guide, the failure occurs.

    the below is my version of quick-cheat-sheet of "securing httpd", and i ran it exactly as shown below except login/password at the bottom. please note, i had to modify some since engineer tim's instruction was written for trixbox.

    upon completion, all work beautifully but freePBX login. two different authentication pop-ups keep on alternatively, and as a result i can't get into freePBX.

    any idea folks? perhaps some mistake in the below? please help.

    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    run,

    yum install mod_auth_mysql

    (say Yes)


    edit, /etc/httpd/conf.d/auth_mysql.conf

    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    </Directory>
    <Directory /var/www/html>
    AuthName "Authentication Required"
    AuthType Basic
    AuthMYSQLEnable on
    AuthMySQLUser root
    AuthMySQLPassword eLaStIx.2oo7
    AuthMySQLDB userauth
    AuthMySQLUserTable users
    AuthMySQLNameField user_name
    AuthMySQLPasswordField user_passwd
    AuthMySQLGroupTable groups
    AuthMySQLGroupField user_group
    require group admin
    </Directory>

    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    mysqladmin -uroot -p create userauth
    Enter password: eLaStIx.2oo7


    create a file with below content and name it as, "userauth.schema.sql"

    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


    -- MySQL dump 10.10
    --
    -- Host: localhost Database: userauth
    -- ------------------------------------------------------
    -- Server version5.0.22
    /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
    /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
    /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
    /*!40101 SET NAMES utf8 */;
    /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
    /*!40103 SET TIME_ZONE='+00:00' */;
    /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
    /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
    /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
    /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
    --
    -- Current Database: `userauth`
    --
    CREATE DATABASE /*!32312 IF NOT EXISTS*/ `userauth` /*!40100 DEFAULT CHARACTER SET
    latin1 */;
    USE `userauth`;
    --
    -- Table structure for table `groups`
    --
    DROP TABLE IF EXISTS `groups`;
    CREATE TABLE `groups` (
    `user_name` char(30) NOT NULL,
    `user_group` char(20) NOT NULL,
    PRIMARY KEY (`user_name`,`user_group`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
    --
    -- Table structure for table `users`
    --
    DROP TABLE IF EXISTS `users`;
    CREATE TABLE `users` (
    `user_name` char(30) NOT NULL,
    `user_passwd` char(20) NOT NULL,
    `extension` int(10) NOT NULL,
    `email` char(50) NOT NULL,
    PRIMARY KEY (`user_name`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
    /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
    /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
    /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
    /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
    /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
    /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
    /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
    /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;


    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    then run,
    mysql -uroot -p userauth < userauth.schema.sql


    then run,
    mysql -uroot -p
    Enter password: eLaStIx.2oo7


    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    mysql> use userauth;
    INSERT INTO `userauth`.`users` (`user_name` ,`user_passwd` ,`extension` ,`email`) VALUES ('rootadmin', ENCRYPT('xyz123'),'','' );
    INSERT INTO `groups` VALUES ('rootuser1','user'),('rootadmin','admin');
    mysql> exit

    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     
  12. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    Who is this engineertim and does his advice apply to Elastix?, Elastix uses https not http so whatever his advice is it would probably have to be transcoded to suit.
     
  13. swamarama

    Joined:
    Jan 24, 2010
    Messages:
    12
    Likes Received:
    0
    oh, he is recommended by ben sharif in elastix without tears for securing elastix. yes, you're right that tim's advise is not exactly geared towards elastix, but it seems quite useful.... if one knows how to modify it properly.

    could you?
     
  14. swamarama

    Joined:
    Jan 24, 2010
    Messages:
    12
    Likes Received:
    0
    it'd be super cool if someone could share how to "mod_auth_mysql" with no conflict with freepbx login.

    anyone?
     
  15. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    If you want to be super-super-cool you could maybe turn off the rewrite conditions in

    /etc/httpd/conf.d/elastix.conf

    which will revert Elastix' behavior to http and do it engineertim's way (which I have no doubt is very effective) modified for the different documentroot layout of Elastix if necessary. But I would be careful of updating Elastix after that point in time :):)
     

Share This Page