Taking advantage of Ampache's XML-API you can browse and play from one or many remote Ampache catalog(s) directly from Amarok.
As this feature is currently not in the stable versions of either Application these instructions might change or it might blow up in your face, eat your lunch and steal your last beer.
In order to use the API we will need to enable and configure the Ampache Access Control Lists. This requires Admin access to your Ampache installation and access to the /config/ampache.cfg.php file. Ampache defaults to a DENY FROM ALL behavior so you will need to setup your ACL's before you enabled the Access Control in your Config file. In the below examples the server is 10.0.0.100 and the clients are between 10.0.0.200 and 10.0.0.254
Follow the instructions in the Configuring Access Control Lists wiki document for creating the following ACL's
Interface Access for Clients
| User | Type | Start | End | Key | Level | ||||||
| All | Interface | 10.0.0.200 | 10.0.0.254 | All |
This first ACL will let us continue to login after we've enabled the Access Control in the config file, next we need to allow streaming from our clients.
Streaming Access for Clients
| User | Type | Start | End | Key | Level | ||||||
| All | Streaming | 10.0.0.200 | 10.0.0.254 | All |
You'll notice these first two ACL's do not have a Key. Key's are only required for RPC communication. At this point we've got Interface and Streaming Access setup, before we go any further let's make sure that we've set these up correctly. Open up your /config/ampache.cfg.php in a text editor and find the access_control line and enabled it as seen below
; Use Access List ; Toggle this on if you want ampache to pay attention to the access list ; and only allow streaming/downloading/xml-rpc from known hosts by default ; xml-rpc will not work without this on. ; DEFAULT: false access_control = "true"
Log out of your Ampache instance, and then log back in. If that works then go ahead and try playing some music. If either one of these things fails disable Access Control and double check your ACL entries. If you still aren't sure why it's failing then Enable Logging and see what the Logs report.
The last step is to Add RPC ACL's. We can do this two different ways. The simple way is to create a single ACL that encompasses all of our clients and has a single KEY. The downsides to this are, a shared password among all clients and no per user tracking of their play statistics. The second way requires creating a unique ACL per user that has it's own KEY. This second way will ensure that each person's play statistics are stored under their name and they aren't sharing a password. For brevity's sake this document will only show a single user ACL and an 'All' user ACL
All Users RPC ACL
| User | Type | Start | End | Key | Level | ||||||
| All | RPC | 10.0.0.200 | 10.0.0.254 | mypassword | All |
ACL for the user “vollmerk” only
| User | Type | Start | End | Key | Level | ||||||
| vollmerk | RPC | 10.0.0.200 | 10.0.0.254 | mypassword | All |
At this point we assume that you have Amarok2 installed and working correctly.
Go to Settings and then Services. Make sure the Ampache Service is enabled and then click Settings button on Ampache plugin. Enter the details for your server and click add.
Name This is an internal name for Amarok, up to you.
Server This is the fully qualified address for your Ampache server including the http://. For example, a valid server would look like http://ampache.org/demo.
Username This is the username specified on your RPC ACL in Ampache. If you have not specified a specific user on your ACL leave this field blank
Password This is the key that you entered into the ACL in Ampache. This is not the password you use when you log into the web interface of ampache.