How to: install ampache from git in a plugin jail

Status
Not open for further replies.

ses1984

Cadet
Joined
Jul 31, 2014
Messages
6
Note: this guide is a work in progress. Also, I was wondering...what's the next step from here? Once I get this jail working properly, I guess I could make a template or plug in out of it. That's the next thing I want to work on.

#####

I ran into some weird problems. I'm trying to install all these packages via the pkg tool, but it looks like the pkg list is outdated from what it available through http://pkg.FreeBSD.org/freebsd:9:x86:64/latest/All/

For example, I'm trying to install php56-dba and php56-xml, the pkg tool says all repositories are up to date, then it tries to fetch version 5.6.2 when 5.6.3 is what you can see in the above repo.

I solved this by doing pkg update -f

#####

I tried installing ampache from the bsd port package and it kept crashing when adding my catalog. The http process would get pegged at 100% doing nothing.

I wanted to try to get the bottom of the problem and found that the port is actually quite an old version, so I wanted to see if the problem would persist if I upgraded. If you try to bring up issues like this with the package maintainers or even users, they usually want you to upgrade to see if the problem has already been fixed.

I'm going to attempt installing from source.

Execute the following commands in a new plugin jail.

Code:
: install required packages
pkg install -y devel/git \
  www/apache24 \
  devel/apr1 \
  lang/php56 \
  databases/mysql56-server \
  databases/mysql56-client \
  databases/php56-pdo \
  databases/php56-pdo_mysql \
  textproc/php56-xml \
  textproc/php56-simplexml \
  www/mod_php56 \
  www/php56-session \
  converters/php56-iconv \
  archivers/php56-zlib \
  security/php56-hash \
  devel/php56-json \
  ftp/php56-curl

: configure required services to auto start
echo 'mysql_enable="YES"' >> /etc/rc.conf
echo 'apache24_enable="YES"' >> /etc/rc.conf

::::::::::::::::::::::::::::::::::::::::::::::::
: user should be careful to review the output from the following
: commands to make sure the services start properly
service mysql-server start
service apache24 start

: allow apache to interpret php
echo 'application/x-httpd-php  php' >> /usr/local/etc/apache24/mime.types

: get ampache from source
mkdir /usr/local/www
cd /usr/local/www
git clone https://github.com/ampache/ampache.git
chown -R www:www ampache

: User must replace PASSWORD('Foo') with own password
echo "UPDATE mysql.user SET Password=PASSWORD('Foo') WHERE User='root'; FLUSH PRIVILEGES;" > mysqlupdate.sql
mysql < mysqlupdate.sql
rm mysqlupdate.sql
: room for improvement here. don't think I need to write to mysqlupdate.sql



Coming from a debian background, apache is configured slightly differently, where the httpd.conf does not actually include any virtual host configs, but instead a watch directory like /etc/apache24/sites-enabled is configured where virtual hosts go. In this case since the jail is just going to run one service, the virtual host can go directly in the main config.

In /usr/local/etc/apache24/httpd.conf , replace the section under DocumentRoot with this VirtualHost:

Code:
<VirtualHost *:80>
  ServerName ampache
  DocumentRoot "/usr/local/www/ampache"
  Alias /ampache "/usr/local/www/ampache"
  php_admin_flag engine on
  DirectoryIndex index.php
  <Directory "/usr/local/www/ampache">
  allow from all
  order allow,deny
  AllowOverride All
  </Directory>
</VirtualHost>


Then

Code:
service apache24 restart


Then visit http://ampache_hostname/ampache/install.php in your browser and finish the installation.
 
Last edited:

nicosalto

Dabbler
Joined
Nov 25, 2016
Messages
40
Hi, Thanks for the tutorial. i tried to installed ampache, but it didnt worked...
Would you have an updated tutorial ?
 
Status
Not open for further replies.
Top