Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.5 (build 3282) - 23 February 2024

Cumulus MX V4 beta test release 4.0.0 (build 4017) - 17 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

running old standard website and the new MX website together

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

apple8
Posts: 129
Joined: Sun 21 Aug 2011 2:26 am
Weather Station: Davis Vantage Vue
Operating System: Windows 10
Location: Sydney. Australia
Contact:

Re: running old standard website and the new MX website together

Post by apple8 »

Something must be working. When I leave the "s" off realtimegauges.txt I get 404 error messages every 5 seconds.

Code: Select all

2022-08-04 11:44:04.132391 [INFO] [597544] [T0] [2001:8003:3606:5f00:91bb:b16b:181a:34d3:63002-H3:B89C98B9B8EF6A85-740#APVH_blazingcomet.com:443] File not found [/home/blazingc/public_html/404.shtml] 
2022-08-04 11:44:04.132371 [INFO] [597544] [T0] [2001:8003:3606:5f00:91bb:b16b:181a:34d3:63002-H3:B89C98B9B8EF6A85-740#APVH_blazingcomet.com:443] File not found [/home/blazingc/public_html/weatherMX/realtimegauge.txt] 
Putting the correct filename in gives no errors but the file does not update.

Edit: also noticed that if I leave the .htaccess file active and the realtimegauges.txt file updating from extra web files, the gauges page will not update until .htaccess has a name change.
freddie
Posts: 2422
Joined: Wed 08 Jun 2011 11:19 am
Weather Station: Davis Vantage Pro 2 + Ecowitt
Operating System: GNU/Linux Ubuntu 22.04 LXC
Location: Alcaston, Shropshire, UK
Contact:

Re: running old standard website and the new MX website together

Post by freddie »

Looks like your .htaccess is working okay. If I access https://blazingcomet.com/weatherMX/realtimegauges.txt I see data. I kept refreshing until the data changed, and it appears to be changing regularly - certainly at 30 second intervals. What is your realtime interval set to?
Freddie
Image
apple8
Posts: 129
Joined: Sun 21 Aug 2011 2:26 am
Weather Station: Davis Vantage Vue
Operating System: Windows 10
Location: Sydney. Australia
Contact:

Re: running old standard website and the new MX website together

Post by apple8 »

Yes, realtime interval is set to 30 seconds. Is the file supposed to be rewritten in the directory directory C1 or just accessed. If I delete the realtimegauges.txt it doesn't reappear until I turn off htaccess and turn on with Extra Web Files.
freddie
Posts: 2422
Joined: Wed 08 Jun 2011 11:19 am
Weather Station: Davis Vantage Pro 2 + Ecowitt
Operating System: GNU/Linux Ubuntu 22.04 LXC
Location: Alcaston, Shropshire, UK
Contact:

Re: running old standard website and the new MX website together

Post by freddie »

The file isn't rewritten - the HTTP request that accesses the file is rewritten.
So if you have a request come in for https://blazingcomet.com/weatherMX/C1/r ... gauges.txt then the request is rewritten on the fly to https://blazingcomet.com/weatherMX/realtimegauges.txt. Or it might be the other way around, I can't remember which way round you have it set up.

You should have MX writing realtimegauges.txt to a single location. You will then need the .htaccess file in the second location to contain a rule that says "any request for realtimegauges.txt in this location should be rewritten to request the realtimegauges.txt file in the other location (where the file actually is)". As far as I can tell, this is what you have set up and it appears to be working for me (as at 11:25 UTC). The only thing I really noticed is that your web server is occasionally taking a long time to answer the request (from both locations, so nothing to do with .htaccess) so perhaps you won't see every change every 30 seconds reflected in your gauges page.
Freddie
Image
apple8
Posts: 129
Joined: Sun 21 Aug 2011 2:26 am
Weather Station: Davis Vantage Vue
Operating System: Windows 10
Location: Sydney. Australia
Contact:

Re: running old standard website and the new MX website together

Post by apple8 »

Thanks freddie, I feel sure I have right as you describe but no joy so I am missing something somewhere.

I not experiencing any delay here but the server is local to me and a request from the UK could be an explanation for an occasional delay.
apple8
Posts: 129
Joined: Sun 21 Aug 2011 2:26 am
Weather Station: Davis Vantage Vue
Operating System: Windows 10
Location: Sydney. Australia
Contact:

Re: running old standard website and the new MX website together

Post by apple8 »

Well, maybe a little progress. I found that on the iPhone I have two pages open for gauges, one working and one not. On closer inspection one includes www. after https://

This was apparently ok when the realtimegauges.txt was uploaded but not with a .htaccess in play.

Can I have both with a .htaccess file or is there a preference for one or the other. Changing pages in the menu doesn’t change that part of the address. I’ll have to look at that later on today, it’s 1:00am and working from bed on a phone is limiting. :)
freddie
Posts: 2422
Joined: Wed 08 Jun 2011 11:19 am
Weather Station: Davis Vantage Pro 2 + Ecowitt
Operating System: GNU/Linux Ubuntu 22.04 LXC
Location: Alcaston, Shropshire, UK
Contact:

Re: running old standard website and the new MX website together

Post by freddie »

apple8 wrote: Thu 04 Aug 2022 3:11 pm Well, maybe a little progress. I found that on the iPhone I have two pages open for gauges, one working and one not. On closer inspection one includes www. after https://

This was apparently ok when the realtimegauges.txt was uploaded but not with a .htaccess in play.
If you use paths instead of URLs in your RewriteRule then you should be able to get around this.

For example, change:

Code: Select all

RewriteRule ^realtimegauges.txt$ https://blazingcomet.com/weatherMX/realtimegauges.txt [NC,L]
To this:

Code: Select all

RewriteRule ^realtimegauges.txt$ /weatherMX/realtimegauges.txt [NC,L]
But substitute whatever you've got in the right hand side of your actual rule, rather than just copy/pasting the above.
Freddie
Image
Phil23
Posts: 884
Joined: Sat 16 Jul 2016 11:59 pm
Weather Station: Davis VP2+ & GW1000 (Standalone)
Operating System: Win10 Pro / rPi Buster
Location: Australia

Re: running old standard website and the new MX website together

Post by Phil23 »

Not sure what happened to my main one, but all PHP stopped a week or so back.

Turned out to be these extra lines that the Hosting Provider had added to the end or the file

Code: Select all

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “alt-php71” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-alt-php71___lsphp .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
Removed them & it was all Ok.

If you need to save a bit of typing, here's what I have in my .._../new directory.
Not sure if I posted it in completion earlier or not.

Code: Select all

# This prevents web browsers or spiders from seeing your .htaccess directives:
<Files .htaccess>
	deny from all
</Files>

RewriteEngine On

RewriteRule ^realtimegauges.txt$ http://weather.inverellit.com/realtimegauges.txt [NC,L]

RewriteRule ^airquality.json$ http://weather.inverellit.com/airquality.json [NC,L]
RewriteRule ^alldailydegdaydata.json$ http://weather.inverellit.com/alldailydegdaydata.json [NC,L]
RewriteRule ^alldailyhumdata.json$ http://weather.inverellit.com/alldailyhumdata.json [NC,L]
RewriteRule ^alldailypressdata.json$ http://weather.inverellit.com/alldailypressdata.json [NC,L]
RewriteRule ^alldailyraindata.json$ http://weather.inverellit.com/alldailyraindata.json [NC,L]
RewriteRule ^alldailysolardata.json$ http://weather.inverellit.com/alldailysolardata.json [NC,L]
RewriteRule ^alldailytempdata.json$ http://weather.inverellit.com/alldailytempdata.json [NC,L]
RewriteRule ^alldailywinddata.json$ http://weather.inverellit.com/alldailywinddata.json [NC,L]
RewriteRule ^alltempsumdata.json$ http://weather.inverellit.com/alltempsumdata.json [NC,L]
RewriteRule ^availabledata.json$ http://weather.inverellit.com/availabledata.json [NC,L]
RewriteRule ^dailyrain.json$ http://weather.inverellit.com/dailyrain.json [NC,L]
RewriteRule ^dailytemp.json$ http://weather.inverellit.com/dailytemp.json [NC,L]
RewriteRule ^graphconfig.json$ http://weather.inverellit.com/graphconfig.json [NC,L]
RewriteRule ^humdata.json$ http://weather.inverellit.com/humdata.json [NC,L]
RewriteRule ^pressdata.json$ http://weather.inverellit.com/pressdata.json [NC,L]
RewriteRule ^raindata.json$ http://weather.inverellit.com/raindata.json [NC,L]
RewriteRule ^solardata.json$ http://weather.inverellit.com/solardata.json [NC,L]
RewriteRule ^sunhours.json$ http://weather.inverellit.com/sunhours.json [NC,L]
RewriteRule ^tempdata.json$ http://weather.inverellit.com/tempdata.json [NC,L]
RewriteRule ^wdirdata.json$ http://weather.inverellit.com/wdirdata.json [NC,L]
RewriteRule ^websitedata.json$ http://weather.inverellit.com/websitedata.json [NC,L]
RewriteRule ^winddata.json$ http://weather.inverellit.com/winddata.json [NC,L]

:Now: :Today/Yesterday:

Image

Main Station Davis VP2+ Running Via Win10 Pro.
Secondary Stations, Ecowitt HP2551/GW1000 Via rPi 3 & 4 Running Buster GUI.
:Local Inverell Ecowitt Station: :Remote Ashford Ecowitt Station:
apple8
Posts: 129
Joined: Sun 21 Aug 2011 2:26 am
Weather Station: Davis Vantage Vue
Operating System: Windows 10
Location: Sydney. Australia
Contact:

Re: running old standard website and the new MX website together

Post by apple8 »

Ok looks like this is all sorted now, thank you all for your assistance. :clap:
freddie
Posts: 2422
Joined: Wed 08 Jun 2011 11:19 am
Weather Station: Davis Vantage Pro 2 + Ecowitt
Operating System: GNU/Linux Ubuntu 22.04 LXC
Location: Alcaston, Shropshire, UK
Contact:

Re: running old standard website and the new MX website together

Post by freddie »

apple8 wrote: Fri 05 Aug 2022 1:53 am Ok looks like this is all sorted now, thank you all for your assistance. :clap:
Would you like to share what changes you made to get it to work? Then others facing similar problems will be able to find the solution.
Freddie
Image
apple8
Posts: 129
Joined: Sun 21 Aug 2011 2:26 am
Weather Station: Davis Vantage Vue
Operating System: Windows 10
Location: Sydney. Australia
Contact:

Re: running old standard website and the new MX website together

Post by apple8 »

freddie wrote: Fri 05 Aug 2022 10:28 am Would you like to share what changes you made to get it to work? Then others facing similar problems will be able to find the solution.
Well, I had done a review in my mind and admit to a few basic errors. Mostly the answers are in previous posts but putting it into “mind pictures” for myself this is how I see it. Please correct me if it is misleading.

Firstly I had to understand where the file comes from and goes to. In reality it doesn’t go anywhere, the request is to fetch the data from its current location. It is not rewritten in the subdirectory as a file which is what I had been expecting. So when I didn’t see the file I thought it wasn’t working. Secondly when I refreshed the page, because there was “www” in the address (not readily apparent in the address bar until selected) it didn’t work. The suggestion to check the error file on the server gave a hint to what was and wasn’t working. In fact sometimes it did actually work but I wasn’t smart enough to look in the right spot for the results.

I try to visualise how it all works so this is my take on what goes on.

With the .htaccess file in the same (sub)directory as the html files, the first part of the line below tells the request “if your looking for this file then go to the second part of the line because that is the address where that file resides”.

Code: Select all

RewriteRule ^realtimegauges.txt$ https://blazingcomet.com/weatherMX/realtimegauges.txt [NC,L]
Because of the “www” problem freddie suggested I use the line below which basically says “if your looking for this file it’s upstairs in the parent directory.

Code: Select all

 RewriteRule ^realtimegauges.txt$ /weatherMX/realtimegauges.txt [NC,L]
I initially just worked with the realtimegauges.txt until I got it right than added Paul’s complete list of files.
freddie
Posts: 2422
Joined: Wed 08 Jun 2011 11:19 am
Weather Station: Davis Vantage Pro 2 + Ecowitt
Operating System: GNU/Linux Ubuntu 22.04 LXC
Location: Alcaston, Shropshire, UK
Contact:

Re: running old standard website and the new MX website together

Post by freddie »

That's pretty much what I thought you had done, but it's nice to see it spelled out for other users to understand. Thank you for the summary.
Freddie
Image
Post Reply