Webserver not working

96 views
Skip to first unread message

Samuel Kirby-Bray

unread,
Oct 31, 2024, 3:17:58 PM10/31/24
to weewx-user
I am guessing this topic has probably been covered lots of times - sorry! 
I am running a Raspberry Pi 2(model B) running Weewx 5.1 and NGINX webserver, but no weather reports page is appearing - just get the 404 message. However local host says " Welcome to nginx!".

 I added the following two lines of code
  • Create symbolic link to point webserver to the reports
  • sudo ln -s /var/weewx/reports /var/www/html/weewx
  • Give the web server the ability to read from the directory
  • sudo chmod -R 755 /var/www/html/weewx

The system status reports:-
"
root@DietPi:~# sudo systemctl status weewx
● weewx.service - WeeWX
     Loaded: loaded (/lib/systemd/system/weewx.service; enabled; preset: enabled)
     Active: active (running) since Thu 2024-10-31 17:29:38 GMT; 1min 41s ago
       Docs: https://weewx.com/docs
   Main PID: 2128 (python3)
      Tasks: 2 (limit: 2176)
        CPU: 6.044s
     CGroup: /system.slice/weewx.service
             └─2128 python3 /usr/share/weewx/weewxd.py /etc/weewx/weewx.conf

Oct 31 17:31:00 DietPi weewxd[2128]:     ncopy += weeutil.weeutil.deep_copy_path(path, html_dest_dir)
Oct 31 17:31:00 DietPi weewxd[2128]:              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Oct 31 17:31:00 DietPi weewxd[2128]:   File "/usr/share/weewx/weeutil/weeutil.py", line 1811, in deep_copy_path
Oct 31 17:31:00 DietPi weewxd[2128]:     shutil.copy(path, d)
Oct 31 17:31:00 DietPi weewxd[2128]:   File "/usr/lib/python3.11/shutil.py", line 419, in copy
Oct 31 17:31:00 DietPi weewxd[2128]:     copyfile(src, dst, follow_symlinks=follow_symlinks)
Oct 31 17:31:00 DietPi weewxd[2128]:   File "/usr/lib/python3.11/shutil.py", line 258, in copyfile
Oct 31 17:31:00 DietPi weewxd[2128]:     with open(dst, 'wb') as fdst:
Oct 31 17:31:00 DietPi weewxd[2128]:          ^^^^^^^^^^^^^^^
Oct 31 17:31:00 DietPi weewxd[2128]: PermissionError: [Errno 13] Permission denied: '/var/weewx/reports/seasons.css'
"
I went for NGINX as I understand it uses less memory than Apache and i used the standard debian installation method rather than Setup.py.
Perhaps its a permissions issue? Thanks, Sam.

vince

unread,
Oct 31, 2024, 3:51:44 PM10/31/24
to weewx-user
Yes it has come up lots of times.  Yes then you see "PermissionError: [Errno 13] Permission denied: '/var/weewx/reports/seasons.css'"  that indicates a permissions issue.

My guess is that /var/weewx is owned by root:root and not weewx:weewx which is what the weewx process runs as.  Try running  "chown -R weewx:weewx /var/weewx" to fix it up so the weewx process can write anywhere under the (very unusual) path you are using

Reply all
Reply to author
Forward
0 new messages