Problem for public_html access with Weewx 5 and apache 2

402 views
Skip to first unread message

Remy Lavabre

unread,
Apr 26, 2024, 9:26:33 AM4/26/24
to weewx-user
Hello,

Good morning,
I didn't find the answer to my problem in the various discussions on the WeeWX forum...

I installed Weewx 5 in a virtual environment.
So I have my weewx-data and weewx-venv directories in /home/---/

weewxd seems to "finally" work normally with the ~/weewx-data/public_html directory refreshing.

On version 4, the weewx public_html directory was /var/www/html/weewx ROOT:ROOT and did not pose a problem with the Apache 2 server.
Since the location of the web server changed in version 5, I put a symbolic link "weewx" in /var/www/html/ pointing to ~/weewx-data/public_html/weewx [sudo ln -s/ ~/ weewx-data/public_htmlweewx /var/www/html/weewx].

The rights of var/www/html remained ROOT:ROOT while the rights of ~/weewx-data/public_html/weewx are those of the creator.

Filezilla navigation works correctly. Clicking on the symbolic link takes you to the new WeeWX 5 public_html directory.

However, when trying to connect through a web browser (http://xxx.xxx.xxx.xxx/weewx/index.html), I get the response:
:

Forbidden
You don't have permission to access this resource.

Apache/2.4.59 (Debian) Server at xxx.xxx.xxx.xxx Port 80


I think it must just be a rights issue...?

What is the recommended solution in Weewx 5 with Apache 2 to redirect Apache from /var/www/html to ~/weewx-data/public_html?

Thanks a lot for the help! ;-)

p q

unread,
Apr 26, 2024, 9:46:48 AM4/26/24
to weewx...@googlegroups.com
Looks like a rights issue with Apache. Find the apache.conf file and you probably need to enable access to the right directories.

--
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/1deda7f3-fa1e-4ab8-8ef7-a7b561fa9ffen%40googlegroups.com.


--
Peter Quinn
(415)794-2264

Remy Lavabre

unread,
Apr 26, 2024, 10:53:03 AM4/26/24
to weewx-user
1/ if I try xxx.xxx.xxx.xxx/index.html -> Work fine, I've got the Apache2 Debian Default Page (which is in /var/www/html/index.html).
2/ if i try xxx.xxx.xxx.xxx/weewx/index.html -> Forbidden - You don't have permission to access this resource. (with my symbolic link)

I've tried :
A/ sudo chown www-data ~/weewx-data/public_html -Rf
B/ sudo chmod 775 -R ~/weewx-data/public_html
--> Same thing

C/ sudo nano /etc/apache2/sites-available/000-default.conf and change "DocumentRoot /var/www/html" to "DocumentRoot ~/weewx-data/public_html"
 xxx.xxx.xxx.xxx/index.html and xxx.xxx.xxx.xxx/weewx/index.html does not work...

Any idear ??

vince

unread,
Apr 26, 2024, 12:44:29 PM4/26/24
to weewx-user
I do it in the opposite direction.   The /var/www/html/weewx path is a directory.  The /home/<user>/weewx-data/public_html path is a symlink 'to' the webserver directory.

For a pip installation:
sudo mkdir /var/www/html/weewx
sudo chown ${WEEWXUSER}:${WEEWXUSER} /var/www/html/weewx
ln -s /var/www/html/weewx /home/${WEEWXUSER}/weewx-data/public_html

Remy Lavabre

unread,
Apr 27, 2024, 5:55:01 AM4/27/24
to weewx-user
Yes thank you it works Vince!
I've been racking my brains over these Apache directories for a while and I admit I haven't thought about reversing my symbolic links, idiot that I am...! :-(

Perhaps an even simpler solution would have been to put the version 4 path back in weewx.conf...?

However, I would have liked to understand why I was unable to reach my ~/weewx-venv/public_html directory with my initial symbolic links... The rights seemed to have been assigned correctly to the directories.

But in any case it works with your method! So I'm keeping it :-)))
Thank you Vince and have a good weekend

cric...@pobox.com

unread,
Apr 27, 2024, 9:25:59 AM4/27/24
to weewx-user

In /etc/apache2/apache2.conf

 <Directory />

        Options FollowSymLinks

 <Directory /var/www/>

        Options Indexes FollowSymLinks

 Might not be the exact one(s), but FollowSymLinks is the thing to set.

 Chris

Reply all
Reply to author
Forward
0 new messages