Unable to log in to homer-ui, brand new installation

1,144 views
Skip to first unread message

Homer Newbie

unread,
Aug 4, 2016, 5:09:03 PM8/4/16
to Homer Capture Server. sipcapture.org
I have installed homer5 on RHEL server where Apache/PHP has been installed previously and working fine. I used the following steps for the home-ui installation but I am unable to login. Please help.
I am not sure about what goes into the cgi-bin directory. It is only mentioned in the homer5.apache example file. But there is no other reference such as what files gointo this directory.

In the browser console window I see requests going to http://<IPADDRESS:PORT>/api/v1/session. There is no v1 directory under api.

I am able to login to mysql with home_user/homer_password combination. My test php script (mentioned below) is able to connect to MySQL. In other words, user/php/apache has access to MySQL.

 
 
Environment:
  • RHEL 6 64bit. (Linux host 2.6.32-504.16.2.el6.x86_64 #1 SMP Tue Mar 10 17:01:00 EDT 2015 x86_64 )
  • PHP 5.5.26/pdo_mysql/mysqli/mysqlnd
  • Apache 2.4.20 ( installed in /usr/local/apache2)
  • mysql ver 5.1.73
  • homer web root directory /usr/local/apache2/sipcapture/htdocs
  • homer cgi-bin directory /usr/local/apache2/sipcapture/cgi-bin   (empty directory with no files in it)
Installation steps:
 

# Cloning homer master, i did not understand the purpose of this

cd /usr/local/src
cd homer
git submodule init
git submodule update --init --recursive
git submodule foreach git pull origin master

#Cloning homer-api

#Cloning homer-ui

#Setting up apache webserver

mkdir /usr/local/apache2/sipcapture

#Copying homer-ui files under apache

cp -R homer-ui/ /usr/local/apache2/sipcapture

#Renaming directory

mv  /usr/local/apache2/sipcapture/homer-ui/ /usr/local/apache2/sipcapture/htdocs

#Copying api directory to root web( homer-ui) directory under apache

cp -R homer-api/api/ /usr/local/apache2/sipcapture/htdocs/

#Copying the configuration and preferences files under api directory

cp /usr/local/apache2/htdocs_homer/api/configuration_example.php /usr/local/apache2/htdocs_homer/api/configuration.php
cp /usr/local/apache2/htdocs_homer/api/preferences_example.php /usr/local/apache2/htdocs_homer/api/preferences.php

#Following is the entry VHOST configuration of Apache.

#***************SIP CAPTURE HOMER WEB/GUI/API INTERFACE************

<IfModule !mod_rewrite.c>
LoadModule rewrite_module modules/mod_rewrite.so
</IfModule>

<virtualhost 192.168.11.57:8088>

  ServerAdmin te...@test.com

  ServerName 192.168.11.57:8088

  ServerAlias 192.168.11.57:8088

  DocumentRoot /usr/local/apache2/sipcapture/htdocs

  DirectoryIndex index.html index.htm index.php

  <Directory "/usr/local/apache2/sipcapture/htdocs" >

    Options Indexes FollowSymLinks MultiViews

    AllowOverride All

    Require all granted

  </Directory>

  ScriptAlias /cgi-bin /usr/local/apache2/sipcapture/cgi-bin/

  <Location "/usr/local/apache2/sipcapture/cgi-bin" >

    Options +ExecCGI -MultiViews

    AllowOverride All

    Require all granted

  </Location>

  ErrorLog logs/sipcapture_error.log

  CustomLog logs/sipcapture_access.log combined

</VirtualHost>


I am able to connect to database from a test php script which is saved in the root web directory.

<?php

$servername = "localhost";
$username = "homer_user";
$password = "homer_password";

try {

    $conn = new PDO("mysql:host=$servername;dbname=homer_configuration", $username, $password);
    $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    echo "Connected successfully";
    }
catch(PDOException $e)
    {
    echo "Connection failed: " . $e->getMessage();
    }
?>

 

Following is the browser console output:

Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# instead

HOMER INIT: 5.0.4 Releasecontroller.js:6:9
Error: JSON.parse: unexpected character at line 1 column 1 of the JSON data
angular.min.js:107:210

Unknown Username / Password combinationmodule.auth.run.js:43:11

bad resultmodule.auth.run.js:44:25
Password fields present on an insecure (http://) page. This is a security risk that allows user login credentials to be stolen.[Learn More]192.168.11.57:8088
Password fields present in a form with an insecure (http://) form action. This is a security risk that allows user login credentials to be stolen.[Learn More]192.168.11.57:8088
Use of getPreventDefault() is deprecated.  Use defaultPrevented instead.jquery.min.js:5:12584
Submiting user info.loginCtrl.js:27:22
Error: JSON.parse: unexpected character at line 1 column 1 of the JSON data
angular.min.js:107:210

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

Stack trace:

 

 

Alexandr Dubovikov

unread,
Aug 4, 2016, 5:32:14 PM8/4/16
to homer-...@googlegroups.com

Hi,

please check if you have enabled mod_rewrite.

also you can check if your api works by calling:

http://you.host.org/api/v1/test

you should get back:

Your api call works! Well done!


if not, please check mod_rewrite again.


Wbr,

Alexandr

--
You received this message because you are subscribed to the Google Groups "Homer Capture Server. sipcapture.org" group.
To unsubscribe from this group and stop receiving emails from it, send an email to homer-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Homer Newbie

unread,
Aug 4, 2016, 6:16:19 PM8/4/16
to Homer Capture Server. sipcapture.org
Appreciate your quick response.

Module rewrite has been enabled. API test completed successfully.

Anything else you want me to check?
angular.min.js:107:210

Unknown Username / Password combinationmodule.auth.run.js:43:11

bad resultmodule.auth.run.js:44:25
Password fields present on an insecure (http://) page. This is a security risk that allows user login credentials to be stolen.[Learn More]192.168.11.57:8088
Password fields present in a form with an insecure (http://) form action. This is a security risk that allows user login credentials to be stolen.[Learn More]192.168.11.57:8088
Use of getPreventDefault() is deprecated.  Use defaultPrevented instead.jquery.min.js:5:12584
Submiting user info.loginCtrl.js:27:22
Error: JSON.parse: unexpected character at line 1 column 1 of the JSON data
angular.min.js:107:210

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

Stack trace:

Alexandr Dubovikov

unread,
Aug 4, 2016, 6:19:07 PM8/4/16
to homer-...@googlegroups.com

What do you see in the web console the reply on /api/v1/session  (POST/GET) ?

Lorenzo Mangani

unread,
Aug 4, 2016, 6:23:48 PM8/4/16
to homer-...@googlegroups.com
Are you using the default credentials?

https://github.com/sipcapture/homer-api/blob/master/sql/schema_configuration.sql#L159

Kind Regards,

Lorenzo Mangani
Managing Director and Core Dev

QXIP BV - Capture Engineering
Amsterdam, The Netherlands

Mobile: +31 6 4603-2730

Find our more about HOMER, PCAPTURE, CAPTAGENT and all our Services and Solutions at http://qxip.net 

CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential or legally privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of this original message. 

To unsubscribe from this group and stop receiving emails from it, send an email to homer-discuss+unsubscribe@googlegroups.com.

Homer Newbie

unread,
Aug 4, 2016, 10:45:11 PM8/4/16
to Homer Capture Server. sipcapture.org
Yes, I am using the default credentials. I am able to login to mysql with the same default credentials. I am able to connect to database from a test php script which is saved in the root web directory.

<?php

$servername = "localhost";
$username = "homer_user";
$password = "homer_password";

try {

    $conn = new PDO("mysql:host=$servername;dbname=homer_configuration", $username, $password);
    $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    echo "Connected successfully";
    }
catch(PDOException $e)
    {
    echo "Connection failed: " . $e->getMessage();
    }
?>

Homer Newbie

unread,
Aug 4, 2016, 10:49:33 PM8/4/16
to Homer Capture Server. sipcapture.org
Following is the output from the console log:

Submiting user info. loginCtrl.js:27:22

Error: JSON.parse: unexpected character at line 1 column 1 of the JSON data

Uf/</w.onload@http://192.168.11.57:8088/lib/angular/angular.min.js:93:78
 angular.min.js:107:210

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
Stack trace:
 authentication.js:52:13

Homer Newbie

unread,
Aug 4, 2016, 11:31:38 PM8/4/16
to Homer Capture Server. sipcapture.org
I took pcap trace between server and client and it shows that session got authenticated but for somereason, the login page shows "Email and password combination not recognised".

Here is the TCP view of the pcap trace:


POST /api/v1/session HTTP/1.1
Host: 192.168.11.57:8088
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0
Accept: application/json, text/plain, */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/json;charset=utf-8
Referer: http://192.168.11.57:8088/
Content-Length: 41
Cookie: HOMERSESSID=2fj3dnavcdlko0893bl2f5c067
Connection: keep-alive

{"username":"admin","password":"test123"}HTTP/1.0 200 OK
Date: Fri, 05 Aug 2016 03:23:46 GMT
Server: Apache
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Length: 597
X-FRAME-OPTIONS: SAMEORIGIN
Connection: close
Content-Type: application/json; charset=utf-8


Strict Standards: Declaration of Authentication\Internal::logIn() should be compatible with Authentication\Authentication::login($username, $password) in /usr/local/apache2/sipcapture/htdocs/api/Authentication/Internal.php on line 33
{
    "status": 200,
    "sid": "2fj3dnavcdlko0893bl2f5c067",
    "auth": "true",
    "message": "ok",
    "data": {
        "uid": "1",
        "username": "admin",
        "gid": "10",
        "grp": "users,admins",
        "firstname": "Admin",
        "lastname": "Admin",
        "email": "ad...@test.com",
        "lastvisit": "2016-08-05 03:23:25"

Alexandr Dubovikov

unread,
Aug 5, 2016, 5:08:23 AM8/5/16
to homer-...@googlegroups.com
please disable php notice output and leave only errors. you can do it in php.ini

also you can try this fix, but anyway I recommend disable notice. 

https://github.com/sipcapture/homer-api/commit/7fa23423d2211cab34c138e9a694822c4368b3b8

Wbr,
Alexandr

To unsubscribe from this group and stop receiving emails from it, send an email to homer-discuss+unsubscribe@googlegroups.com.

Homer Newbie

unread,
Aug 5, 2016, 10:02:33 AM8/5/16
to Homer Capture Server. sipcapture.org
Yayyyyyyyyyyyyy..I am able to login. Alex, appreciate your valuable input. It worked after I disabled "notice" in php.ini.
Now, I will work on to get rest of the components working.

Once again, big thanks to you.

Sanjiv

Alexandr Dubovikov

unread,
Aug 5, 2016, 10:03:13 AM8/5/16
to homer-...@googlegroups.com
glad that it works. Enjoy

To unsubscribe from this group and stop receiving emails from it, send an email to homer-discuss+unsubscribe@googlegroups.com.

Homer Newbie

unread,
Aug 11, 2016, 11:13:05 AM8/11/16
to Homer Capture Server. sipcapture.org
Thanks for your valuable support,
Reply all
Reply to author
Forward
0 new messages