Configuring weewx access to apache2 web root

68 views
Skip to first unread message

Dan Hinckley

unread,
May 8, 2026, 3:30:12 PM (3 days ago) May 8
to weewx...@googlegroups.com
Set up a new venv install with WeeWx 5.3.1
Ubuntu
NUC5.x
Installed with PIP

Log at startup:
weewxd: Initializing weewxd version 5.3.1
May 8 15:13:35 nuc62 weewxd[51956]: INFO weewxd: Command line: /home/house/weewx-venv/bin/weewxd
May 8 15:13:35 nuc62 weewxd[51956]: INFO weewxd: Using Python: 3.10.12 (main, Mar 3 2026, 11:56:32) [GCC 11.4.0]
May 8 15:13:35 nuc62 weewxd[51956]: INFO weewxd: Located at: /home/house/weewx-venv/bin/python3
May 8 15:13:35 nuc62 weewxd[51956]: INFO weewxd: Platform: Linux-6.8.0-111-generic-x86_64-with-glibc2.35
May 8 15:13:35 nuc62 weewxd[51956]: INFO weewxd: Locale: 'en_US.UTF-8'
May 8 15:13:35 nuc62 weewxd[51956]: INFO weewxd: Entry path: /home/house/weewx-venv/bin/weewxd
May 8 15:13:35 nuc62 weewxd[51956]: INFO weewxd: WEEWX_ROOT: /home/house/weewx-data
May 8 15:13:35 nuc62 weewxd[51956]: INFO weewxd: Config file: /home/house/weewx-data/weewx.conf
May 8 15:13:35 nuc62 weewxd[51956]: INFO weewxd: User module: /home/house/weewx-data/bin/user
May 8 15:13:35 nuc62 weewxd[51956]: INFO weewxd: Debug: 1
May 8 15:13:35 nuc62 weewxd[51956]: INFO weewxd: User: house
May 8 15:13:35 nuc62 weewxd[51956]: INFO weewxd: Group: house
May 8 15:13:35 nuc62 weewxd[51956]: INFO weewxd: Groups: adm cdrom sudo dip plugdev lpadmin lxd sambashare house

It did not create a weewx user, and Apache2 is installed as root:root as it required sudo to install.

Added 'house' to the www-data group, no joy.

All runs well except I cannot figure out how to allow access to /var/www/html. I know this is a classic issue but google has not directed me so far.

Pointers would be appreciated.

Vince Skahan

unread,
May 8, 2026, 3:39:29 PM (3 days ago) May 8
to weewx-user

Vince Skahan

unread,
May 10, 2026, 2:46:45 PM (yesterday) May 10
to weewx-user
Dan - did you get anywhere on this ? 
 
A pip installation does not create any users, it runs as the user you installed weewx under, in your case I'm guessing it is user 'house'

Your weewx user needs to have the permission to write the public_html files, and the apache user needs to have permission to read those files.  It takes a little one-time setup to make this happen.

The wiki page is getting very dated and to me is a bit too complicated so I thought I'd mention how I do it here.   I run nginx but the same method will work for any webserver. I use the Strategy 3 from the wiki, just in the opposite direction.

So to do it that way:
  • sudo mkdir /var/www/html/weewx
  • sudo chown house:house /var/www/html/weewx
  • ln -s /var/www/html/weewx /home/house/weewx-data/public_html
You'll likely need to rename the /home/house/weewx-data/public_html directory before creating the symlink.  If you want to save any pre-existing files there copy them to the newly created /var/www/html/weewx tree and make sure you set the ownership to house:house so weewx can write there.  It should be pretty quick to do.

weather list

unread,
May 10, 2026, 8:46:53 PM (18 hours ago) May 10
to weewx...@googlegroups.com
Vince, I did, and indeed I thought that page was pretty dated, as it made no mention of venv or pip installs.

I used Strategy 3, but of course that doesn't work unless you create /var/www/html/weewx (as you describe), and then chown weewx to the group and user under which weewx runs. That cured the issue for me. No need to create any symlink, as changing the html directory to HTML_ROOT = /var/www/html/weewx in the various reports was all it took. A little more work if one has more than one or two reports but I generally try to avoid symlinks as it's too easy to forget I did it!

Thanks for following up; it was simpler than I thought and I clearly had not thought it through carefully before posting (my bad).

-- 
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 visit https://groups.google.com/d/msgid/weewx-user/56f79d68-8cd8-4b5c-88d8-2c651b28f1dan%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages