Weather34 on ramdisk

135 views
Skip to first unread message

Bill Arthur

unread,
Mar 9, 2020, 7:41:50 PM3/9/20
to weewx-user
I'm putting together a remote weather station using WeeWx and ARPS radio. It's a bit of a drive so reliability is very important to me. For that reason I've installed the ramdisk according to the WeeWx manual. But I'm having problems because I also want to use Weather34 on my home station.

I installed WeeWx, PHP, Apache and Weather34. Everything is working, the default WeeWx html page and the Weather34 html & PHP page.

Then I installed the ramdisk. I confirmed the path was correct in the weewx and apache configs. The WeeWx default page works great.
The weather34 files are in the correct location /var/weewx/reports/weather34. I can bring up stationinfo.php and easyW34SkinSetup.php OK.
But /var/weewx/reports/weather34/index.php has write permission problems. I get:

Unable to write to the website's folder. Make sure the root of the website is writable by your webserver.
If you're using Apache on linux, Apache should be running as user 'www-data' and group 'www-data'. If so, run these commands or adjust them for Apache's user:group
find . -type d -exec sudo chown www-data:www-data {} \; -exec sudo chmod 2775 {} \;
and
find . -type f -exec sudo chown www-data:www-data {} \; -exec sudo chmod 664 {} \;
from within the root of your website's folder, probably located in '/var/www/example.com/html/pws.'
or, do yourself a huge favor and navigate into your 'html' folder and use these 3 commands to automatically set the permissions on all files and folders created inside it:
chmod g+s .
setfacl -d -m g::rwx .
setfacl -d -m o::rx .

After trying the first two commands (2775&664) I then got  a sad face and error 500
So I rebooted and tried the last three. Done inside the reports folder I got the "Unable to write" screen again.
I did the three commands in the weather34 directory and had the same results

So I guess I need help getting write premissions correct so that weather34's index.php is happy.
then I'm going to need a chron event to apply that to files after they are created, 10 minutes after bootup.

Thanks,
Bill

Message has been deleted

Bill Arthur

unread,
Mar 9, 2020, 9:25:01 PM3/9/20
to weewx-user
JD

I thought that the commands that I did would have done that.
Do you have any suggestions?
Thanks!


On Monday, March 9, 2020 at 7:12:07 PM UTC-5, J D wrote:
Make sure  the Weather34 directory has the correct permissions and ownership also.

Bill Arthur

unread,
Mar 10, 2020, 1:21:47 PM3/10/20
to weewx-user
I know just enough to be dangerous, so my techniques can be crude. But here goes....

I chown'd all the files in the weather34 directory to www-data. Did the directory itself, also. Then chmod'd them to 644.. Then tried 755 
All attempts ended in error 500

I'm going to read some more and find some other things to try.

Help!
Message has been deleted

steeple ian

unread,
Mar 10, 2020, 7:12:13 PM3/10/20
to weewx-user
Bill,
What is your server’s document root?
Message has been deleted

Bill Arthur

unread,
Mar 10, 2020, 7:36:30 PM3/10/20
to weewx-user
steeple ian,

From /etc/apache2/apache2.conf it appears not to be set.  But it also appears to be using /etc/apache2 for the conf files and /var/log/apache2 for the log files.
Is there somewhere else to look for the answer to your question?

Bill

# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE!  If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the Mutex documentation (available
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
#
#ServerRoot "/etc/apache2"

#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
#Mutex file:${APACHE_LOCK_DIR} default

steeple ian

unread,
Mar 10, 2020, 7:39:47 PM3/10/20
to weewx...@googlegroups.com
Try /etc/apache2/sites-available/000-default.conf

--
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/a2a5a440-8bc1-4f52-b02e-31d06d7edd6f%40googlegroups.com.

Bill Arthur

unread,
Mar 10, 2020, 7:48:39 PM3/10/20
to weewx-user
steeple ian

RE-reading, you asked for the document root.

I've gone into /etc/apache2/sites-enabled/000-default.conf and changed the document root to /var/weewx/reports.
I'm rebooting and I'll soon see the results

Bill

Bill Arthur

unread,
Mar 10, 2020, 7:56:24 PM3/10/20
to weewx-user
JD,

That was the path before I installed the ramdisk. Here is the procedure I followed.

https://github.com/weewx/weewx/wiki/Minimize-writes-on-SD-cards

Bill

On Tuesday, March 10, 2020 at 6:34:43 PM UTC-5, J D wrote:
The full path is 
/var/www/html/weewx/Weather34


On Monday, March 9, 2020 at 4:41:50 PM UTC-7, Bill Arthur wrote:

Bill Arthur

unread,
Mar 10, 2020, 8:02:50 PM3/10/20
to weewx-user
steeple ian,

Previously I could still reach the default weewx html page, now I get:
localhost refused to connect.
Try:
Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_REFUSED

I'm going to set the document root back

Bill
Try /etc/apache2/sites-available/000-default.conf

To unsubscribe from this group and stop receiving emails from it, send an email to weewx...@googlegroups.com.

Bill Arthur

unread,
Mar 10, 2020, 8:41:22 PM3/10/20
to weewx-user
JD

I did a chown and tested:  error 500
I did a chgrp and tested: error 500

Bill

On Tuesday, March 10, 2020 at 5:11:30 PM UTC-5, J D wrote:
Hi,
Here is what I have done on my setup. sudo chown www-data for all files in Weather34 including Weather34 directory. Then sudo chgrp www-data for the same set of files and directories. In my case my Weather34 directory exists in the weewx.


On Monday, March 9, 2020 at 4:41:50 PM UTC-7, Bill Arthur wrote:

Bill Arthur

unread,
Mar 10, 2020, 8:59:41 PM3/10/20
to weewx-user
I don't know if this is relevant, but my Apache error log is spitting this out every second:

Tue Mar 10 19:38:25.186962 2020] [core:warn] [pid 465] (99)Cannot assign requested address: AH00056: connect to listener on [::]:80
Message has been deleted

Bill Arthur

unread,
Mar 13, 2020, 11:58:49 AM3/13/20
to weewx-user
As I seemed to be spinning my wheels, I started over with a fresh install. This time it works OK.
However I was surprised that this installation now has the Weather34 (php) files combined with the weewx (html) files in the /var/weewx/reports directory.
All log and webpage files are now going to the ramdisk, this is a configuration that I can work with. I'm going to archive and back up this configuration.
Reply all
Reply to author
Forward
0 new messages