I've run this successfully twice now. It's pretty crude, and requires you run this as pi from the root of your home drive.
You will need to create 3 files at the root of the pi user's home drive:
install.sh
php_append.txt
rompr
Contents of each file:
install.sh
#!/bin/bash
# Rompr install script This script is alpha quality at best. It will work with Raspbian from 10/10/2020 that' fully patched.
# I tried to script all the steps needed to from the RompR web page.
# This script is INSECURE. It uses a lot of sudo commands and assumes you'll run it as the pi user.
#Install nginx web server, php and other needed coponents
if [ ! -d "/home/pi/backup-rompr" ]
then
mkdir /home/pi/backup-rompr
fi
sudo apt install -y nginx php-curl php-sqlite3 php-gd php-json php-xml php-mbstring php-fpm imagemagick
# Add connection timeout to the end of your mpd configuration file
cp /etc/mpd.conf ~/backup-rompr
sudo echo 'connection_timeout "120"' >> /etc/mpd.conf
# Switch to the web root directory
cd /var/www
# Copy RompR down using git
sudo apt install -y git
sudo git clone https://github.com/fatg3erman/RompR.git
# Create needed prefs and albumart directories
sudo mkdir /var/www/RompR/albumart
sudo mkdir /var/www/RompR/prefs
# change permissions on the RompR directory, so the Nginx web server has access to it.
sudo chown -R www-data /var/www/RompR
sudo chgrp -R www-data /var/www/RompR
# Read the hostname into a variable
host=$(hostname)
# Update default nginx config as per RompR documentation
cp /etc/nginx/sites-available/default ~/backup-rompr
sudo sed -i 's/ default_server;/;/' /etc/nginx/sites-available/default
# Add your Raspberry Pi's hostname into the rompr config file
sudo sed -i "s/hostname.of.your.computer/$host/" ~/rompr
# Copy the RompR config file into the nginx config directory and change it's permissions to match the other files in that directory
sudo cp ~/rompr /etc/nginx/sites-available
sudo chmod 644 /etc/nginx/sites-available/rompr
# Enable the RompR config
sudo ln -s /etc/nginx/sites-available/rompr /etc/nginx/sites-enabled/rompr
# Update php.ini with required settings
cp /etc/php/7.3/fpm/php.ini ~/backup-rompr
sudo cat ~/php_append.txt >> /etc/php/7.3/fpm/php.ini
# Enable php-fpm daemon and nginx
sudo systemctl enable php7.3-fpm
sudo systemctl enable nginx
# Restart php and nginx
sudo systemctl restart php7.3-fpm
sudo systemctl restart nginx
echo "Install is complete. You should be able to access your music server by pointing a browser at http://$host/RompR"
rompr
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www;
index index.php index.html index.htm;
server_name hostname.of.your.computer;
client_max_body_size 256M;
# This section can be copied into an existing default setup
location /RompR/ {
allow all;
index index.php;
location ~ \.php {
try_files $uri index.php =404;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include /etc/nginx/fastcgi_params;
fastcgi_read_timeout 1800;
}
error_page 404 = /404.php;
try_files $uri $uri/ =404;
location ~ /albumart/* {
expires -1s;
}
}
}
php_append.txt
llow_url_fopen = On
memory_limit = 128M
max_execution_time = 1800
post_max_size = 256M
upload_max_filesize = 10M
max_file_uploads = 200
Just run ./install.sh and you should have a working RompR server when all is done.
I welcome any and all constructive criticisms on how to do it better. I am not a professional developer. I'm just a Linux geek.