HTML perms issue for 5.0

82 views
Skip to first unread message

Rob Cranfill

unread,
Jun 1, 2024, 3:22:31 PM6/1/24
to weewx-user
Hey, all!

Just upgraded to 5.02 from 4.10.something, and now WeeWX can't output to my web server directory. I'm sure it's some dumb permissions thing I'm missing, but I am not seeing it.

I get a bazillion errors like this in the log:

Jun 01 12:16:15 pi4 weewxd[3424852]: ERROR weewx.imagegenerator: Unable to save to file '/var/www/html/weather/daybarometer.png' [Errno 13] Permission denied: '/var/www/html/weather/daybarometer.png':

My new install is running as user weewx, as intended:
rob@pi4: $ ps aux | grep wee
weewx    3424852  4.9  2.8 358576 53528 ?        Ssl  11:38   1:42 python3
/usr/share/weewx/weewxd.py /etc/weewx/weewx.conf

I added that user to some groups (for my USB interface and the HTML directory)
rob@pi4: $ groups weewx
weewx : weewx dialout www-data


And here are the permissions along that directory path. See anything untowards?
drwxr-xr-x 12 root root 4.0K Dec  7 20:36 /var
drwxr-xr-x 3 root root 4.0K Dec  7 20:36 /var/www/
drwxr-xr-x 4 www-data www-data 4.0K Jun  1 10:58 /var/www/html/
drwxrwxr-x 6 www-data www-data 4.0K Jun  1 11:25 /var/www/html/weather/


Thanks for any suggestions. I can post more info if that will help. The logs show nothing else interesting that I can see.

 /rob
 

Warren Gill

unread,
Jun 1, 2024, 3:42:47 PM6/1/24
to weewx...@googlegroups.com
There might be files left over from pre-upgrade that are still owned by www-data (daybarometer.png, for example). I'd just go into the /var/www/html/weather/ directory and remove everything and let weewx build new ones. Or, chown weewx:weewx * in the weather directory


--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/08ee001f-caa9-4982-9f13-1c2be9d3bdaan%40googlegroups.com.

Rob Cranfill

unread,
Jun 1, 2024, 4:18:32 PM6/1/24
to weewx-user
Thanks for the idea, but that didn't fix it.

vince

unread,
Jun 1, 2024, 4:31:47 PM6/1/24
to weewx-user
I would "sudo chown -R weewx:weewx /var/www/html/weather" so the directory and its contents are owned by the weewx user that the weewx process runs as. 

Rob Cranfill

unread,
Jun 1, 2024, 6:12:31 PM6/1/24
to weewx-user
That seems to have done it! Thanks :)

One odd thing: I had to copy the old seasons.css and seasons.js files over, by hand. Whatev.
Reply all
Reply to author
Forward
0 new messages