Difference between revisions of "Ampache"

From ArchWiki
Jump to: navigation, search
m (Configuration: Setting root password is covered in the lamp wiki)
(Added tips and trix)
Line 66: Line 66:
 
  ;open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/
 
  ;open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/
 
</pre>
 
</pre>
Another useful link to the Ampache [http://www.ampache.org/wiki/ wiki]
+
 
 +
= Tips & Tricks =
 +
 
 +
== Logging ==
 +
 
 +
Is something not working as intended? Let's get some logging going!
 +
 
 +
There are five levels of logging in Ampache, 5 being the highest.
 +
 
 +
To enable logging you just need to set the debug value to true and set debug_level to your desired level.
 +
 
 +
<pre>
 +
; Debug
 +
; If this is enabled Ampache will get really chatty
 +
; warning this can crash browser during catalog builds due to
 +
; the amount of text that is dumped out this will also cause
 +
; ampache to write to the log file
 +
; DEFAULT: false
 +
debug = "true"
 +
 
 +
; Debug Level
 +
; This should always be set in conjunction with the
 +
; debug option, it defines how prolific you want the
 +
; debugging in ampache to be. values are 1-5.
 +
; 1 == Errors only
 +
; 2 == Error + Failures (login attempts etc.)
 +
; 3 == ??
 +
; 4 == ?? (Profit!)
 +
; 5 == Information (cataloging progress etc.)
 +
; DEFAULT: 5
 +
debug_level = 5
 +
</pre>
 +
 
 +
Last thing you'll have to do is specify where you want the log to reside. Remember that the http user needs write permissons to the file.
 +
 
 +
<pre>
 +
; Path to Log File
 +
; This defines where you want ampache to log events to
 +
; this will only happen if debug is turned on. Do not
 +
; include trailing slash. You will need to make sure that
 +
; your HTTP server has write access to the specified directory
 +
; DEFAULT: NULL
 +
log_path = "/var/log/ampache"
 +
</pre>
 +
 
 +
== Transcoding ==
 +
 
 +
If you want to use Ampache's on the fly transcoding you'll need the packages specified in config/ampache.cfg, the packages needed for transcoding the most common audio file formats are listed in Ampache stable's .install file. You'll also need to configure the specific lines in ampache.cfg.
 +
 
 +
The following example enables m4a transcoding to mp3.
 +
 
 +
Please note that you'll need both lame, used for all audio file formats, and faad, m4a specific, installed.
 +
 
 +
<pre>
 +
; List of filetypes to transcode
 +
transcode_m4a          = true
 +
transcode_m4a_target    = mp3
 +
 
 +
; These are the commands that will be run to transcode the file
 +
transcode_cmd_m4a      = "faad -f 2 -w %FILE% | lame -r -b %SAMPLE% -S - -"
 +
</pre>
 +
 
 +
== Downsampling ==
 +
 
 +
Downsampling requires the same packages as transcoding so follow the steps above for each audio file format you need. The example above enables downsampling of m4a files.
 +
 
 +
You'll also need to uncomment and specify the minimum and maximum bitrate you prefer.
 +
 
 +
<pre>
 +
max_bit_rate = 576
 +
 
 +
min_bit_rate = 48
 +
</pre>
 +
 
 +
= More Resources =
 +
 
 +
A useful link to the Ampache [http://www.ampache.org/wiki/ wiki]

Revision as of 14:14, 29 August 2009


Ampache

This document describes how to set up Ampache on an Arch Linux LAMP server. Ampache is a Web-based Audio file manager. It is implemented with MySQL, and PHP. It allows you to view, edit, and play your audio files via the web. It has support for playlists, artist and album views, album art, random play, playback via Http/On the Fly Transcoding and Downsampling, Ampache is excellent if you want to be able to listen to your music collection anywhere.

Installation

You'll need three things to run Ampache. A webserver, PHP and MySQL. Please refere to the LAMP wiki for more information.

Ampache is available in the AUR, if you haven't had any experience using the AUR the AUR User Guidelines is recommended reading.

Currently maintained packages

There are currently two Ampache packages.

Configuration

Uncomment the ;extension=iconv.so line in the php.ini file. To enable the iconv support for ampache

# vi /etc/php/php.ini

When Ampache is installed to you webroot point your browser to http://localhost/ampache.

If you encounter any problems here, use http://localhost/ampache/test.php to double check your configuration.

  • On the first page just chose your the installation language.
  • On the second page enter the following:
    • Desired Database Name - Choose a proper name the you'll recognize when you edit your mysql databases.
    • MySQL Hostname - localhost is fine.
    • MySQL Administrative Username - root is the default
    • MySQL Administrative Password - root's password.
    • Create Database User for New Database? - Yes.
    • Ampache Database Username - Samething here, proper and recognizable.
    • Ampache Database User Password - Please note that this is only MySQL info, this is not your Ampache user account
    • Overwrite Existing
    • Use Existing Database
  • On the third page you're going to edit the ampache.cfg.php file
    • Web Path - Your patch to ampache.
    • Desired Database Name - Same as on the second page.
    • MySQL Hostname - localhost.
    • MySQL Username - Same as Ampache Database Username or root if you didn't create a database user.
    • MySQL Password - MySQL Username's password.
  • Press write config
  • Move the ampache.cfg.php to the ampache/config directory.
  • Press check for config.
  • On the fourth page you're going to create an admin account. This is step is self explanatory.
    • Username
    • Password
    • Confirm Password

Toubleshooting

If you're having problems adding catalogs, please check your permission settings. More catalog toubleshooting here.

If you're still having problems check your Open basedir setting in php.ini. You can either comment out the open_basedir all together or add the directory in which your files reside. The second option is preferred. To comment out a line all you need to do is add a semicolon at the beginning of the line.

 ;open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/

Tips & Tricks

Logging

Is something not working as intended? Let's get some logging going!

There are five levels of logging in Ampache, 5 being the highest.

To enable logging you just need to set the debug value to true and set debug_level to your desired level.

; Debug
; If this is enabled Ampache will get really chatty
; warning this can crash browser during catalog builds due to 
; the amount of text that is dumped out this will also cause 
; ampache to write to the log file
; DEFAULT: false
debug = "true"

; Debug Level
; This should always be set in conjunction with the
; debug option, it defines how prolific you want the
; debugging in ampache to be. values are 1-5. 
; 1 == Errors only
; 2 == Error + Failures (login attempts etc.)
; 3 == ??
; 4 == ?? (Profit!)
; 5 == Information (cataloging progress etc.)
; DEFAULT: 5
debug_level = 5

Last thing you'll have to do is specify where you want the log to reside. Remember that the http user needs write permissons to the file.

; Path to Log File
; This defines where you want ampache to log events to
; this will only happen if debug is turned on. Do not
; include trailing slash. You will need to make sure that
; your HTTP server has write access to the specified directory
; DEFAULT: NULL
log_path = "/var/log/ampache"

Transcoding

If you want to use Ampache's on the fly transcoding you'll need the packages specified in config/ampache.cfg, the packages needed for transcoding the most common audio file formats are listed in Ampache stable's .install file. You'll also need to configure the specific lines in ampache.cfg.

The following example enables m4a transcoding to mp3.

Please note that you'll need both lame, used for all audio file formats, and faad, m4a specific, installed.

; List of filetypes to transcode
transcode_m4a           = true
transcode_m4a_target    = mp3 

; These are the commands that will be run to transcode the file
transcode_cmd_m4a       = "faad -f 2 -w %FILE% | lame -r -b %SAMPLE% -S - -"

Downsampling

Downsampling requires the same packages as transcoding so follow the steps above for each audio file format you need. The example above enables downsampling of m4a files.

You'll also need to uncomment and specify the minimum and maximum bitrate you prefer.

max_bit_rate = 576

min_bit_rate = 48

More Resources

A useful link to the Ampache wiki