Skip to content

Audio and Video Services using Ampache 3.8 on CentOS 7.2.1511

Richard Harmonson edited this page Oct 12, 2018 · 24 revisions

Audio and Video Services using Ampache 3.8 on CentOS 7.2.1511


Revised October 12, 2018; wagnered issue #17

Revised October 28, 2017; 3.8.4develop PHP 5.6 requirements / Remi Repo

Published December 3, 2016


The purpose of this article is to provide guidance in building a steaming audio and video service for PC and mobile devices. For several years, I have been using Ampache, primarily, for streaming my music library using a browser and laptop.

Hardware Requirements

Recommended Configuration:

  • 1 or 2 CPUs
  • 1 or 2 GB RAM
  • 20 GB OS Disk
  • additional storage for media data

I have successfully used 1 CPU and 1 GB of RAM for streaming media using Ampache, but if you have it, go for 2 CPU and 2 GB of RAM if streaming HD video.

CentOS 7 Minimal Installation

Complete an operating system installation. My CentOS 7 install guide, given below, is not a requirements, but you may need to adjust for components like NetworkManager or firewalld.

https://github.com/rharmonson/richtech/wiki/CentOS-7-1511-Minimal-x86_64-Base-Installation-Guide

Yum Repositories

The NUX repository provides FFMPEG which will be used for transcoding codecs. The EPEL repository is a dependency for NUX, so it will be installed as well.


Note

Instead of using EPEL and NUX, an alternative would be compiling Ampache dependencies from source.


EPEL Repository

$ sudo yum -y install epel-release

Results

================================================================================
 Package              Arch           Version       Repository              Size
================================================================================
Installing:
 epel-release         noarch         7-8           ovirt-4.0-epel          14 k

Transaction Summary
================================================================================
Install  1 Package

Total download size: 14 k
Installed size: 24 k

NUX Repository

$ yum -y install http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm

Results

================================================================================
 Package        Arch   Version     Repository                              Size
================================================================================
Installing:
 nux-dextop-release
                noarch 0-5.el7.nux /nux-dextop-release-0-5.el7.nux.noarch 3.5 k

Transaction Summary
================================================================================
Install  1 Package

Total size: 3.5 k
Installed size: 3.5 k

Ampache Requirements

Requirements as described here: https://github.com/ampache/ampache#requirements

  • A web server. All of the following have been used, though Apache receives the most testing:
    • Apache
    • lighttpd
    • nginx
    • IIS
  • PHP 5.4 or greater.
  • PHP modules:
    • PDO
    • PDO_MYSQL
    • hash
    • session
    • json
    • simplexml (optional)
    • curl (optional)
  • MySQL 5.x

The requirements listed on Ampache github is missing a number of dependencies.

Here the list of dependencies using my installation.

  • COMPOSER

    • getcomposer.org
  • MySQL Database 5.x:

    • mariadb
    • mariadb-server
  • Web Services:

    • httpd (aka Apache)
  • PHP 5.4:

    • php
    • php-common
    • php-mcrypt
    • php-pdo
    • php-cli
    • php-mysql
    • php-gd
    • php-xml
  • Encryption:

    • libmcrypt
  • (de)codec/r:

    • ffmpeg
  • Utility:

    • git; for obtaining ampache from github
    • links (optional); for testing on ampache host, text web browser

Notes:

  1. curl, json, and libxml2 are installed by default for CentOS 7 Minimal installation
  2. php-common provides many of the requirements including but not limited to php-hash and php-session
  3. Many of the packages below are inter-dependent but for clarity, I specify them

Install Requirements

Execute the following:

$ sudo yum -y install mariadb mariadb-server httpd php php-common php-mcrypt php-pdo php-cli php-mysql php-gd php-xml libmcrypt ffmpeg git links

Results

================================================================================
 Package                 Arch   Version                        Repository  Size
================================================================================
Installing:
 ffmpeg                  x86_64 2.6.8-3.el7.nux                nux-dextop 1.5 M
 git                     x86_64 1.8.3.1-6.el7_2.1              updates    4.4 M
 httpd                   x86_64 2.4.6-40.el7.centos.4          updates    2.7 M
 libmcrypt               x86_64 2.5.8-13.el7                   epel        99 k
 links                   x86_64 1:2.13-1.el7                   epel       2.8 M
 mariadb                 x86_64 1:5.5.50-1.el7_2               updates    8.9 M
 mariadb-server          x86_64 1:5.5.50-1.el7_2               updates     11 M
 php                     x86_64 5.4.16-36.3.el7_2              updates    1.4 M
 php-cli                 x86_64 5.4.16-36.3.el7_2              updates    2.7 M
 php-common              x86_64 5.4.16-36.3.el7_2              updates    563 k
 php-gd                  x86_64 5.4.16-36.3.el7_2              updates    126 k
 php-mcrypt              x86_64 5.4.16-7.el7                   epel        20 k
 php-mysql               x86_64 5.4.16-36.3.el7_2              updates    100 k
 php-pdo                 x86_64 5.4.16-36.3.el7_2              updates     97 k
 php-xml                 x86_64 5.4.16-36.3.el7_2              updates    124 k
Installing for dependencies:
 SDL                     x86_64 1.2.15-14.el7                  base       204 k
 apr                     x86_64 1.4.8-3.el7                    base       103 k
 apr-util                x86_64 1.5.2-6.el7                    base        92 k
 cairo                   x86_64 1.14.2-1.el7                   base       711 k
 faac                    x86_64 1.28-6.0.el7.nux               nux-dextop 269 k
 fdk-aac                 x86_64 0.1.4-1                        nux-dextop 375 k
 ffmpeg-libs             x86_64 2.6.8-3.el7.nux                nux-dextop 5.0 M
 flac-libs               x86_64 1.3.0-5.el7_1                  base       169 k
 fontconfig              x86_64 2.10.95-7.el7                  base       228 k
 fontpackages-filesystem noarch 1.44-8.el7                     base       9.9 k
 fribidi                 x86_64 0.19.4-6.el7                   base        63 k
 gdk-pixbuf2             x86_64 2.31.6-3.el7                   base       559 k
 gpm-libs                x86_64 1.20.7-5.el7                   base        32 k
 graphite2               x86_64 1.3.6-1.el7_2                  updates    112 k
 gsm                     x86_64 1.0.13-11.el7                  base        30 k
 harfbuzz                x86_64 0.9.36-1.el7                   base       156 k
 httpd-tools             x86_64 2.4.6-40.el7.centos.4          updates     83 k
 jasper-libs             x86_64 1.900.1-29.el7                 base       149 k
 lame-libs               x86_64 3.99.5-2.el7                   nux-dextop 339 k
 libICE                  x86_64 1.0.9-2.el7                    base        65 k
 libSM                   x86_64 1.2.2-2.el7                    base        39 k
 libX11                  x86_64 1.6.3-2.el7                    base       605 k
 libX11-common           noarch 1.6.3-2.el7                    base       162 k
 libXau                  x86_64 1.0.8-2.1.el7                  base        29 k
 libXdamage              x86_64 1.1.4-4.1.el7                  base        20 k
 libXext                 x86_64 1.3.3-3.el7                    base        39 k
 libXfixes               x86_64 5.0.1-2.1.el7                  base        18 k
 libXft                  x86_64 2.3.2-2.el7                    base        58 k
 libXi                   x86_64 1.7.4-2.el7                    base        40 k
 libXpm                  x86_64 3.5.11-3.el7                   base        54 k
 libXrender              x86_64 0.9.8-2.1.el7                  base        25 k
 libXtst                 x86_64 1.2.2-2.1.el7                  base        20 k
 libXv                   x86_64 1.0.10-2.el7                   base        18 k
 libXxf86vm              x86_64 1.1.3-2.1.el7                  base        17 k
 libass                  x86_64 0.13.4-1.el7                   epel        92 k
 libasyncns              x86_64 0.8-7.el7                      base        26 k
 libavdevice             x86_64 2.6.8-3.el7.nux                nux-dextop  71 k
 libcdio                 x86_64 0.92-1.el7                     base       235 k
 libcdio-paranoia        x86_64 10.2+0.90-11.el7               base        70 k
 libdc1394               x86_64 2.2.2-3.el7                    epel       121 k
 libgnome-keyring        x86_64 3.8.0-3.el7                    base       109 k
 libogg                  x86_64 2:1.3.0-7.el7                  base        24 k
 libpng                  x86_64 2:1.5.13-7.el7_2               updates    213 k
 libraw1394              x86_64 2.1.0-2.el7                    base        63 k
 librsvg2                x86_64 2.39.0-1.el7                   base       123 k
 libsndfile              x86_64 1.0.25-10.el7                  base       149 k
 libthai                 x86_64 0.1.14-9.el7                   base       187 k
 libtheora               x86_64 1:1.1.1-8.el7                  base       136 k
 libusbx                 x86_64 1.0.15-4.el7                   base        50 k
 libv4l                  x86_64 0.9.5-4.el7                    base       194 k
 libva                   x86_64 1.2.1-3.el7                    epel        68 k
 libvdpau                x86_64 1.1-2.el7                      base        32 k
 libvorbis               x86_64 1:1.3.3-8.el7                  base       204 k
 libxcb                  x86_64 1.11-4.el7                     base       189 k
 libxshmfence            x86_64 1.2-1.el7                      base       7.2 k
 libxslt                 x86_64 1.1.28-5.el7                   base       242 k
 libzip                  x86_64 0.10.1-8.el7                   base        48 k
 mailcap                 noarch 2.1.41-2.el7                   base        31 k
 mesa-filesystem         x86_64 10.6.5-3.20150824.el7          base        23 k
 mesa-libEGL             x86_64 10.6.5-3.20150824.el7          base        74 k
 mesa-libGL              x86_64 10.6.5-3.20150824.el7          base       184 k
 mesa-libgbm             x86_64 10.6.5-3.20150824.el7          base        40 k
 mesa-libglapi           x86_64 10.6.5-3.20150824.el7          base        39 k
 openal-soft             x86_64 1.16.0-3.el7                   epel       282 k
 openjpeg-libs           x86_64 1.5.1-10.el7                   base        85 k
 opus                    x86_64 1.0.2-6.el7                    base       630 k
 orc                     x86_64 0.4.22-5.el7                   base       165 k
 pango                   x86_64 1.36.8-2.el7                   base       287 k
 perl                    x86_64 4:5.16.3-286.el7               base       8.0 M
 perl-Carp               noarch 1.26-244.el7                   base        19 k
 perl-Compress-Raw-Bzip2 x86_64 2.061-3.el7                    base        32 k
 perl-Compress-Raw-Zlib  x86_64 1:2.061-4.el7                  base        57 k
 perl-DBD-MySQL          x86_64 4.023-5.el7                    base       140 k
 perl-DBI                x86_64 1.627-4.el7                    base       802 k
 perl-Data-Dumper        x86_64 2.145-3.el7                    base        47 k
 perl-Encode             x86_64 2.51-7.el7                     base       1.5 M
 perl-Error              noarch 1:0.17020-2.el7                base        32 k
 perl-Exporter           noarch 5.68-3.el7                     base        28 k
 perl-File-Path          noarch 2.09-2.el7                     base        26 k
 perl-File-Temp          noarch 0.23.01-3.el7                  base        56 k
 perl-Filter             x86_64 1.49-3.el7                     base        76 k
 perl-Getopt-Long        noarch 2.40-2.el7                     base        56 k
 perl-Git                noarch 1.8.3.1-6.el7_2.1              updates     53 k
 perl-HTTP-Tiny          noarch 0.033-3.el7                    base        38 k
 perl-IO-Compress        noarch 2.061-2.el7                    base       260 k
 perl-Net-Daemon         noarch 0.48-5.el7                     base        51 k
 perl-PathTools          x86_64 3.40-5.el7                     base        82 k
 perl-PlRPC              noarch 0.2020-14.el7                  base        36 k
 perl-Pod-Escapes        noarch 1:1.04-286.el7                 base        50 k
 perl-Pod-Perldoc        noarch 3.20-4.el7                     base        87 k
 perl-Pod-Simple         noarch 1:3.28-4.el7                   base       216 k
 perl-Pod-Usage          noarch 1.63-3.el7                     base        27 k
 perl-Scalar-List-Utils  x86_64 1.27-248.el7                   base        36 k
 perl-Socket             x86_64 2.010-3.el7                    base        49 k
 perl-Storable           x86_64 2.45-3.el7                     base        77 k
 perl-TermReadKey        x86_64 2.30-20.el7                    base        31 k
 perl-Text-ParseWords    noarch 3.29-4.el7                     base        14 k
 perl-Time-HiRes         x86_64 4:1.9725-3.el7                 base        45 k
 perl-Time-Local         noarch 1.2300-2.el7                   base        24 k
 perl-constant           noarch 1.27-2.el7                     base        19 k
 perl-libs               x86_64 4:5.16.3-286.el7               base       687 k
 perl-macros             x86_64 4:5.16.3-286.el7               base        43 k
 perl-parent             noarch 1:0.225-244.el7                base        12 k
 perl-podlators          noarch 2.5.1-3.el7                    base       112 k
 perl-threads            x86_64 1.87-4.el7                     base        49 k
 perl-threads-shared     x86_64 1.43-6.el7                     base        39 k
 pixman                  x86_64 0.32.6-3.el7                   base       254 k
 pulseaudio-libs         x86_64 6.0-7.el7                      base       576 k
 rsync                   x86_64 3.0.9-17.el7                   base       360 k
 schroedinger            x86_64 1.0.11-4.el7                   epel       291 k
 soxr                    x86_64 0.1.2-1.el7                    epel        77 k
 speex                   x86_64 1.2-0.19.rc1.el7               base        98 k
 t1lib                   x86_64 5.1.2-14.el7                   base       166 k
 x264-libs               x86_64 0.142-11.20141221git6a301b6.el7.nux
                                                               nux-dextop 570 k
 x265-libs               x86_64 1.9-1.el7.nux                  nux-dextop 1.5 M
 xvidcore                x86_64 1.3.2-5.el7.nux                nux-dextop 258 k

Transaction Summary
================================================================================
Install  15 Packages (+116 Dependent packages)

Total download size: 67 M
Installed size: 265 M

Composer

A not well documented requirement as of 3.8 is "Composer." A PHP package manager.

You can either install the packages from EPEL or install a binary from getcomposer.org.

$ sudo yum install composer

Results

================================================================================
 Package                           Arch    Version               Repository
                                                                           Size
================================================================================
Installing:
 composer                          noarch  1.2.2-1.el7           epel     350 k
Installing for dependencies:
 libicu                            x86_64  50.1.2-15.el7         base     6.9 M
 php-PsrLog                        noarch  1.0.1-1.el7           epel      11 k
 php-composer-ca-bundle            noarch  1.0.2-1.el7           epel      12 k
 php-composer-semver               noarch  1.4.2-1.el7           epel      17 k
 php-composer-spdx-licenses        noarch  1.1.5-1.el7           epel      15 k
 php-fedora-autoloader             noarch  0.2.1-2.el7           epel     9.0 k
 php-intl                          x86_64  5.4.16-36.3.el7_2     updates   96 k
 php-jsonlint                      noarch  1.4.1-1.el7           epel      16 k
 php-justinrainbow-json-schema     noarch  2.0.5-1.el7           epel      30 k
 php-mbstring                      x86_64  5.4.16-36.3.el7_2     updates  504 k
 php-paragonie-random-compat       noarch  1.4.1-1.el7           epel      24 k
 php-password-compat               noarch  1.0.4-1.el7           epel      10 k
 php-process                       x86_64  5.4.16-36.3.el7_2     updates   55 k
 php-seld-cli-prompt               noarch  1.0.0-3.el7           epel     8.2 k
 php-seld-phar-utils               noarch  1.0.1-1.el7           epel     7.7 k
 php-symfony-browser-kit           noarch  2.8.12-2.el7          epel      23 k
 php-symfony-class-loader          noarch  2.8.12-2.el7          epel      26 k
 php-symfony-common                noarch  2.8.12-2.el7          epel     124 k
 php-symfony-config                noarch  2.8.12-2.el7          epel      51 k
 php-symfony-console               noarch  2.8.12-2.el7          epel      88 k
 php-symfony-css-selector          noarch  2.8.12-2.el7          epel      37 k
 php-symfony-debug                 noarch  2.8.12-2.el7          epel      36 k
 php-symfony-dependency-injection  noarch  2.8.12-2.el7          epel      83 k
 php-symfony-dom-crawler           noarch  2.8.12-2.el7          epel      30 k
 php-symfony-event-dispatcher      noarch  2.8.12-2.el7          epel      24 k
 php-symfony-expression-language   noarch  2.8.12-2.el7          epel      27 k
 php-symfony-filesystem            noarch  2.8.12-2.el7          epel      22 k
 php-symfony-finder                noarch  2.8.12-2.el7          epel      38 k
 php-symfony-http-foundation       noarch  2.8.12-2.el7          epel      93 k
 php-symfony-http-kernel           noarch  2.8.12-2.el7          epel      99 k
 php-symfony-polyfill              noarch  1.2.0-1.el7           epel      22 k
 php-symfony-process               noarch  2.8.12-2.el7          epel      32 k
 php-symfony-var-dumper            noarch  2.8.12-2.el7          epel      48 k
 php-symfony-yaml                  noarch  2.8.12-2.el7          epel      28 k

Transaction Summary
================================================================================
Install  1 Package (+34 Dependent packages)

Total download size: 8.9 M
Installed size: 31 M

Alernatively,

Download composer.phar and save as /usr/local/bin/composer then set as an executable.


As of Ampache 3.8.4dev, setup Remi Repository (rpms.remirepo.net) to meet PHP 5.6 requirements.

# yum install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
# yum config-manager --enable remi-php56
# yum clean all
# yum update

$ sudo curl -o /usr/local/bin/composer https://getcomposer.org/composer.phar
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1760k  100 1760k    0     0   212k      0  0:00:08  0:00:08 --:--:--  369k

Set composer as executable.

$ sudo chmod +x /usr/local/bin/composer

Please note as of October 2018 and user wagnered shared the following:

If the Ampache release is installed, installation of Composer isn't necessary. Also .htaccess has already been created.

Database Configuration

Enable MariaDB

$ sudo systemctl enable mariadb
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.

Start MariaDB

$ sudo systemctl start mariadb
$ sudo systemctl status mariadb
● mariadb.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
   Active: active (running) since Sat 2016-12-03 12:43:35 PST; 8min ago
 Main PID: 1558 (mysqld_safe)
   CGroup: /system.slice/mariadb.service
           ├─1558 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
           └─1715 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql...

Dec 03 12:43:33 amp.intranet.harmonson.net mariadb-prepare-db-dir[1479]: You ...
Dec 03 12:43:33 amp.intranet.harmonson.net mariadb-prepare-db-dir[1479]: cd '...
Dec 03 12:43:33 amp.intranet.harmonson.net mariadb-prepare-db-dir[1479]: You ...
Dec 03 12:43:33 amp.intranet.harmonson.net mariadb-prepare-db-dir[1479]: cd '...
Dec 03 12:43:33 amp.intranet.harmonson.net mariadb-prepare-db-dir[1479]: Plea...
Dec 03 12:43:33 amp.intranet.harmonson.net mariadb-prepare-db-dir[1479]: The ...
Dec 03 12:43:33 amp.intranet.harmonson.net mariadb-prepare-db-dir[1479]: You ...
Dec 03 12:43:33 amp.intranet.harmonson.net mysqld_safe[1558]: 161203 12:43:33...
Dec 03 12:43:33 amp.intranet.harmonson.net mysqld_safe[1558]: 161203 12:43:33...
Dec 03 12:43:35 amp.intranet.harmonson.net systemd[1]: Started MariaDB databa...

Run the script below and, generally, accept the defaults.

$ sudo mysql_secure_installation  

PHP Configuration

Increase your max upload, upload_max_filesize, size in /etc/php.ini to 20MB or more. The max post, post_max_size, must be more than the upload_max_filesize. These values can be adjusted to your preference but larger the files, e.g. video, the larger you will need to increase the value. Remember to sudo systemctl restart httpd after changing the values. The values 20M and 40M should be sufficient for lossless audio.

$ sudo vi /etc/php.ini

upload_max_filesize = 20M  
post_max_size = 40M  

Apache Configuration

Per Ampache's Github wiki, mod_rewrite needs to be enabled. For CentOS 7.2.1511 it is enabled by default as you can verify by reviewing conf.modules.d.

$ sudo cat /etc/httpd/conf.modules.d/00-base.conf | grep -i rewrite_module
LoadModule rewrite_module modules/mod_rewrite.so

In addition, permit Ampache to override Apache settings for the Ampache installation directory.

$ sudo vi /etc/httpd/conf/httpd.conf

..

<Directory "/var/www/html">
	AllowOverride All

..

</Directory>

Enable Apache

$ sudo systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.

Start Apache

$ sudo systemctl start httpd
$ sudo systemctl status httpd
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: active (running) since Sat 2016-12-03 12:51:19 PST; 2s ago
     Docs: man:httpd(8)
           man:apachectl(8)
 Main PID: 1872 (httpd)
   Status: "Processing requests..."
   CGroup: /system.slice/httpd.service
           ├─1872 /usr/sbin/httpd -DFOREGROUND
           ├─1876 /usr/sbin/httpd -DFOREGROUND
           ├─1877 /usr/sbin/httpd -DFOREGROUND
           ├─1878 /usr/sbin/httpd -DFOREGROUND
           ├─1879 /usr/sbin/httpd -DFOREGROUND
           └─1880 /usr/sbin/httpd -DFOREGROUND  

Firewall

If using firewalld, skip to the section titled "firewalld."

Update iptables to permit HTTP/HTTPS traffic.

$ sudo iptables -I INPUT -p tcp -m conntrack --ctstate NEW -m tcp --dport 80 -j ACCEPT
$ sudo iptables -I INPUT -p tcp -m conntrack --ctstate NEW -m tcp --dport 443 -j ACCEPT
$ sudo service iptables save

Alternatively, you could copy and paste the script below and execute (chmod +x) as root.

#!/bin/bash

#Flush current policies
iptables -F

# Set default chain policies
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT

# Allow established sessions to receive traffic
iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT

# Accept on localhost
iptables -A INPUT -i lo -j ACCEPT

#ICMP Echo (OPTIONAL)
iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT
iptables -A INPUT -j REJECT --reject-with icmp-host-prohibited

# Accept incoming SSH
iptables -I INPUT -p tcp -m conntrack --ctstate NEW -m tcp --dport 22 -j ACCEPT

# Accetp incoming HTTP/HTTPS
iptables -I INPUT -p tcp -m conntrack --ctstate NEW -m tcp --dport 80 -j ACCEPT
iptables -I INPUT -p tcp -m conntrack --ctstate NEW -m tcp --dport 443 -j ACCEPT

# Save Changes
service iptables save

# Service
systemctl restart iptables
systemctl status iptables

firewalld

To permit HTTP/HTTPS traffic using firewalld.

$ sudo firewall-cmd --permanent --zone=public --add-service=http --add-service=https
$ sudo firewall-cmd --reload

SELinux

Update selinux's configuration file from enforcing to permissive or disabled. If selinux is set for enforcing, ampache.cfg.php will not be writeable. Setting selinux to permissive will permit writing to ampache.cfg.php during initial setup via Ampache's portal.

$ sudo vi /etc/selinux/config

SELINUX=permissive

Updating the file will not update your current session. Use setenforce 0 to set permissive for your session.


After installation and testing of Ampache, update your SELinux configuration to prevent unauthorized changes to ampache.cfg.php.


Ampache Installation

Ampache Github

Enter the web server root directory

$ cd /var/www/html

Clone ampache from github

# git clone https://github.com/ampache/ampache.git

Alternatively, you can specify a branch like the develop(ment) branch.

$ sudo git clone -b develop https://github.com/ampache/ampache.git

Results

Cloning into 'ampache'...
remote: Counting objects: 56678, done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 56678 (delta 4), reused 0 (delta 0), pack-reused 56666
Receiving objects: 100% (56678/56678), 113.75 MiB | 2.68 MiB/s, done.
Resolving deltas: 100% (40157/40157), done.

Grant the web server privileges to the ampache directory.

$ sudo chown -R apache. ampache/

Ampache Composer

Enter the ampache installation directory and execute composer.

$ cd /var/www/html/ampache
$ sudo su -
# composer install --prefer-source --no-interaction

Results

Do not run Composer as root/super user! See https://getcomposer.org/root for details
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
  - Installing wikimedia/composer-merge-plugin (v1.3.0)
    Cloning bfed1f8d4eb97e9ba80eee57ea46229d7e5364d9

  - Installing afterster/php-echonest-api (dev-master master)
    Cloning master

  - Installing symfony/process (v2.8.3)
    Cloning 7dedd5b60550f33dca16dd7e94ef8aca8b67bbfe

and a all whole bunch more so be patient..

Ampache Configuration

Ampache is ready for configuration and testing. Open your browser and use the URL http://<IP-or-Hostname>/ampache and walk through the process to configure.

Note if Ampache is not installed at the Apache root directory, after completing the last configuration web page, the one for setup of the admin user, you may be redirected to "yourhost/login.php" and displayed a 404 error. You must update ampache.cfg.php to reflect Ampache installation location. For example using /var/www/html/ampache

$ sudo vi /var/www/html/ampache/config/ampache.cfg.php

web_path = "/ampache"

Ampache should be ready to configure and create your initial catalog. Select the little "Admin" server icon after logon to begin.

If you run into challenges, check your work!

Upgrade Notes

[root@amp html]# mv ampache ampache383dev
[root@amp html]# git clone -b develop https://github.com/ampache/ampache.git
[root@amp html]# cp ampache.383dev/config/ampache.cfg.php ./ampache/config/
[root@amp html]# cp ampache.383dev/rest/.htaccess ./ampache/rest/
[root@amp html]# cp ampache.383dev/play/.htaccess ./ampache/play/
[root@amp html]# chown -R apache:apache ampache
[root@amp html]# composer install --prefer-source --no-interaction
Clone this wiki locally