LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-01-2005, 08:13 AM   #1
deus1
Member
 
Registered: Jan 2005
Distribution: Suse 9.1 pro
Posts: 35

Rep: Reputation: 15
[perl] getting apache::mp3 module working


I was looking for nice MP3 streaming software so I could be able to
play the audio files from my computer. This is how I got the apache::MP3
project. The problem is that I can't get it working in the right way
and I'm wondering whether you can help me out. I'll start to describe
what I've done already:

1. Install apache version 2.0.49
2. Install mod_perl: 1.99_12_20040302
3. Install perl-mp3-info1.11-1.i586.rpm
4. Install apache-mp3-3.05

I had to change some code in MP3.pm to get it working:
1. Turn warnings on in this file for better debugging:
use warnings;
no warnings 'redefine';
2. Change code:

Code:
my $NO  = '^(no|false)$';  # regular expression
my $YES = '^(yes|true)$';  # regular expression

my $JSCRIPT=<<END;
function toggleAll(self,field) {
 if(self.checked == true){
       for (i = 0; i < field.length; i++)
         field[i].checked = true ;
 } else {
       for (i = 0; i < field.length; i++)
         field[i].checked = false ;
 }
}
END

sub handler ($$) {
my $class = shift;
my $obj = $class->new(@_) or die "Can't create object: $!";
     return $obj->run();
}
to this:

Code:
my $NO  = '^(no|false)$';  # regular expression
my $YES = '^(yes|true)$';  # regular expression

my $JSCRIPT=<<END;
function toggleAll(self,field) {
 if(self.checked == true){
       for (i = 0; i < field.length; i++)
         field[i].checked = true ;
 } else {
       for (i = 0; i < field.length; i++)
         field[i].checked = false ;
 }
}
END

sub handler : method {
 my $class = shift;
 my $obj = $class->new(@_) or die "Can't create object: $!";
 return $obj->run();
}
And:

Code:
y $self = shift;
 my $dir = shift;
 unless ($self->r->path_info){
to this:

Code:
y $self = shift;
 my $dir = shift;
 unless ($self->r->path_info eq ''){
Ok, here are the problems:

1. Browsing music directories works fine, but…
- I can't use the search function. When I search something I get:
Server error 500: Either the server is overloaded (no) or there was
an error in a CGI script. Apache error log: [error] handler
Apache::MP3 didn't return a valid return value! How is it possible
that I'm not able to search?
Server error log:
-e: Use of uninitialized value in pattern match (m//) at
/etc/apache2//Apache/MP3.pm line 1843.
-e: Use of uninitialized value in split at /etc/apache2//Apache/MP3.pm
line 1693.
-e: Use of uninitialized value in pattern match (m//) at
/etc/apache2//Apache/MP3.pm line 1843.
-e: Use of uninitialized value in pattern match (m//) at
/etc/apache2//Apache/MP3.pm line 1843.
[error] handler Apache::MP3 didn't return a valid return value!

Line 1843 =
1841 # return true if streaming is allowed from this directory
1842 sub stream_ok {
1843 shift->r->dir_config('AllowStream') !~ /$NO/oi;
1844 }

Line 1693=
1690 # get fields to display in list of MP3 files
1691 sub fields {
1692 my $self = shift;
1693 my @f = split /\W+/,$self->r->dir_config('Fields');

- When I click on the quick help summary url, I can see a nice
screenshot + some meanings of the characters+ another error 500 code
at the bottom of the page.

Ok that's it

-What are the best options for me to get this module working?
-Are there test commands to test the module?
-Do I have to install other versions of the software to get this
running ( I would like to keep this apache2 version).
Hopefully u can help me out with these problems. Thanx in advance,

Deus

Ps, if u need to see the full httpd.conf, mod_perl-startup.pl or default-server.conf, I'll put them on my webserver and post the url's.
 
Old 08-02-2005, 01:56 AM   #2
deus1
Member
 
Registered: Jan 2005
Distribution: Suse 9.1 pro
Posts: 35

Original Poster
Rep: Reputation: 15
Nobody knows what could go wrong?
 
Old 08-04-2005, 05:58 AM   #3
deus1
Member
 
Registered: Jan 2005
Distribution: Suse 9.1 pro
Posts: 35

Original Poster
Rep: Reputation: 15
Seriously nobody tryed to get this module working?
 
Old 08-05-2005, 08:40 PM   #4
hlyrad
Member
 
Registered: Jul 2005
Location: Ab Ca
Distribution: Redhat EL Sun Mac OSX FC 3.0 & 4.0
Posts: 44

Rep: Reputation: 15
At the end of your module did you put
Code:
1;
??
This returns true so your module always returns some value.
 
Old 08-06-2005, 05:47 PM   #5
deus1
Member
 
Registered: Jan 2005
Distribution: Suse 9.1 pro
Posts: 35

Original Poster
Rep: Reputation: 15
yes thats at the end of the module.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl Module cant Install sohaib Red Hat 6 12-02-2005 09:22 AM
Perl playing .wav or .mp3 Cornholio Programming 2 05-01-2005 11:14 AM
Problem with perl module for w3c validator to work on my local Apache+PHP+perl instal tbamt Linux - Software 0 12-16-2004 05:37 PM
chrooting apache v2 (php, ssl, perl support) ; perl configuration markus1982 Linux - Security 3 01-26-2003 06:15 PM
can i set ~/public_html/perl as a perl directory for apache? doublefailure Linux - Networking 1 07-09-2002 04:31 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration