Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Need help with nginx/rompr #91

#1

I need help troubleshooting my nginx/rompr installation. The problem is almost certainly nginx's access to the rompr files. Following the installation instructions, I downloaded rompr-2.18.zip and unzipped it in /home/andrew/web, creating /home/andrew/web/rompr. I can connect to the nginx welcome page, but I get a "404 Not Found" error trying to access the rompr page. Checking /var/log/nginx/error.log, I see this error:

2025/03/25 18:31:23 [error] 86230#86230: *3 "/home/andrew/web/index.php" is forbidden (13: Permission denied), client: 192.168.1.22, server: euterpe, request: "GET / HTTP/1.1", host: "euterpe"
2025/03/25 18:31:24 [error] 86230#86230: *3 open() "/home/andrew/web/favicon.ico" failed (13: Permission denied), client: 192.168.1.22, server: euterpe, request: "GET /favicon.ico HTTP/1.1", host: "euterpe", referrer: "http://euterpe/"

There is no index.php file under /home/andrew/web. There is an index.php file under /home/andrew/web/rompr. Is /home/andrew/web/rompr/index.php the file nginx is trying to access? What is the proper way to make it available? Copy it up a level?

Thanks in advance!

  • replies 13
  • views 99
  • likes 0
#2
awr042 · Author
#3

"http://euterpe/rompr" does not work. With "http://192.168.1.26" (http://euterpe/), I get the welcome page:

Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.

For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.

Thank you for using nginx.

With "HTTP://192.168.1.26/rompr", I get the error page:

404 Not Found
nginx/1.22.1

/var/log/nginx/access.log contains this line:

192.168.1.247 - - [26/Mar/2025:11:20:35 -0400] "GET /rompr/ HTTP/1.1" 404 187 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36"

/var/log/nginx/error.log is empty this morning. Yesterday, I got this error:

2025/03/25 19:59:49 [error] 86229#86229: *11 "/home/andrew/web/index.php" is forbidden (13: Permission denied), client: 192.168.1.22, server: euterpe, request: "GET / HTTP/1.1", host: "euterpe"
2025/03/25 19:59:50 [error] 86229#86229: *11 open() "/home/andrew/web/favicon.ico" failed (13: Permission denied), client: 192.168.1.22, server: euterpe, request: "GET /favicon.ico HTTP/1.1", host: "euterpe", referrer: "http://euterpe/"

There is no index.php under /home/andrew/web. When I unzipped rompr-2.18.zip in the web directory, it created a /home/andrew/web/rompr subdirectory with all the files there:

root@euterpe:/var/log/nginx# ls -l /home/andrew/web/
total 12224
drwxrwxr-x 31 andrew andrew     4096 Mar 25 19:54 rompr
-rw-r--r--  1 andrew andrew 12494892 Mar 10 15:35 rompr-2.18.zip

root@euterpe:/var/log/nginx# ls /home/andrew/web/rompr
404.php		browser      getRemoteImage.php  INSTALL.txt	       phpinfo.php   resources		snapcast       timezones.txt
alarmclock.php	collection   getShrunkImage.php  international	       player	     romonitor.php	snoozer.php    ui
albumart	css	     gettheme.php	 jquery		       plugins	     rompr_backend.php	speedtest.php  updateinfo
albumart.php	favicon.ico  _header		 jshash-2.2	       prefs	     search		streamplugins  util_classes
api		fonts	     iconsets		 LICENSE.txt	       radios	     setupscreen.php	sw.js	       utils
apitest.php	get_css.php  includes		 manifest.webmanifest  README.md     skins		theme_base
backends	getid3	     index.php		 newimages	       README_ru.md  sleeptimer.php	themes

In the /etc/nginx/sites-available/rompr file, I have this line:

root /home/andrew/web;

What should I be looking for to resolve this problem? Any ideas why I'm not logging any error messages this morning?

Thanks!

#4

This tells us that adding /rompr to the url is the correct thing to do.

The problem is probably permissions. Which distro are you using? Some distros need the webserver to have read/write permission all the way down from /, so just changing permissions on the install directory won't work.

In those cases changing permissions on your home directory often doesn't work because the system will change them back. The easiest and most secure option is to move rompr to somewhere that does have permission, and modify the nginx config to match.

Sorry I can't be more help. I run it on Debian and it works, I don't have time to try all the different distros. If only they could all agree on how to do things?

awr042 · Author
#5

Thanks for trying to help. It is much appreciated.

I'm installing RompR on a Raspberry Pi, running the lasted Raspberry Pi OS:

andrew@euterpe:~ $ cat /etc/*release*
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

I get that the problem is likely permissions. I just don't know where to look. I'm hoping you can help me with that. Here is the RompR chain in my home directory:

andrew@euterpe:~ $ ls -l /home/andrew
total 40
...
drwxrwxr-x 3 andrew andrew 4096 Mar 27 09:23 web
...

andrew@euterpe:~ $ ls -la /home/andrew/web
total 12216
drwxrwxr-x  3 andrew andrew     4096 Mar 27 09:23 .
drwxrw-rw- 17 andrew andrew     4096 Mar 27 09:23 ..
drwxrwxr-x 31 andrew andrew     4096 Mar 27 09:25 rompr
-rw-r--r--  1 andrew andrew 12494892 Mar 10 15:35 rompr-2.18.zip

andrew@euterpe:~ $ ls -la /home/andrew/web/rompr
total 268
drwxrwxr-x 31 andrew   andrew    4096 Mar 27 09:25 .
drwxrwxr-x  3 andrew   andrew    4096 Mar 27 09:23 ..
-rw-rw-r--  1 andrew   andrew    1842 Jan  4 10:52 404.php
-rw-rw-r--  1 andrew   andrew    7963 Jan  4 10:52 alarmclock.php
drwxr-xr-x  2 www-data www-data  4096 Mar 27 09:25 albumart
-rw-rw-r--  1 andrew   andrew   10099 Jan  4 10:52 albumart.php
drwxrwxr-x 13 andrew   andrew    4096 Jan  4 10:52 api
-rw-rw-r--  1 andrew   andrew    1489 Jan  4 10:52 apitest.php
drwxrwxr-x  3 andrew   andrew    4096 Jan  4 10:52 backends
drwxrwxr-x  6 andrew   andrew    4096 Jan  4 10:52 browser
drwxrwxr-x  3 andrew   andrew    4096 Jan  4 10:52 collection
drwxrwxr-x  4 andrew   andrew    4096 Jan  4 10:52 css
-rw-rw-r--  1 andrew   andrew    1150 Jan  4 10:52 favicon.ico
drwxrwxr-x  2 andrew   andrew    4096 Jan  4 10:52 fonts
-rw-rw-r--  1 andrew   andrew    1326 Jan  4 10:52 get_css.php
drwxrwxr-x  2 andrew   andrew    4096 Jan  4 10:52 getid3
-rw-rw-r--  1 andrew   andrew    2018 Jan  4 10:52 getRemoteImage.php
-rw-rw-r--  1 andrew   andrew     224 Jan  4 10:52 getShrunkImage.php
-rw-rw-r--  1 andrew   andrew    2374 Jan  4 10:52 gettheme.php
-rw-rw-r--  1 andrew   andrew     383 Jan  4 10:52 _header
drwxrwxr-x 21 andrew   andrew    4096 Jan  4 10:52 iconsets
drwxrwxr-x  2 andrew   andrew    4096 Jan  4 10:52 includes
-rw-rw-r--  1 andrew   andrew   12418 Jan  4 10:52 index.php
-rw-rw-r--  1 andrew   andrew     156 Jan  4 10:52 INSTALL.txt
drwxrwxr-x  2 andrew   andrew    4096 Jan  4 10:52 international
drwxrwxr-x  2 andrew   andrew    4096 Jan  4 10:52 jquery
drwxrwxr-x  2 andrew   andrew    4096 Jan  4 10:52 jshash-2.2
-rw-rw-r--  1 andrew   andrew    1937 Jan  4 10:52 LICENSE.txt
-rw-rw-r--  1 andrew   andrew     745 Jan  4 10:52 manifest.webmanifest
drwxrwxr-x  2 andrew   andrew    4096 Jan  4 10:52 newimages
-rw-rw-r--  1 andrew   andrew      22 Jan  4 10:52 phpinfo.php
drwxrwxr-x  5 andrew   andrew    4096 Jan  4 10:52 player
drwxrwxr-x  4 andrew   andrew    4096 Jan  4 10:52 plugins
drwxr-xr-x  2 www-data www-data  4096 Mar 27 09:25 prefs
drwxrwxr-x  5 andrew   andrew    4096 Jan  4 10:52 radios
-rw-rw-r--  1 andrew   andrew    1414 Jan  4 10:52 README.md
-rw-rw-r--  1 andrew   andrew    1275 Jan  4 10:52 README_ru.md
drwxrwxr-x  2 andrew   andrew    4096 Jan  4 10:52 resources
-rw-rw-r--  1 andrew   andrew    1002 Jan  4 10:52 romonitor.php
-rw-rw-r--  1 andrew   andrew    6869 Jan  4 10:52 rompr_backend.php
drwxrwxr-x  2 andrew   andrew    4096 Jan  4 10:52 search
-rw-rw-r--  1 andrew   andrew    9588 Jan  4 10:52 setupscreen.php
drwxrwxr-x  5 andrew   andrew    4096 Jan  4 10:52 skins
-rw-rw-r--  1 andrew   andrew    1677 Jan  4 10:52 sleeptimer.php
drwxrwxr-x  2 andrew   andrew    4096 Jan  4 10:52 snapcast
-rw-rw-r--  1 andrew   andrew    1104 Jan  4 10:52 snoozer.php
-rw-rw-r--  1 andrew   andrew    2152 Jan  4 10:52 speedtest.php
drwxrwxr-x  3 andrew   andrew    4096 Jan  4 10:52 streamplugins
-rw-rw-r--  1 andrew   andrew     161 Jan  4 10:52 sw.js
drwxrwxr-x  2 andrew   andrew    4096 Jan  4 10:52 theme_base
drwxrwxr-x  2 andrew   andrew    4096 Jan  4 10:52 themes
-rw-rw-r--  1 andrew   andrew    8767 Jan  4 10:52 timezones.txt
drwxrwxr-x  2 andrew   andrew    4096 Jan  4 10:52 ui
drwxrwxr-x 12 andrew   andrew    4096 Jan  4 10:52 updateinfo
drwxrwxr-x  2 andrew   andrew    4096 Jan  4 10:52 util_classes
drwxrwxr-x  2 andrew   andrew    4096 Jan  4 10:52 utils

It's a big ask, but do you see any problems with ownership or permissions here? If not, where should I look next?

Thanks!!!

#6

Hmm this is strange, I'm using a Pi too.

What are the permissions on /home/andrew and /home?

#7

Also check in /etc/nginx/sites-available. If there is a "default" in there, delete it and restart nginx.

#8

Sorry that should have read sites-enabled

awr042 · Author
#9

Here are the permissions for /home and /home/andrew

root@euterpe: ~ # ls -ld /home
drwxr-xr-x 4 root root 4096 Mar 10 11:46 /home
root@euterpe: ~ # ls -ld /home/andrew
drwxrwxr-x 17 andrew andrew 4096 Mar 27 09:23 /home/andrew

I deleted "default" from both sites-avaiable and sites-enabled. Now I don't get the nginx Welcome page, and I get "403 Forbidden" for http://192.168.1.26/rompr.

Sigh. Any more suggestions?

Thanks!

#10

This is very odd. Can you post your nginx rompr config file? And is there anything in the logs? It kind of sounds like you missed a step during the setup, but 403 is a strange error to get. All the permissions look ok.

awr042 · Author
#11

First, thanks very much for continuing to help. I'm sure I'll be pissed when I find out what I did wrong. :)

Here's my /etc/nginx/sites-available/rompr file:

server {

    listen 80;
    listen [::]:80;

    root /home/andrew/web;
    #root /home/andrew/web/rompr;
    index index.php index.html index.htm;

    server_name euterpe;

    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;

                # This line for Debian / Ubuntu
                fastcgi_pass unix:/run/php/php-fpm.sock;
                # This line for Arch / Manjaro
                #fastcgi_pass unix:/run/php-fpm/php-fpm.sock;

                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $request_filename;
                include /etc/nginx/fastcgi_params;
                fastcgi_read_timeout 1800;
        }
        error_page 404 = /rompr/404.php;
        try_files $uri $uri/ =404;
        location ~ /albumart/* {
                expires -1s;
        }
    }
}

I deleted the default file from both sites-available and sites-enabled. Is that a bad thing?

This is /var/log/nginx/error.log.1

2025/03/27 18:31:17 [error] 110681#110681: *1 "/home/andrew/web/index.php" is forbidden (13: Permission denied), client: 192.168.1.22, server: euterpe, request: "GET / HTTP/1.1", host: "192.168.1.26"
2025/03/27 18:31:34 [error] 110681#110681: *1 open() "/home/andrew/web/rompr" failed (13: Permission denied), client: 192.168.1.22, server: euterpe, request: "GET /rompr HTTP/1.1", host: "192.168.1.26"
2025/03/27 18:34:41 [error] 110723#110723: *1 "/home/andrew/web/index.php" is forbidden (13: Permission denied), client: 192.168.1.22, server: euterpe, request: "GET / HTTP/1.1", host: "192.168.1.26"
2025/03/27 18:38:23 [error] 110725#110725: *3 open() "/home/andrew/web/rompr" failed (13: Permission denied), client: 192.168.1.22, server: euterpe, request: "GET /rompr HTTP/1.1", host: "192.168.1.26"

This is the contents of /var/log/nginx/access.log.1:

192.168.1.247 - - [27/Mar/2025:09:28:28 -0400] "GET /favicon.ico HTTP/1.1" 404 187 "http://192.168.1.26/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36"
192.168.1.247 - - [27/Mar/2025:09:28:35 -0400] "GET /rompr HTTP/1.1" 404 187 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36"
192.168.1.22 - - [27/Mar/2025:18:31:17 -0400] "GET / HTTP/1.1" 403 186 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36"
192.168.1.22 - - [27/Mar/2025:18:31:34 -0400] "GET /rompr HTTP/1.1" 403 186 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36"
192.168.1.22 - - [27/Mar/2025:18:34:41 -0400] "GET / HTTP/1.1" 403 186 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36"
192.168.1.22 - - [27/Mar/2025:18:38:23 -0400] "GET /rompr HTTP/1.1" 403 186 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36"
192.168.1.22 - - [27/Mar/2025:18:41:21 -0400] "GET /rompr HTTP/1.1" 301 169 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36"
192.168.1.22 - - [27/Mar/2025:18:41:32 -0400] "GET /rompr/ HTTP/1.1" 200 2803 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36"
192.168.1.22 - - [27/Mar/2025:18:41:32 -0400] "GET /rompr/get_css.php?setupversion=1743115292&skin=desktop HTTP/1.1" 200 74211 "http://192.168.1.26/rompr/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36"
192.168.1.22 - - [27/Mar/2025:18:41:32 -0400] "GET /rompr/gettheme.php?setupversion=1743115292 HTTP/1.1" 200 14255 "http://192.168.1.26/rompr/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36"
192.168.1.22 - - [27/Mar/2025:18:41:32 -0400] "GET /rompr/jquery/jquery-3.6.4.min.js HTTP/1.1" 200 89795 "http://192.168.1.26/rompr/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36"
192.168.1.22 - - [27/Mar/2025:18:41:32 -0400] "GET /rompr/ui/setupbits.js?setupversion=1743115292 HTTP/1.1" 200 367 "http://192.168.1.26/rompr/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36"
192.168.1.22 - - [27/Mar/2025:18:41:33 -0400] "GET /rompr/iconsets/New-Dark-Circled/togglebutton-new2-on.svg HTTP/1.1" 200 15966 "http://192.168.1.26/rompr/get_css.php?setupversion=1743115292&skin=desktop" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36"
192.168.1.22 - - [27/Mar/2025:18:41:33 -0400] "GET /rompr/iconsets/New-Dark-Circled/togglebutton-new2-off.svg HTTP/1.1" 200 11965 "http://192.168.1.26/rompr/get_css.php?setupversion=1743115292&skin=desktop" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36"
192.168.1.22 - - [27/Mar/2025:18:41:33 -0400] "GET /rompr/iconsets/New-Dark-Circled/blobdown3.svg HTTP/1.1" 200 2627 "http://192.168.1.26/rompr/get_css.php?setupversion=1743115292&skin=desktop" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36"
192.168.1.22 - - [27/Mar/2025:18:41:33 -0400] "GET /rompr/newimages/favicon-32.png HTTP/1.1" 200 2339 "http://192.168.1.26/rompr/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36"

Do you know what to make of this error in error.log.1?:

"/home/andrew/web/index.php" is forbidden (13: Permission denied

There is no /home/andrew/web/index.php file. There is a /home/andrew/web/rompr/index.php file. I've tried to determine what configuration is sets the path for that file, but haven't gotten it right.

Again, thanks for the help!

#12

"/home/andrew/web/index.php" is forbidden (13: Permission denied

It'll look for that file if you don't put /rompr on the end of the url. Ignore it, it's irrelevant.

I can see from the access log that it is actually getting some of the files, which makes the error even more confusing.

Check the permissions on /run/php/php-fpm.sock

What happens if you try http://ip.add.rre.ss/rompr/index.php?setup

awr042 · Author
#13

Hey, when I ran http://192.168.1.26/rompr/index.php?setup, I actually got the setup page :). When tried changing the log level to debug. I got this response:

There was an error when communicating with your mpd or mopidy server:
ACK [4@0]{status} you don't have permission for "status"
If you are having connection issues, try using an IP address instead of "localhost"
Note: localhost in this context means the computer running the webserver

Checking the permissions on /run/php/php-fpm.sock, the results of 'ls -l' on the directory is this:

root@euterpe:/run/php# ls -l /run/php
total 4
-rw-r--r-- 1 root     root      5 Mar 25 18:43 php8.2-fpm.pid
srw-rw---- 1 www-data www-data  0 Mar 25 18:43 php8.2-fpm.sock
lrwxrwxrwx 1 root     root     30 Mar 11 20:41 php-fpm.sock -> /etc/alternatives/php-fpm.sock

This is the listing for the link:

root@euterpe:/run/php# ls -l /etc/alternatives/php-fpm.sock 
lrwxrwxrwx 1 root root 24 Mar 11 20:41 /etc/alternatives/php-fpm.sock -> /run/php/php8.2-fpm.sock

Again, thank you very much!

#14

Well that is interesting. I don't know why this is giving you a 403 error, but you've got a problem in your mpd setup.

ACK [4@0]{status} you don't have permission for "status"

This will be a setting in your mpd.conf. It might be that you need a password (in which case you can enter it on the setup page). It might be that you need to use an IP instead of "localhost". All these can be fixed in mpd.conf. I'm not up to date with the defaults for mpd.conf since I prefer mopidy so I'm afraid you're on your own here.