Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Ampache: Stream your own MP3 and Virtual Hosts HOWTO
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
amiatrome
Apprentice
Apprentice


Joined: 28 Jun 2004
Posts: 180
Location: Campus | Arena Country Club | Home

PostPosted: Sun Apr 24, 2005 6:08 pm    Post subject: Ampache: Stream your own MP3 and Virtual Hosts HOWTO Reply with quote

Ampache: Stream your own MP3 and Virtual Hosts HOWTO
by amiatrome
created April 24, 2005


Disclaimer: I put the following guide together from memory. Although great care was taken, there could still be some mistakes. Feedback is very welcomed. Enjoy. :D


Introduction
Ampache is a PHP-based tool for managing, updating and streaming your MP3/OGG/RM/FLAC/WMA/M4A files via a web interface. It allows you to save playlists, create user accounts, and share your music catalogs with other Ampache servers.

Demo (streaming is disabled)


Ampache is now in Portage thanks to coutts99. I haven't tried it but PChaos has and he says it works great and come complete with instructions in emerge's output. So try that first. :P


Prerequisites
Any webserver (but this guide is for Apache)
PHP 4.1.2 or higher
Mysql 3.23 or higher


Get Ampache
1. Download the latest stable Ampache package here.

2. Extract the package to site root,
Code:
tar -zxvf ampache-3.3.tar.gz -C /var/www/localhost/htdocs/

2a. Ampache now extracts to a directory of the same name as the snapshot. Paths will now be Ampache-<version> instead of ampache. You can create a soft link from ./ampache to ./Ampache-<version> if preferred. Thanks to fincoop.
Code:
cd /var/www/localhost/htdocs
ln -s ./Am<tab> ./ampache




Creating and Inserting the Ampache Database
1. Open your web browser and go to http://localhost/ampache/docs/install.php

2. Create and insert the database, ampache by providing a mysql account with database creation rights

Quote:
Desired Database Name: ampache
MySQL Hostname: localhost
MySQL Administrative Username: root
MySQL Administrative Password: mysql_root_password


3. Click on 'Insert Database'




Creating a MySQL account for Ampache
Note: For those who don't like entering SQL(ie. Steps 1-3), you can use phpMyAdmin instead. I have a guide to setting it up here.
Code:
emerge phpmyadmin


1. Go into MySQL shell,
Code:
mysql -u root -p


2. Create a user, ampache (single quotes ' are required)
Code:
GRANT USAGE ON * . * TO 'ampache'@'localhost' IDENTIFIED BY 'ampache_password' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 ;


3. Grant user, ampache, SELECT, INSERT, UPDATE, DELETE, DROP, INDEX, ALTER previleges on database, ampache (single quotes ' are required)

Code:
REVOKE ALL PRIVILEGES ON `ampache` . * FROM 'ampache'@'localhost';

GRANT SELECT ,
INSERT ,

UPDATE ,
DELETE ,
CREATE ,
DROP ,
INDEX ,
ALTER ON `ampache` . * TO 'ampache'@'localhost';





Creating the ampache.cfg file
1. Ampache will attempt to write a basic ampache.cfg configuration file with your inputs onto the webserver.

Quote:
Web Path: /ampache/docs
Desired Database Name: ampache
MySQL Hostname: localhost
MySQL Username: ampache
MySQL Password: ampache_password


PROCEED TO "Setup Initial Account" BELOW IF 1) ABOVE SUCCEEDED


2. If nothing happens, it means write access is denied. Copy the configuration file over manually
Code:
cd /var/www/localhost/htdocs/ampache/config/
cp ampache.cfg.dist ampache.cfg


3. Open the file, ampache.cfg and uncomment/fill in the following along with other changes you may want to make
Code:
web_path = "/ampache/docs"
local_host = localhost
local_db = ampache
local_username = ampache
local_pass = ampache_password


4. Edit the permissions for ampache.cfg
Code:
chown apache:root ampache.cfg
chmod 600 ampache.cfg


5. Go back to your browser and click on "Check for Config" to ensure everything is in order.
Quote:
Ampache.cfg Exists [ OK ]
Ampache.cfg Configured? [ OK ]


6. Hit "Continue to Step 3"




Setup Initial Account
1. Create your Ampache admin account

2. If you are not automatically redirected, go to http://localhost/ampache/docs/index.php




Create A Virtual Host (credit)
Note: If you are not hosting an existing website on the same server, or you do not mind long urls like http://ampache.homelinux.com/ampache/docs/ , you can skip this section.

1. Uncomment the following line in /etc/apache2/conf/apache2.conf
Code:
#Include conf/vhosts/vhosts.conf


2. Add the following into /etc/apache2/conf/vhosts/vhosts.conf
Code:
NameVirtualHost *:80

#THIS SECTION IS FOR YOUR EXISTING WEBSITE, SKIP IT IF YOU DO NOT HAVE ONE
<VirtualHost *:80>
ServerName arnold.homelinux.com
ServerAdmin webmaster@arnold.homelinux.com
DocumentRoot /var/www/localhost/htdocs/tikiwiki
ServerPath /tikiwiki
 <Directory /var/www/localhost/htdocs/tikiwiki>
   Order Allow,Deny
   Allow from all
 </Directory>
 Setenv VLOG /var/log/apache2/
ErrorLog /var/log/apache2/tikiwiki_error_log
CustomLog /var/log/apache2/tikiwiki_access_log combined
</VirtualHost>

#THIS SECTION IS FOR AMPACHE
<VirtualHost *:80>
ServerName ampache.homelinux.com
ServerAdmin webmaster@ampache.homelinux.com
DocumentRoot /var/www/localhost/htdocs/ampache/docs
ServerPath /ampache/docs
 <Directory /var/www/localhost/htdocs/ampache/docs>
   Order Allow,Deny
   Allow from all
 </Directory>
 Setenv VLOG /var/log/apache2/
ErrorLog /var/log/apache2/ampache_error_log
CustomLog /var/log/apache2/ampache_access_log combined
</VirtualHost>

#I ADDED THIS SECTION BECAUSE I HAD TROUBLE USING LOCALHOST/* WITHOUT IT
<VirtualHost *:80>
ServerName localhost
ServerAdmin webmaster@localhost
DocumentRoot /var/www/localhost/htdocs
ServerPath /
 <Directory /var/www/localhost/htdocs>
   Order Allow,Deny
   Allow from all
 </Directory>
</VirtualHost>


3. Restart apache2
Code:
/etc/init.d/apache2 restart





Setting Directories and File Permissions
Set permissions 755 for your directories and 644 for your audio files
Code:
chmod 755 /mnt/music/
chmod 644 /mnt/music/*





Finally...
1. Open your browser and surf to your virtual host, http://ampache.homelinux.com
Note: Get your own dynamic DNS here

2. Enjoy Ampache: for the love of music! :D
_________________
blog | homepage | alias | prompts


Last edited by amiatrome on Tue Aug 09, 2005 4:50 pm; edited 4 times in total
Back to top
View user's profile Send private message
watorin
n00b
n00b


Joined: 09 Mar 2005
Posts: 3

PostPosted: Sun Apr 24, 2005 9:00 pm    Post subject: Reply with quote

Nice howto. Thanks
Back to top
View user's profile Send private message
amiatrome
Apprentice
Apprentice


Joined: 28 Jun 2004
Posts: 180
Location: Campus | Arena Country Club | Home

PostPosted: Tue Apr 26, 2005 4:54 pm    Post subject: Reply with quote

bump because I am enjoying my streamed mp3 from work. :twisted:

watorin, have you tried it out? Any comments?
_________________
blog | homepage | alias | prompts
Back to top
View user's profile Send private message
HOHCEHC
n00b
n00b


Joined: 10 May 2004
Posts: 32

PostPosted: Fri May 06, 2005 3:07 am    Post subject: Reply with quote

ok i tried howto but sql gives me errors when i try give user amapche privileges
Back to top
View user's profile Send private message
amiatrome
Apprentice
Apprentice


Joined: 28 Jun 2004
Posts: 180
Location: Campus | Arena Country Club | Home

PostPosted: Sun May 08, 2005 1:39 am    Post subject: Reply with quote

Ah my bad. There was a mistake in the query, an extra space in the last line between @ and 'localhost'. :oops:

It's fixed now. :D
_________________
blog | homepage | alias | prompts
Back to top
View user's profile Send private message
TheZog
n00b
n00b


Joined: 17 Aug 2002
Posts: 57
Location: Sunny Seattle

PostPosted: Sun May 08, 2005 5:16 am    Post subject: Reply with quote

I installed this today as a lazy Sat. afternoon project and I'm quite pleased.
It works very well, good interface, etc. I recommend it also.

Now I just have to clean up all my ID3 tags. :P
Back to top
View user's profile Send private message
Zyne
Guru
Guru


Joined: 08 Jun 2004
Posts: 334

PostPosted: Sat May 14, 2005 9:51 am    Post subject: Reply with quote

This is indeed a great way to share your music over the network!
Now I just gotta find a way to add about 300 albums to the database at once :)


Thanks for the howto amiatrome!
Back to top
View user's profile Send private message
amiatrome
Apprentice
Apprentice


Joined: 28 Jun 2004
Posts: 180
Location: Campus | Arena Country Club | Home

PostPosted: Sat May 14, 2005 6:20 pm    Post subject: Reply with quote

Glad you guys found it useful! :D
_________________
blog | homepage | alias | prompts
Back to top
View user's profile Send private message
riksta
n00b
n00b


Joined: 16 Apr 2004
Posts: 73
Location: Manchester, UK

PostPosted: Sun May 15, 2005 6:59 am    Post subject: Reply with quote

TheZog wrote:
I installed this today as a lazy Sat. afternoon project and I'm quite pleased.
It works very well, good interface, etc. I recommend it also.

Now I just have to clean up all my ID3 tags. :P


You might want to look at a program with MusicBrainz support to clean up your tags, it can take a digital fingerprint of your music and automatically tag it if it finds a match in the massive database :)
Back to top
View user's profile Send private message
basiaf
n00b
n00b


Joined: 25 Feb 2005
Posts: 44
Location: Dortmund

PostPosted: Mon Jun 06, 2005 3:08 pm    Post subject: Reply with quote

does downsampling work for you ? Last time I tried I couldn't get it to work...

// d'oh.. fixed it by not using the outdated ampache.php.dist.de
Back to top
View user's profile Send private message
coutts99
Apprentice
Apprentice


Joined: 19 Sep 2002
Posts: 171
Location: Sunderland, UK

PostPosted: Thu Jun 23, 2005 2:12 pm    Post subject: Reply with quote

Ampache ebuild

https://bugs.gentoo.org/show_bug.cgi?id=93544
Back to top
View user's profile Send private message
fincoop
Tux's lil' helper
Tux's lil' helper


Joined: 02 Feb 2004
Posts: 131

PostPosted: Fri Jul 01, 2005 7:30 pm    Post subject: Re: Ampache: Stream your own MP3 and Virtual Hosts HOWTO Reply with quote

[quote="amiatrome2. Extract the package to site root,
Code:
tar -zxvf ampache-3.3.tar.gz -C /var/www/localhost/htdocs/

[/quote]

Ampache now extracts to a directory of the same name as the snapshot, perhaps include a 2a step to create a link?

Code:

cd /var/www/localhost/htdocs
ln -s ./Am<tab> ./ampache


Or perhaps just define it in the vhosts, but i think the link is easier to maintain. Thanks!
Back to top
View user's profile Send private message
fjf3
n00b
n00b


Joined: 23 Apr 2003
Posts: 31

PostPosted: Fri Jul 08, 2005 3:26 am    Post subject: Very useful Reply with quote

You should update it. I found it very useful, but now there is no ampache/docs anymore and the installation script is pretty sweet. Besides that it made my life a LOT simpler than if I had to figure it out by myself.
Back to top
View user's profile Send private message
fjf3
n00b
n00b


Joined: 23 Apr 2003
Posts: 31

PostPosted: Fri Jul 08, 2005 3:53 am    Post subject: adding ~amd64 Reply with quote

Anyone knows who is maintaining the ebuild? I added ~ppc to my package.keywords so it would build on my amd64 system. It is working fine so far. I think it is almost 100% php so there is nothing to link to or anything like that. Well if anyone here knows, ~amd64 is fine so far.
Back to top
View user's profile Send private message
amiatrome
Apprentice
Apprentice


Joined: 28 Jun 2004
Posts: 180
Location: Campus | Arena Country Club | Home

PostPosted: Sat Jul 09, 2005 3:40 pm    Post subject: Reply with quote

Hey guys, sorry for the delay. Busy like a bee recently.

fjf3, would you mind showing me what is the new ampache ebuild dir structure so I can update the howto? Where is the install script now? Is it sufficient to just strip docs/ from all the current paths? Thanks. :)
_________________
blog | homepage | alias | prompts
Back to top
View user's profile Send private message
PChaos
n00b
n00b


Joined: 09 Nov 2004
Posts: 29

PostPosted: Mon Jul 18, 2005 7:14 am    Post subject: Reply with quote

The ampache ebuild is a nice thing. It installs into some dir from where you can install it as an webapp. but emerge gives a nice instruction to this.

If you maybe give the host for your ampache as ampache.homelinux.net on my system everything went to /var/www/ampache.homelinux.net/htdocs/ampache/...
Just set up a proper vhost and you will be able to run http://ampache.homelinux.net/install.php from your browser.
The install.php is able to create as well the database as the neccessary cfg file and asks to create an initial login.



Note: to run ampache i still have my apache2 towd to the totem pole. This little indian ***** somehow refuses to open my index.php and allways asks me to download the index.php. To make it really weird, i was able to open install.php as well as I am able to open login.php.
Back to top
View user's profile Send private message
Ghent
n00b
n00b


Joined: 27 Dec 2004
Posts: 35
Location: Alfred, NY

PostPosted: Sat Aug 20, 2005 8:03 pm    Post subject: Reply with quote

Okay so, installation went pretty smoothly and I have it up and running for the admin account now and I have to say, I love it (awesome howto) but I do have one little problem. While I myself can log in as admin no user accounts can login. They simply give me the error "Error Access Denied"

I'm not sure what the deal is here but I'd like to be able to share this with a few people without giving them admin. Anybody know what I'm doing wrong?

-Tim
_________________
Tim "Ghent" Scotts
--
Asus K8V-SE Deluxe
AMD64 3700+
1 Gig Corsair PC3200 RAM
Audigy 2 ZS Plautinum Pro
Dual SATA 200 Gig 7200 RPM Hard Drives
Gentoo Linux 2000.3 & Debian 3.0
Back to top
View user's profile Send private message
Phantomal
n00b
n00b


Joined: 25 Aug 2005
Posts: 2

PostPosted: Fri Aug 26, 2005 1:58 pm    Post subject: Re: adding ~amd64 Reply with quote

fjf3 wrote:
Anyone knows who is maintaining the ebuild? I added ~ppc to my package.keywords so it would build on my amd64 system. It is working fine so far. I think it is almost 100% php so there is nothing to link to or anything like that. Well if anyone here knows, ~amd64 is fine so far.



Ampache is not 100% PHP. it uses PERL Scripts to do some things like retagging MP3s or other cool Things in Future.
But hey, PERL Should work on your AMD64 too. So no problem ;)



Greetz

Phanti
Back to top
View user's profile Send private message
denstark
l33t
l33t


Joined: 02 Jun 2003
Posts: 654
Location: sd.ca.us

PostPosted: Fri Aug 26, 2005 8:09 pm    Post subject: Reply with quote

AMAZING howto. Set up was easy as pie, and this peice of software is amazing. Thank you.
_________________
Blog
Code:
denstark> starbuck authorizes torture?
rokstar> sure they do, you tried their coffee?
Back to top
View user's profile Send private message
bol
n00b
n00b


Joined: 27 Dec 2004
Posts: 26
Location: Stockholm, Sweden

PostPosted: Sat Oct 15, 2005 9:26 pm    Post subject: Reply with quote

For some reason the mysql-queries didn't work for me, but with phpmyadmin it worked just fine.

Great howto anyway.
Thanks! :)
Back to top
View user's profile Send private message
Mobeater
n00b
n00b


Joined: 07 Nov 2005
Posts: 10

PostPosted: Thu Dec 01, 2005 6:44 pm    Post subject: I musta missed somethin... Reply with quote

For the life of me, I can not figure out where the music goes, I simply tried uploading as a test, it does not error out, then again, it does not put my music anywhere to be seen...have Upload turned on, and tried with Quarentine on and off....no dice.

Any help would be great!

Thanks Mob_Eater
Back to top
View user's profile Send private message
jaycemil
n00b
n00b


Joined: 22 Apr 2005
Posts: 10

PostPosted: Fri Dec 09, 2005 5:48 pm    Post subject: XML-RPC connection Reply with quote

Has anyone here managed to get the XML-RPC in Ampache working on Gentoo? If so, were there any tricks?
Back to top
View user's profile Send private message
slestak
Tux's lil' helper
Tux's lil' helper


Joined: 13 Jun 2003
Posts: 115

PostPosted: Thu Jan 12, 2006 9:50 pm    Post subject: Reply with quote

I am trying to get this to work with SSL_DEFAULT_VHOST enabled in /etc/conf.d/apache2.

In the admin preferences, I have set force_http_stream to true, and the m3u playlist files that song.php creates do contain http:// instead of https, but no player can play them. I think the SSL_DEFAULT_VHOST must be forcing everything to port 443.

The ui works fine with https, i just cant stream.

I do not have any rewrite rules in httpd.conf becasue the force_http_stream (or play, im going from memory) makes appropriate http urls.
Back to top
View user's profile Send private message
jaycemil
n00b
n00b


Joined: 22 Apr 2005
Posts: 10

PostPosted: Thu Jan 12, 2006 10:31 pm    Post subject: Reply with quote

I'm also going on vauge memory so I may be completely off but... SSL_DEFAULT_VHOST should only pickup port 443. Do you also have DEFAULT_VHOST defined or no? If not then IIRC you won't get any response on port 80.
Back to top
View user's profile Send private message
slestak
Tux's lil' helper
Tux's lil' helper


Joined: 13 Jun 2003
Posts: 115

PostPosted: Fri Jan 13, 2006 2:12 am    Post subject: Reply with quote

jaycemil wrote:
Do you also have DEFAULT_VHOST defined or no? If not then IIRC you won't get any response on port 80.


You are awesome. Thx. Ive been working on this for a week. Didnt know I needed both.

Now to figure out sln for mpd + ssl. It chokes on https as well.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
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