I now have my site back up and running on my new server, but I had a couple of questions:
- WU, Darksky and Metar are not updating. I have verified that the API keys are correct for all 3 and there is up to date data on all 3 sites. Is there a file that requires special permissions, or is there a way to manually execute the command to pull the data so I can try to determine where the issue is?
- Now that I have the site up and running on the new server, I would like to learn how to use GIT to keep the files up to date. Can anyone point me to any information/tutorial on setting up GIT so I can just run the command from the server to make the updates?
Again, thanks to everyone here for all of the help getting my site up and running!
Your problem is file and folder permissions. Run these 2 commands from your PWS folder. With DigitalOcean, you shouldn't have any issue with using setfacl, but other people using other hosts might get an error about setfacl not being a valid command, just remove the -exec sudo setfacl bits. These commands make it so any new folders have the exact same permissions as it parent folder:
find . -type f -exec sudo chown www-data:www-data {} \; -exec sudo chmod 664 {} \; -exec sudo setfacl -d -m g::rwx {} \; -exec sudo setfacl -d -m o::rw {} \;
find . -type f -exec sudo chown www-data:www-data {} \; -exec sudo chmod 664 {} \;
I would definitely not set your stationcron.php to run every 5 minutes unless you want too hit the free API calls limit on one of the services (one of them has a lowish limit, don't remember which). 15 minutes is a good amount so the forecasts are still fresh but nicely before free limits.
Installing with gitIf you'd like to use git, install git with
sudo apt install git
Then navigate to the root of the webserver, usually /var/www/html/server url
If the template is already in a folder called pws, move it with (change oldfolder to the folder name)
mv oldfolder oldfolder.bak
Now issue this command to download the files from the git server
git clone https://github.com/lightmaster/Meteobridge-Weather34-Template.git pws
Now copy over the data files (change oldfolder.bak to whatever the old folder is, if you used pws in the previous command, use it here too)
cp -rv oldfolder.bak/mbcharts/*.csv oldfolder.bak/mbcharts/20* pws/mbcharts/
cp -rv oldfolder.bak/settings1.php pws/
cp -rv oldfolder.bak/jsondata/*.txt pws/jsondata/
If you changed the folder that the template is installed in, make sure you update the HomeWeatherStation entry in the Networks tab of the MB, and the stationcron.php, empty.php, and addtoyear.php HTTP Requests in the Services tab. While you're at it, make sure stationcron.php is set to "Every
full 15 minutes".