You can remotely connect one more more Ampache servers to one or more other Ampache servers. This is accomplished using XML-RPC. The below documentation will walk you through configuring two Ampache installs and connecting one to the other. This functionality is disabled by default.
Ampache's Access Lists are by default Deny From All this means if we enable access_control without defining any ACL's we will be locked out of our own Ampache install. First we should create the ACL (Access Control List) on both servers.
Configure the ACL's on the server side.
Stream Access List
| Name: | Stream Access | This is just the name of the ACL(Access List) so you can identify it later. | |||
| Start Address: | 0.0.0.0 | This is the start ip address of the range of ip addresses you're building the ACL for. | |||
| End Address: | 255.255.255.255 | This is the end ip address of the range of ip addresses you're building the ACL for. | |||
| User: | NONE | This is the login name of the user. | |||
| Level: | Read | This is the privilege level that the user gets. | |||
| ACL Type: | Stream Access | This is the ACL type. | |||
| Remote Key: | <blank> | This is the XML-RPC remote key to use. It's only used when creating on XML-RPC ACL with Read/Write Access. | |||
| <blank> | <blank> | In other words Server Side XML-RPC Acces List |
Interface Access List
| Name: | Interface Access | ||
| Start Address: | 0.0.0.0 | ||
| End Address: | 255.255.255.255 | ||
| User: | NONE | ||
| Level: | View | ||
| ACL Type: | Web Interface | ||
| Remote Key: | <blank> |
XML-RPC Access List
| Name: | XML-RPC <Remote Servername> | eq XML-RPC REM_CATALOG | |||
| Start Address: | “Remote Server Ip” | ||||
| End Address: | “Remote Server Ip” | Use the same ip twice to define a single server | |||
| User: | NONE | ||||
| Level: | Read/Write | ||||
| ACL Type: | XML-RPC | ||||
| Remote Key: | “remotekey” | eq Vollmer_key01 |
Configure the ACL's on the remote side.
Stream Access List
| Name: | Stream Access | This is just the name of the ACL(Access List) so you can identify it later. | |||
| Start Address: | 0.0.0.0 | This is the start ip address of the range of ip addresses you're building the ACL for. | |||
| End Address: | 255.255.255.255 | This is the end ip address of the range of ip addresses you're building the ACL for. | |||
| User: | NONE | This is the login name of the user. | |||
| Level: | Read | This is the privilege level that the user gets. | |||
| ACL Type: | Stream Access | This is the ACL type. | |||
| Remote Key: | <blank> | This is the XML-RPC remote key to use. It's only used when creating on XML-RPC ACL with Read/Write Access. | |||
| <blank> | <blank> | In other words Server Side XML-RPC Acces List |
Interface Access List
| Name: | Interface Access | ||
| Start Address: | 0.0.0.0 | ||
| End Address: | 255.255.255.255 | ||
| User: | NONE | ||
| Level: | View | ||
| ACL Type: | Web Interface | ||
| Remote Key: | <blank> |
XML-RPC Access List
| Name: | XML-RPC <Remote Servername> | eq XML-RPC SRV_CATALOG | |||
| Start Address: | “Local Server Ip” | ||||
| End Address: | “Local Server Ip” | Use the same ip twice to define a single server | |||
| User: | NONE | ||||
| Level: | View | ||||
| ACL Type: | XML-RPC | ||||
| Remote Key: | <blank> | This can be left blank on the remote ACL it's only used by the server to verify sessions |
On the SERVER it should be:
| Name | Start Address | End Address | Level | User | Key | Type | Action | ||||||||
| Stream Access | 0.0.0.0 | 255.255.255.255 | Read | <blank> | <blank> | Stream Access | Edit/Revoke | ||||||||
| Interface Access | 0.0.0.0 | 255.255.255.255 | View | <blank> | <blank> | Web Interface | Edit/Revoke | ||||||||
| XML-RPC REM_CATALOG | 127.0.0.3 | 127.0.0.3 | Read/Write | <blank> | Vollmer_key01 | XML-RPC | Edit/Revoke |
On the REMOTE it should be:
| Name | Start Address | End Address | Level | User | Key | Type | Action | ||||||||
| Stream Access | 0.0.0.0 | 255.255.255.255 | Read | <blank> | <blank> | Stream Access | Edit/Revoke | ||||||||
| Interface Access | 0.0.0.0 | 255.255.255.255 | View | <blank> | <blank> | Web Interface | Edit/Revoke | ||||||||
| XML-RPC SRV_CATALOG | 127.0.0.2 | 127.0.0.2 | View | <blank> | <blank> | XML-RPC | Edit/Revoke |
Last but not least we have to enable XML-RPC in the ampache.cfg.php file on both servers. The settings below are required when you want to use XML-RPC and ampache.
; 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 working without this on. ; DEFAULT: false access_control = "true"
; Require Session ; If this is set to true ampache will make sure that the URL passed when ; attempting to retrieve a song contains a valid Session ID This prevents ; others from guessing URL's ; DEFAULT: true require_session = "true"
; Use XML-RPC ; Allow XML-RPC connections, if you don't want _any_ possibility of your ; catalog being streamed from another location comment this out ; DEFAULT: false xml_rpc = "true"
Login as administrator at the REMOTE and use the menu to browse to the catalog setup. Click Admin > Catalog then Click Add Catalog.
Fill in the form with the following entry's
| Catalog Name: | XML-RPC SRV_CATALOG | This is just the name of the Catalog so you can identify it later. | |||
| Path: | http://127.0.0.2/ampache | This is the URL to connect to the SERVER catalog | |||
| Catalog Type: | Remote | This is the type of catalog used | |||
| XML-RPC Key: | Vollmer_key01 | This is the key that you filled in at the SERVER XML-RPC access list |
The rest of the option can be set as wished. They do not influence the working of the catalog.