Installing Ampache on CentOS 7 (Apache, MariaDB, PHP 5.4)
This is way out of date now
The information in this post is so out-dated that I wonder why I'm keeping it around. I guess I'm a digital hoarder...
Been getting bored and spinning up VMs like a fiend here of late. The latest one is an Ampache Server.
This one had proven to be more of a chore than I'd originally hoped. CentOS 7 may not have been the best distro to try this on...
Installing the needed packages.
yum install httpd php-gd php-pdo php-mysql php mariadb mariadb-server
Start and enable the services.
systemctl start mariadb httpd
systemctl enable mariadb httpd
Initialize MariaDB and set your MariaDB root user password. (I accepted the defaults all the way through)
(You will be able to specify the database name, user, etc in the web installer, so we do not need to create and users/databases/tables ourselves.)
I chose to clone Ampache via Git. You could also download the Release Archive
I'm also going to throw it in the default httpd document root, as I don't plan to add any other web sites or services to this server.
git clone https://github.com/ampache/ampache.git
chown -R apache. ampache/
# Using rsync to copy all items from ampache/ to /var/www/html then
# removing the /var/www/html/ampache directory.
rsync -av /var/www/html/ampache/ /var/www/html/
rm -rf /var/www/html/ampache/
Increase your max upload size in
/etc/php.ini to 20MB or more.
From the installer Requirements Check
"This is not strictly necessary, but may result in a better experience."
Find the following settings in your php.ini file and adjust. I used 20M upload and double that for post.
upload_max_filesize = 20M
post_max_size = 40M
Now restart httpd so the settings are used.
systemctl restart httpd
FFMPEG and some encoders
I was surprised to find no FFMPEG packages in the default repos (or epel). After some DuckDuckGoing, I decided that FFMPEG is not packaged for CentOS 7 (yet?).
Time to get the standard tool set plus a little something for ffmpeg (yasm).
yum groupinstall "Development Tools"
yum install yasm
Again, after some searching I decided that libmp3lame is not in CentOS 7's repos (epel or otherwise) so we will need to install it from source.
tar -xvf lame-3.99.5.tar.gz
The next encoder, libvorbis, was easier to come by. Just had to install libvorbis-devel.
yum install libvorbis-devel
Now we can get the sourcecode for ffmpeg.
tar -xvf ffmpeg-2.4.3.tar
Configure and Compile. Make might take awhile...
(During make, you will probably get some warnings. This is 'normal'(?). AKA - it warned about deprecated items...but still worked)
./configure --enable-libmp3lame --enable-libvorbis
After that finished, I tried testing ffmpeg, but was hit with an unexpected error.
ffmpeg: error while loading shared libraries: libmp3lame.so.0: cannot open shared object file: No such file or directory"
Now, I bet there is a better way to do this, but for now I'm just going to
symlink the library to
/usr/lib and run
ln -s /usr/local/lib/libmp3lame.so.0.0.0 /usr/lib/libmp3lame.so.0
That should do it for ffmpeg with mp3 and ogg encoding.
You will need to open ports 80 at the least and also port 443 if you plan to enable SSL.
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
SeLinux will probably step on you during the next steps. It caused issues on my setup with write permissions for the apache user and allowing a connection to the database.
setsebool -P httpd_unified on
Ampache First Time Setup
Just follow the steps and you should be good to go.
I plan to write up another doc targeted at using Ampache and setting up your first Catalog...but right now I'm lazy, so you will just have to wait or stumble through it on your own.