Installation

Fat German Productions

Installation

These are basic installation instructions for RompR. These are linux instructions. If you want to install rompr on Mac OS X, have a look at [Installation on Mac OS X]. If you want to install rompr on Windows, pull down your pants and stick your head up your ass.

Thanks to Aubrey Kloppers for creating a Raspberry Pi installer. See his link on the discussion forum - http://sourceforge.net/p/rompr/discussion/general/thread/6a36bb23/

RompR is a client for mpd or mopidy - you use RompR in a web browser to make mpd or mopidy play music.

You will need:

  • One or more computers[1]
  • A modern web browser, with Javascript enabled
  • A tiny amount of patience

Assumptions

I'm going to assume you already have mpd or mopidy installed and working. This is not the place to discuss the arcane art of configuring mpd. For that you'll have to read the mpd community wiki. Sorry about that. The mopidy instructions are quite good.

Mopidy Settings

Make sure you read this : https://sourceforge.net/p/rompr/wiki/Rompr%20and%20Mopidy/
The most important thing is to make sure Mopidy's HTTP frontend is accessible from your browser. In your mopidy.conf you should have

[http]
hostname = ::

Installing RompR

You have various options. RompR requires a webserver to be installed. There are instructions here for Apache, Nginx, and Lighttpd.

Ubuntu PPA

Ubuntu/Mint Users can now install from my PPA:

http://launchpad.net/~fatgerman-m/+archive/rompr

Just follow the instructions to add the PPA, then

sudo apt-get install mpd-client-rompr

This will install rompr and the Apache webserver. This is your best option if you want something that 'just works'. However you'll get better performance if you go with Nginx as described below. It's a little extra effort but well worth it.

Manual Installation on Linux with Apache Web Server

Things work differently depending on whether you use debian-derived or redhat-derived linux. For RedHat-like distros, I've given some info on installing it on Mageia 3 below as well as manual steps for Ubuntu.

Install some packages

RompR needs apache2, php5 and imagemagick to be installed on the same computer.
PHP must not be configured in 'safe mode' or all sorts of awful things will happen.
In addition you need the php modules php5-curl, php5-mbstring, and php5-json. Sometimes they're installed by default and sometimes they're not, so if you get an error about one of the packages not being able to found, just remove it from the following list.

On Ubuntu: sudo apt-get install apache2 php5-curl imagemagick libapache2-mod-php5 php5-json

On Mageia 3 (as root): urpmi apache apache-mod_php php-curl imagemagick php-mbstring

Install RompR

Download the zip file from this website and extract it somewhere. You'll get a bunch of files and directories.

Now you need to find the Apache configuration file.

Users of Apache 2.4 and later (Ubuntu Saucy, Mageia 3)

Use the file rompr/apache_conf.d/Apache2.4/rompr.conf.

Also edit it so that /PATH-TO-ROMPR becomes the path to your installed copy of RompR - i.e. if you extracted the zip file into into /home/you/web/rompr change
/PATH-TO-ROMPR to /home/you/web/rompr. You'll need to change it in several places. Be sure not to miss any.

What you need to do next depends upon your distribution and where it has decided to install stuff. Sigh.

1.) Your apache config directory will either be /etc/apache2 or /etc/httpd depending upon the whims of those who create debs and rpms.

2.) Your apache config directory will either contain a directory called 'conf-available' or one called 'conf.d', or conf/conf.d, or conf/sites.d
Again, there seems to be no logic to when this happens. I think people who understand Apache like making it difficult :)

Find the appropriate directory and copy the edited rompr.conf into it. For example:

sudo cp /home/you/web/rompr/apache_conf.d/Apache2.4/rompr.conf /etc/apache2/conf-available/

On Mageia 3, copying it into sites.d seems to work

cp /home/you/web/rompr/apache_conf.d/Apache2.4/rompr.conf /etc/httpd/conf/sites.d/

If you copied into conf-available enable the configuration:

sudo a2enconf rompr

Users of Apache earlier than 2.4 (Ubuntu Raring and earlier)

Use the file rompr/apache_conf.d/rompr.conf.
Edit that file so that /PATH-TO-ROMPR becomes the path to your installed copy of RompR - i.e. if you extracted the zip file into into /home/you/web/rompr change
/PATH-TO-ROMPR to /home/you/web/rompr. You'll need to change it in several places. Be sure not to miss any. Once edited, copy the file into /etc/apache2/conf.d, or /etc/httpd/conf.d depending upon where your distributions packagers have decided to put it. Just look for one of those folders and trust to luck.

sudo cp /home/you/web/rompr/apache_conf.d/rompr.conf /etc/apache2/conf.d/

All Users

Set Permissions

Apache needs WRITE access to the prefs and albumart directories.
The easy way is: (assuming the above installation path)

chmod -R ugo+rw /home/you/web/rompr/prefs
chmod -R ugo+rw /home/you/web/rompr/albumart

If you want to be more secure about it, then on ubuntu apache runs as the user www-data, so do

sudo chown -R www-data /home/you/web/rompr/prefs
sudo chown -R www-data /home/you/web/rompr/albumart

Or on Mageia 3 (as root)

chown -R apache /home/you/web/rompr/prefs
chown -R apache /home/you/web/rompr/albumart

Enable the required apache modules

On debian/Ubuntu/Mint etc, this is as easy as

sudo a2enmod expires
sudo a2enmod headers
sudo a2enmod deflate
sudo a2enmod php5

On Mageia 3 and other RedHat-like distros they're probably enabled by default. There'll be a config file somewhere, possibly at /etc/httpd/conf/modules.d/00_base.conf and you should find lines like 'LoadModule deflate_module' and one for the headers and expires modules too. If I were you, I'd just assume it's all OK :)

restart apache

sudo service apache2 restart

Or for Mageia 3

service httpd restart

Now you can use rompr

Point your web browser at http://localhost/rompr

Now see [Basic Manual] for a getting started guide.

Manual Installation on Linux with Nginx Web Server

Nginx is a fast and lightweight web server and it works very well. Users of low-powered systems (eg Raspberry Pi, Intel Atom) will find that it is faster and uses less memory than Apache. Users of not low-powered systems will also find it's better than Apache. You should use it.
This guide also sets up PHP with FastCGI, which is waaaaay better than using Apache with 'normal' PHP. You can use FastCGI with Apache, but good luck getting that whole mess to function...

Install some packages

PHP must not be configured in 'safe mode' or all sorts of awful things will happen.
You need the php modules php5-curl, php5-mbstring, php5-json, and php5-fpm. Sometimes they're installed by default and sometimes they're not, so if you get an error about one of the packages not being able to found, just remove it from the following list.
On Ubuntu there are several versions of nginx. If you really want to save memory and space install nginx-light instead of nginx. It's just as good but has a few features removed, and rompr doesn't need any of them.

On Ubuntu : sudo apt-get install nginx php5-curl imagemagick php5-json php5-fpm

On Mageia 3 : urpmi nginx php-curl imagemagick php-mbstring php-fpm

Install RompR

Download the zip file from this website and extract it somewhere. You'll get a bunch of files and directories.

Now you need to edit the nginx configuration file.

If you're not running any other web sites on your machine, then this configuration file should be copied in place of your existing default configuration

On Ubuntu : /etc/nginx/sites-available/default

On Mageia 3 : /etc/nginx/conf.d/default.conf

(this will already exist but you can replace it.) If you're running other sites you will have to combine this file with your default file and install rompr under the correct root directory as specified in your existing default file.

Change /PATH/TO/ROMPR to the path where you installed rompr - eg if you extracted to /home/you/web/rompr then /PATH/TO/ROMPR should become /home/you/web

server {

    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;

    root /PATH/TO/ROMPR;
    index index.php index.html index.htm;

    # Make site accessible from http://localhost/
    server_name localhost;

    # This section can be copied into an existing default setup
    location /rompr {
            allow all;
            index index.php;
            client_max_body_size 32M;
            location ~ \.php {
                    try_files $uri =404;
                    fastcgi_pass unix:/var/run/php5-fpm.sock;
                    fastcgi_index index.php;
                    fastcgi_param SCRIPT_FILENAME $request_filename;
                    include /etc/nginx/fastcgi_params;
            }
            error_page 404 = /rompr/404.php;
            try_files $uri $uri/ =404;
            location ~ /rompr/albumart/* {
                    expires -1s;
            }
    }
}

Mageia 3 Users: Your php-fpm socket may be elsewhere. The default seems to be in /var/lib, so change one line above to

fastcgi-pass unix:/var/lib/php-fpm/php-fpm.sock;

Also the default setup on Mageia 3 seems to be a bit odd. Try doing this.

mv /etc/nginx/conf.d/nginx.conf /etc/nginx/conf.d/

This will overwrite Mageia's default config with a better one.

Set Permissions

Nginx needs WRITE access to the prefs and albumart directories.
The easy way is: (assuming the above installation path)

chmod -R ugo+rw /home/you/web/rompr/prefs
chmod -R ugo+rw /home/you/web/rompr/albumart

If you want to be more secure about it,

sudo chown -R www-data /home/you/web/rompr/prefs
sudo chown -R www-data /home/you/web/rompr/albumart

Edit PHP Settings

One downside of this method is that I can't create a configuration file does this for you.

Ubuntu : /etc/php5/fpm/php.ini

Mageia 3 : /etc/php-cgi-fgci.ini

find the following entries and change their values:

register_globals = Off
allow_url_fopen = On    
post_max_size = 32M
upload_max_filesize = 32M
memory_limit = 256M

Restart Nginx and PHP

Ubuntu:
sudo service php5-fpm restart
sudo service nginx restart

Mageia 3:
service php-fpm restart
service nginx restart

Now you can use rompr

Point your web browser at http://localhost/rompr

Now see [Basic Manual] for a getting started guide.

Manual Installation on Linux with Lighttpd Web Server

This is another good choice for low powered or low memory systems.

Install some packages

PHP must not be configured in 'safe mode' or all sorts of awful things will happen.
You need the php modules php5-curl, php5-mbstring, php5-json, and php5-fpm. Sometimes they're installed by default and sometimes they're not, so if you get an error about one of the packages not being able to found, just remove it from the following list.

sudo apt-get install lighttpd php5-curl imagemagick php5-json php5-fpm

Install RompR

Download the zip file from this website and extract it somewhere. You'll get a bunch of files and directories.

Now you need to edit the lighttpd configuration file.

If you're not running any other web sites on your machine, then this configuration file should be copied to the file /etc/lighttpd/lighttpd.conf. (this will already exist but you can replace it.) If you're running other sites you will have to combine this file with your current settings file and install rompr under the correct root directory as specified in your existing server.document-root.

Change /PATH/TO/ROMPR to the path where you installed rompr - eg if you extracted to /home/you/web/rompr then /PATH/TO/ROMPR should become /home/you/web

server.modules = (
    "mod_access",
    "mod_alias",
    "mod_compress",
    "mod_redirect",

    # RompR requires these two
    "mod_expire",
    "mod_fastcgi"
)

server.document-root        = "/PATH/TO/ROMPR"
server.upload-dirs          = ( "/var/cache/lighttpd/uploads" )
server.errorlog             = "/var/log/lighttpd/error.log"
server.pid-file             = "/var/run/lighttpd.pid"
server.username             = "www-data"
server.groupname            = "www-data"
server.port                 = 80

# FastCGI server (php5-fpm) for RompR
fastcgi.server = (
    ".php" =>
    (( "socket" => "/var/run/php5-fpm.sock"
    ))
)

# Expire header for RompR albumart
expire.url = ( "/rompr/albumart/" => "modification plus 1 seconds" )
# This sets the 404 page globally for the server which is OK if you're only
# running RompR but will affect other sites on your system.
# If you have other sites on this system then you should maybe look at virtual hosts.
# If you don't use the custom 404 page for RompR your album art manager will 
# not work correctly.
server.error-handler-404 = "/rompr/404.php"

index-file.names            = ( "index.php", "index.html", "index.lighttpd.html" )
url.access-deny             = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

compress.cache-dir          = "/var/cache/lighttpd/compress/"
compress.filetype           = ( "application/javascript", "text/css", "text/html", "text/plain" )

# default listening port for IPv6 falls back to the IPv4 port
## Use ipv6 if available
#include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
include_shell "/usr/share/lighttpd/create-mime.assign.pl"
include_shell "/usr/share/lighttpd/include-conf-enabled.pl"

Set Permissions

Lighttpd needs WRITE access to the prefs and albumart directories.
The easy way is: (assuming the above installation path)

chmod -R ugo+rw /home/you/web/rompr/prefs
chmod -R ugo+rw /home/you/web/rompr/albumart

If you want to be more secure about it,

sudo chown -R www-data /home/you/web/rompr/prefs
sudo chown -R www-data /home/you/web/rompr/albumart

Edit PHP Settings

One downside of this method is that I can't create a configuration file does this for you. In

/etc/php5/fpm/php.ini

find the following entries and change their values:

register_globals = Off
allow_url_fopen = On    
post_max_size = 32M
upload_max_filesize = 32M
memory_limit = 256M

Restart Lighttpd and PHP

sudo service php5-fpm restart
sudo service lighttpd restart

Now you can use rompr

Point your web browser at http://localhost/rompr

Now see [Basic Manual] for a getting started guide.

Enabling Rating and Tagging

To add tags and ratings to your tracks, enable smart playlists, and import your last.fm library among other things, you'll need to install a mysql server. See the instructions here:

[Enabling Rating and Tagging]

MPD Communication Settings

In the case where your mpd server is not running on the same PC as your apache server, or you need a password for mpd, or you'd like to use a unix-domain socket to communicate with mpd, point your browser at:

[ip address of apache server]/rompr/?setup

and enter the appropriate values. This page will appear automatically if rompr can't communicate with mpd when you load the page.

Tweaking

Rompr can use the 'Album Artist' tag in MP3 files (mpd doesn't appear to read this for mp4 files) to help it sort your collection more accurately. Unfortunately a lot of people misunderstand what this tag is for. There is no better explanation than the one here: http://www.mkoby.com/2007/02/18/artist-versus-album-artist/. Using the Album Artist tag helps RompR to sort your music into correct albums.

It also helps greatly if your local files are tagged with Musicbrainz IDs. MusicBrainz Picard is a good tagger, though those with large music collections may like to check out Beets.

[1] You install RompR on the same computer as your music player. You can use a web browser on any other computer to control it.


Related

Wiki: Basic Manual
Wiki: Enabling Rating and Tagging
Wiki: Installation on Mac OS X