Ampache on CentOS

This tutorial was written for CentOS 5.5. Most commands presented require root privileges. Its best to achieve this with the sudo command, but that's beyond the scope of this tutorial.

Installation of Ampache From Source

Requirements

  • Apache
  • PHP 5.2
  • MySQL 5.x or higher

Obtain Source

First checkout the latest stable branch. At the time of writing this was version 3.5.

 svn checkout https://svn.ampache.org/branches/3.5/ ampache35

Check Dependencies

For this tutorial we assume Apache is already installed. Lets check our other two requirements PHP and MySQL.

 yum list php
 php.i386                       5.1.6-27.el5                        installed
 yum list mysql-server
 mysql-server.i386              5.0.77-4.el5_5.3                    base

The PHP version in the base CentOS 5 repository is too old so we need to obtain a newer version from another repository. In this tutorial it is assumed MySQL is not installed. If it is installed then skip the MySQL installation steps.

Install PHP 5.2+

Fortunately there is a PHP 5.2+ package in the CentOS Testing repository. We will now add that repository to yum and use it just for php packages. Go to /etc/yum.repos.d and create a new file called CentOS-Testing.repo. Put this in the file:

 [c5-testing]
 name=CentOS-5 Testing
 baseurl=http://dev.centos.org/centos/$releasever/testing/$basearch/
 enabled=1
 gpgcheck=1
 gpgkey=http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing
 #exclude all packages except packages that match php-*
 includepkgs=php-*

Now install the required PHP packages:

 yum install php
 yum install php-mysql
 yum install php-mbstring

Install MySQL

The package in the CentOS 5 repository is new enough for Ampache.

 yum groupinstall "MySQL Database"

Start the MySQL daemon and set the password for the MySQL root user.

 /sbin/service mysqld start
 mysqladmin -u root password some_password

Make the mysqld daemon start on boot.

 /sbin/chkconfig mysqld on

Install Ampache

Now we have all of the dependencies required. Lets install Ampache now.

 mkdir /var/www/ampache
 /bin/cp -R ./ampache35/* /var/www/ampache/
 chown apache.apache -R /var/www/ampache/*

Go to /etc/httpd/conf.d/ and create a file called ampache.conf. Put this in ampache.conf:

 Alias /ampache "/var/www/ampache"
 <Directory "/var/www/ampache">
      AllowOverride None
      Order allow,deny
      Allow from all
 </Directory>

Now restart Apache.

 /sbin/service httpd restart

Browser Based Setup

Open a web browser and go to http://yoursite/ampache. You should now see a PHP Ampache installation script with all of the requirements OK'd. Click the Start Configuration button on the bottom of the page.

Fill out the information below supplying your MySQL root password. Click the Create Database User for New Database checkbox and enter a password for the new MySQL user ampache. Click the Insert Database button to continue.

Now we're going to create the config file. Enter the MySQL ampache user information and click the Write Config button. This will prompt you to save the config file. Save the config file to your desktop then enter the following commands as root:

 cp /home/some_username/Desktop/ampache.cfg.php /var/www/ampache/config/
 rm /home/some_user/Desktop/apache.cfg.php

Click the check for config link and it should give you the OK. Proceed to the next step.

Create an admin account. After that you are officially finished with the installation of Ampache on CentOS 5.

SELinux

If SELinux is enabled and your music folder is outside of the /var/www/ directory, then you'll have to change the security context of your music folder.

 chcon -R -t httpd_sys_content_t ./music
install/centos.txt · Last modified: 2010/08/08 09:11 by darkant
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki