Icecast Streaming Media Server Forum Index Icecast Streaming Media Server
Icecast is a Xiph Foundation Project
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Ice 2.3 kh4

 
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server
View previous topic :: View next topic  
Author Message
Anonymous
Guest





PostPosted: Wed Apr 19, 2006 8:03 am    Post subject: Ice 2.3 kh4 Reply with quote

It's me again Smile

I've had some problems on one server with icecast v2.2kh6 just quiting on me when users connect to it.
After i got the "v2.3kh4" working on testserver i thought i could try that one.. so i did, i can connect to streams on it "status page" are empty due ot "hidden" are turned on. If go to "admin" and login, then click "list mountpoints" i get full list over "mountpoints", then i click on the "Lock" icon for "Auth.xsl" it points to serverip:port/admin/auth.xsl, not serverip:port/auth.xsl as i thought it should and i get a

" Could not parse XSLT file " in browser, Icecast dies on me and
this comes in log..

Code:
[2006-04-19  00:42:36] DBUG stats/modify_node_event update node stream_kbytes_sent (501248)
[2006-04-18  20:26:36] EROR slave/start_relay_stream Error from relay request: Service Unavailable
[2006-04-18  20:26:36] EROR slave/start_relay_stream Error from relay request: Service Unavailable
[2006-04-18  20:27:20] EROR xslt/xslt_transform problem reading stylesheet "/home/icecast/icecast/admin/auth.xsl"
[2006-04-18  20:28:36] EROR slave/start_relay_stream Error from relay request: Service Unavailable
[2006-04-18  20:28:36] EROR slave/start_relay_stream Error from relay request: Service Unavailable
[2006-04-18  20:29:59] EROR xslt/xslt_transform problem reading stylesheet "/home/icecast/icecast/admin/auth.xsl"
[2006-04-18  20:30:04] EROR xslt/xslt_transform problem reading stylesheet "/home/icecast/icecast/admin/auth.xsl"
[2006-04-18  20:30:36] EROR slave/start_relay_stream Error from relay request: Service Unavailable
[2006-04-18  20:30:36] EROR slave/start_relay_stream Error from relay request: Service Unavailable
[2006-04-18  20:32:30] EROR xslt/xslt_transform problem reading stylesheet "/home/icecast/icecast/admin/auth.xsl"
[2006-04-18  20:32:36] EROR slave/start_relay_stream Error from relay request: Service Unavailable
[2006-04-18  20:32:36] EROR slave/start_relay_stream Error from relay request: Service Unavailable
[2006-04-18  20:34:36] EROR slave/start_relay_stream Error from relay request: Service Unavailable
[2006-04-18  20:34:36] EROR slave/start_relay_stream Error from relay request: Service Unavailable
[2006-04-18  20:35:45] EROR slave/start_relay_stream Error from relay request: Service Unavailable
[2006-04-18  20:35:45] EROR slave/start_relay_stream Error from relay request: Service Unavailable
[2006-04-18  20:36:57] EROR slave/start_relay_stream Error from relay request: Service Unavailable
[2006-04-18  20:36:57] EROR slave/start_relay_stream Error from relay request: Service Unavailable
[2006-04-18  20:37:37] WARN xslt/xslt_get_stylesheet Error checking for stylesheet file "/home/icecast/icecast/admin/auth.xsl": No such file or directory
[2006-04-18  20:37:37] EROR xslt/xslt_transform problem reading stylesheet "/home/icecast/icecast/admin/auth.xsl"



and i'm wondering about what i do if ogg isnt installed properly.. there is a " thing" to do with the "LD_LIBRARY_PATH OGG" could anybody please help me out here ????
Back to top
Anonymous
Guest





PostPosted: Wed Apr 19, 2006 9:43 am    Post subject: not sure why i get this but... might be part of the solution Reply with quote

i've done the
[/code]libogg-1.1.3 ./config ; make ; make install
placed /usr/local/lib in /etc/ld.so.conf file and run the ldconfig

also done libvorbis-1.1.2 ./configure ; make ; make install
Code:


but if i run
[quote]# rpm -q libogg libvorbis libxml2 libxslt libxslt-devel[/quote]
i get
package libogg is not installed
package libvorbis is not installed

Could this be the reason for "icecast" not working properly ??
as said in prev. msg it starts, users can logon to streams and everything, but it's not 100%...
Back to top
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Wed Apr 19, 2006 10:27 am    Post subject: Reply with quote

The auth.xsl link needs to be fixed, it's just missing the / at the beginning. It will be in the next update but if you want to fix it locally then just edit the admin xsl files.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Anonymous
Guest





PostPosted: Wed Apr 19, 2006 3:42 pm    Post subject: auth problems Reply with quote

Code:
 * action=listener_add&client=1&server=host&port=8000&mount=/live&user=fred&pass=mypass&ip=127.0.0.1&agent=""

ehh not sure what this does but Sad

I have changed the auth script comming with "icecast" so it checks against what i need it to check, not only if user are in mysql but also if sub. is there...
And all testes have been done with "me" as user and that works out of the box it looks like, but i wanted to test with "another" user and that didnt work very well

This is in the "login" box on my webserver..
Code:
form method="GET" action="http://serverip:port/admin/buildm3u">
            Username : <input type="text" name="username" />&nbsp; &nbsp;
            Password : <input type="password" name="password" />&nbsp; &nbsp;
            <input type="hidden" name="mount" value="/stream02.nsv" />
            <input type="Submit" value="Login" />


But user only get up a new loginbox...

On icecast i have this in the mount part..
Code:
        <authentication type="url">
         state username/password if url requires it
        <option name="username" value=""/>
        <option name="password" value=""/>
        <option name="add"    value="http://myserver.com/user/add.php"/>
        <option name="remove" value="http://myserver.com/user/remove.php"/>
        </authentication>


And in that script i have this..


Code:
<?php
// This is a simple example script when using auth url. This sort of
// script would be on a web server that would be invoked by icecast when
// checking for a username/password supplied by a listener.

// This code is made available under the most current version of the GPL
// (c) S.Nixon

 require './mysql.inc.php';

// copy to local variables
$user_name = $HTTP_GET_VARS['user'];
$passwd = $HTTP_GET_VARS['pass'];

if ($user_name && $passwd)
// trying to authenticate
{
    // try authenticating them in
    $login_result = login($user_name, $passwd);
    if ($login_result === true)
    {
      // okay, so they have a valid login
      header('icecast-auth-user: 1');
    } 
    else
    {
      // unsuccessful login, error message should be in $login_result
      header('icecast-auth-user: 0');
      echo 'You could not be logged in for the following reason: '.$login_result.'<br /> You must be authenticated to connect to this stream.<br />';
    }     
}

function login($username, $password)
// check username and password with db
// if yes, return true
// else return an error string...
{

  $username = trim($username);
  // connect to db
  $conn = db_connect();
  if (!$conn)
    return 'Could not connect to database server - please try later.';

  // check username & pass
  // $result = mysql_query("select * from users where user_name='$username' and password = password('$password')");
     $result = mysql_query("SELECT user.password, MD5(CONCAT(MD5('{$password}'), user.salt)), user.userid FROM user WHERE user.username='{$username}'");
 

 if (!$result)
     return 'Could not execute authenication query; please report this to the admin.';
  // if there's exactly one result, the user is validated. Otherwise, they're invalid
  if (mysql_num_rows($result) == 1)
  {   
     return true;
  }
}

function db_connect() {
  $result = mysql_connect(DB_HOSTNAME, DB_USERNAME, DB_PASSWORD)
    or die('Could not open connection to database.');

  mysql_select_db(DB_NAME)
    or die('Could not select db.');
 
  return $result;
}
?>


Somehow this setup worked perfect on icecast 2.2kh6 but now i cant figure out what's going wrong...
Back to top
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Wed Apr 19, 2006 4:26 pm    Post subject: Reply with quote

<option name="add" ....> is not correct and hasn't been for some time now.

the option names are documented, what was "add" is now "listener_add" and what was "remove" is now "listener_remove"

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Anonymous
Guest





PostPosted: Wed Apr 19, 2006 5:22 pm    Post subject: ok, now i have that Reply with quote

now i have

Code:
<authentication type="url">
         state username/password if url requires it
        <option name="username" value=""/>
        <option name="password" value=""/>
        <option name="listener_add"    value="http://myserver.com/user/add.php"/>
        <option name="listener_remove" value="http://myserver.com/user/remove.php"/>
        </authentication>


But i still when i click "login" i get a authentication box comming up asking for username and password..
Back to top
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Wed Apr 19, 2006 5:43 pm    Post subject: Reply with quote

that means it's returning a 401 response to the listener, which in turn indicates that icecast is not getting a favourable response from the backend scripts. Why that is I don't know, I see no information indicating what is passed to and returned from these scripts.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Anonymous
Guest





PostPosted: Wed Apr 19, 2006 5:54 pm    Post subject: yeah i figured that out too Reply with quote

but i have no clue to why...
The script i use works perfect with icecast v 2.2kh6
looks like i just gone have to stick to that then...
and ur work seems to have been a vaste of time cause i need that authentication to work Sad
Back to top
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Wed Apr 19, 2006 6:05 pm    Post subject: Reply with quote

actually no, as you did point out one bug. Also the auth link you gave me works, so can we be more consistent please, in email you say it's ok and on the forum you say it isn't

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Anonymous
Guest





PostPosted: Wed Apr 19, 2006 6:15 pm    Post subject: cant give up yet Reply with quote

this is what i do...
i have a "website" where users can choose what they wanna watch..
they the enter username and password and click login...
this is done with this..

Code:
form method="GET" action="http://serverip:port/admin/buildm3u">
            Username : <input type="text" name="username" />
            Password : <input type="password" name="password" />
            <input type="hidden" name="mount" value="/stream02.nsv" />
            <input type="Submit" value="Login" />


On the icecast server i have this... in the "mount" part... only authentication part listed...



Code:
<authentication type="url">
         state username/password if url requires it
        <option name="username" value=""/>
        <option name="password" value=""/>
        <option name="listener_add"    value="http://myserver.com/user/add.php"/>
        <option name="listener_remove" value="http://myserver.com/user/remove.php"/>
        </authentication>


and then Add.php should fill out and add the info if i got it all right.. and that is done with this script..

Code:
<?php
/*
 *
 *   This script uses the auth_url features from the kH icecast branch
 *   to authenticate users.
 *   
 *
 */

/*
 * Config Constants 
 *   setup constants for MySQL db connection.
 */

 require './mysql.inc.php';
/*
 * auth_url sends the GET vars specified in auth.xsl to the add and delete
 * scripts as POST vars in the form of:
 *
 *   action=auth&id=1&mount=/live&user=fred&pass=mypass&ip=127.0.0.1&agent=""
 */

// store POST vars localy
$username = $_POST['user'];
$password = $_POST['pass'];

if ( login($username, $password) ) {
  header("icecast-auth-user: 1");
} else {
  header('icecast-auth-user: 0');
}

function login($username, $password) {
  if ( empty($username) || empty($password) ) { // check to see if username and password have been supplied
    return false;
  }

  $db = db_connect();

  /*
   * vBulletin3 stores usernames and passwords in the user table.
   */

  //$result = mysql_query("SELECT password, MD5(CONCAT(MD5('{$password}'), salt)) FROM user WHERE username='{$username}'");
  $result = mysql_query("SELECT user.password, MD5(CONCAT(MD5('{$password}'), user.salt)), user.userid FROM user WHERE user.username='{$username}' AND (usergroupid = '2' or usergroupid = '5' or usergroupid = '6' or usergroupid = '7' or usergroupid = '9')");
  if ( !$result ) {
    return false;
  }

  $row = mysql_fetch_row($result);

  mysql_free_result($result);
  mysql_close($db);

  if ( is_array($row) ) {
    if ( $row[0] == $row[1] ) {
    return true;
    }
  }

  return false;
}

function db_connect() {
  $result = mysql_connect(DB_HOSTNAME, DB_USERNAME, DB_PASSWORD)
    or die('Could not open connection to database.');

  mysql_select_db(DB_NAME)
    or die('Could not select db.');
 
  return $result;
}
?>


As said.. this works perfect under icecast 2.2kh6 but i would realy like to get upgraded to 2.3.1kh4

so i just cant figure out why i get a new "login" box after first sending the "login" stated here in the beginning where it also request's the "mount" stream02.nsv....


hoping for some help on this, if not by icecrew someone else who might see where i've made the misstake...
Back to top
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Thu Apr 20, 2006 12:15 am    Post subject: Reply with quote

The problem here was that the script was still sending the icecast-auth-user: 1 header back in all cases.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Anonymous
Guest





PostPosted: Thu Apr 20, 2006 3:32 pm    Post subject: hehe thnks again Reply with quote

thnks again for all help KarlH Very Happy

We're about to upgrade all servers now to icecast 2.3 KH4D
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
subRebel style by ktauber