Author Topic: Meteotemplate - new free website template  (Read 638257 times)

0 Members and 4 Guests are viewing this topic.

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Meteotemplate - new free website template
« Reply #675 on: November 08, 2015, 07:40:05 PM »
I tried everything... no luck... it simply rejects your server immediately... I tried several examples and solutions from stackoverflow, but even that did not help.

There is one last option. I will try to create an alternative script for you so that you can use this and see if that is working. But that is likely to take some time as I will have to change the code.

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5533
    • KomokaWeather
Re: Meteotemplate - new free website template
« Reply #676 on: November 08, 2015, 08:08:56 PM »
Thanks Jachym,
I wish there was something I could...  Do you know if I am the only globalSnow user who is with GoDaddy?

Paul

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Meteotemplate - new free website template
« Reply #677 on: November 09, 2015, 08:10:15 AM »
Hi Paul,

your site is now working

BUT!!!!

Make sure you do not update the plugin if I release an update in the future. If in the future I release an update of this plugin, first contact me and I will have to create a different version for you. This is because you are not using the original script and have a modified one for Canada.

Just FYI, this is what I did:
Since for some reason, your server is refused access to the site from which we need to get the images, I made a little workaround, which is - you are actually not getting the images from the original source, but rather loading them from the meteotemplate.com demo. In other words, the script works fine for the demo and so that demo loads the images and I also made some changes on my server so that the demo saves the images for your server to download. I know this may sound complicated, but the important thing is, given you do not change the script (if I update it in the future, first contact me and I will again make the necessary changes - it is however only related to the canada.php page, the rest of the plugin is fine to update) and given I do not make any changes on my server or change the URL of the demo (which if I will do, I will again make changes in your script to make it work), it should be working, though it is a bit slow.

http://www.komokaweather.com/j-template/plugins/globalSnow/canada.php

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5533
    • KomokaWeather
Re: Meteotemplate - new free website template
« Reply #678 on: November 09, 2015, 11:30:47 AM »
Thanks again Jachym, you continue to amaze me.  Should I be calling GoDaddy on this?  If I undersrand it is this
Quote
// Western Arctic
 $url = file_get_contents("http://ice-glaces.ec.gc.ca/cgi-bin/getprod.pl?prodid=IPYMMR1WA&wrap=1&lang=en");
 $output = str_replace(array("\r\n", "\r"), "\n", $url);
 $lines = explode("\n", $output);
 $new_lines = array();
 foreach ($lines as $i => $line) {
  if(!empty($line))
   $new_lines[] = trim($line);
 }
 $url = implode($new_lines);
 
 preg_match('/<div class="col-xs-12"><img src="(.*?).gif/',$url,$matches);
 $westernArctic = "..gif; ']http://ice-glaces.ec.gc.ca".$matches[1].".gif"; 
that is not working through GoDaddy?
 
Paul

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Meteotemplate - new free website template
« Reply #679 on: November 09, 2015, 12:06:48 PM »
well you can try, basically when you try to access that site using the file_get_contents or using CURL, it gives no response, despite the fact on other servers it works ok. The server setting on your side is also ok, because now when you are downloading it from meteotemplate.com, it works and it works on other pages of the template too. It is a problem with just this particular domain.

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5533
    • KomokaWeather
Re: Meteotemplate - new free website template
« Reply #680 on: November 09, 2015, 07:49:36 PM »
Hi Jachym,
I had a long conversation with GoDaddy and initially they said that everything was ok from their end.  I asked to be referred to expert support and they also said that everything looked ok from their end but he was really good to explain things to me.  He suggested that error log be turned on and this showed
Quote
[Mon Nov 09 15:46:57 2015] [5379896] [fcgid:warn] [client 99.249.226.93:56246] mod_fcgid: read data timeout in 120 seconds, referer http://www.komokaweather.com/j-template/plugins/globalSnow/index.php
[Mon Nov 09 15:46:57 2015] [5379896] [core:error] [client 99.249.226.93:56246] End of script output before headers: canada.php, referer http://www.komokaweather.com/j-template/plugins/globalSnow/index.php
[Mon Nov 09 15:58:11 2015] [5379896] [fcgid:warn] [client 99.249.226.93:56809] mod_fcgid: read data timeout in 120 seconds
[Mon Nov 09 15:58:11 2015] [5379896] [core:error] [client 99.249.226.93:56809] End of script output before headers: canada.php
[Mon Nov 09 16:02:18 2015] [5379896] [fcgid:warn] [client 99.249.226.93:56991] mod_fcgid: read data timeout in 120 seconds
[Mon Nov 09 16:02:18 2015] [5379896] [core:error] [client 99.249.226.93:56991] End of script output before headers: canada.php
With the error log showing timeout in 120 sec he suggested to change the php5.ini to increase the timeout to 300.
It has now been more than an hour and this 300 sec timeout has not yet changed.
 
I have checked the other Meteotemplate users listed on Jachym's Blog and those that have the globalSnow all seem to worm ok.  Anyone of these using GoDaddy for their hosting?
 
He also said that I might consider to upgrade to their new next generation c-panel hosting but couldn't confirm if that would correct the problem.
Anyone have any thoughts of moving to the new c-panel hosting?  It seems like quite a bit of work to download all remote files, redo all the hosting settings, including MySQL, then re-upload, etc.
 
Paul

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Meteotemplate - new free website template
« Reply #681 on: November 09, 2015, 08:21:55 PM »
I will answer to you in more detail tomorrow, I gotta go now, but do not make any changes for now.

Online wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1991
    • My PWS at Leuven Belgium Europe
Re: Meteotemplate - new free website template
« Reply #682 on: November 10, 2015, 08:59:42 AM »
@PaulMy
To eliminate blocks from your webserver to an external site, I use a small PHP script.

It will use CURL at your webserver to load some data AND at the same moment execute the url in an iframe in your browser.

If the site is down neither the iframe nor the retrieved info should be there.

If the info shows in the iframe but not as data on the server, the error codes displayed may give a clue.

You can set the timeout value at line 20 in the script.

At my home and webserver de data was returned from EC within 10 seconds.

Wim
« Last Edit: November 10, 2015, 09:06:09 AM by wvdkuil »

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Meteotemplate - new free website template
« Reply #683 on: November 10, 2015, 09:13:25 AM »
Thanks Wim,

what surprised me is that I tried the CURL instead of file_get_contents and I have also specified the browser to mimick a normal user - still nothing. And on all other sites it load absolutely normally.
For now, the only solution I was able to come up with was that I cache the images on my server and Paul loads them from there - and his server setting is also fine, all other page work with either Curl or file_get_contents

Online wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1991
    • My PWS at Leuven Belgium Europe
Re: Meteotemplate - new free website template
« Reply #684 on: November 10, 2015, 09:31:43 AM »
Thanks Wim,

what surprised me is that I tried the CURL instead of file_get_contents and I have also specified the browser to mimick a normal user - still nothing. And on all other sites it load absolutely normally.
For now, the only solution I was able to come up with was that I cache the images on my server and Paul loads them from there - and his server setting is also fine, all other page work with either Curl or file_get_contents
I myself got a VPS webserver last year, including my own IP-address.  All scripts worked as usual, but  after a few days I found that the USNO script, which runs 1 /day to get moon-information, failed. Took some time to find USNO has black-listed some IP-ranges. And  they will not remove the IP form the black-list.  My hosting company was not willing to give a new ip-address without charge either. Same as you did for PaulMy,  I now use another website to retrieve the information for me.

And this has happened multiple times with users from my template, so it becomes a "standard solution" in these cases.  I always use the test-url script, adapting the url to the situation at hand,  to see what can be done.  Altervista as an example has by default blocked most external URL's. But with this script, the user sees the error message (in Italian) and the message what to do.
Quote
Host di destinazione non consentito, sblocca la connessione nel pannello di AlterVista (Risorse > Impostazioni PHP)
Other ones such as hosting2go have a whitelist and need extra code before the URL's which are not on the whitelist.

So with your growing user-base you can use this script in the future also,

Wim

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5533
    • KomokaWeather
Re: Meteotemplate - new free website template
« Reply #685 on: November 10, 2015, 09:57:11 AM »
Hi Wim and Jachym,
I have downloaded the test script http://www.komokaweather.com/j-template/plugins/globalSnow/test_url_ca.php and it gives a timeout error.  I have tried it at 60 sec and 20, and also in 3 different browsers all with the same "Time out" error.
 
I believe you are both aware I can visit http://ice-glaces.ec.gc.ca/cgi-bin/getprod.pl?prodid=IPYMMR1WA&wrap=1&lang=en and the other URL links included in the canada.php script in normal browsing but I believe the script is trying to retrieve the image only and that is failing, is that correct?
 
Paul
 
 

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Meteotemplate - new free website template
« Reply #686 on: November 10, 2015, 10:04:44 AM »
What seems to me absolutely absurd is that we are talking about the Canadian plugin - and everyone is able to access Environment Canada except for Paul - i.e. someone with a Canadian IP....

I know that sometimes, for example some US websites block European and Asian IPs, but why would Canada block Canada.... which is also why I made this customized script and configured my server to make it work, because I can imagine this is what interests Paul the most.


Online wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1991
    • My PWS at Leuven Belgium Europe
Re: Meteotemplate - new free website template
« Reply #687 on: November 10, 2015, 10:12:12 AM »
Hi Wim and Jachym,
I have downloaded the test script http://www.komokaweather.com/j-template/plugins/globalSnow/test_url_ca.php and it gives a timeout error.  I have tried it at 60 sec and 20, and also in 3 different browsers all with the same "Time out" error.
 
I believe you are both aware I can visit http://ice-glaces.ec.gc.ca/cgi-bin/getprod.pl?prodid=IPYMMR1WA&wrap=1&lang=en and the other URL links included in the canada.php script in normal browsing but I believe the script is trying to retrieve the image only and that is failing, is that correct?
 
Paul
The  test-script ONLY tries to access the page. It doens not do anything with the output.   So your website is restricted by either your webhost OR Environement Canada to access that page.

1. Could you copy the script to the root of your site to check htaccess restrictions?  => www.komokaweather.com/test_url_ca.php
2. Do you have other websites at the same hosting comapany. If so, copy it to the root of the other sites also. => othersite.ca/test_url_ca.php

A time-out occurs normally when the URL you are calling has your IP adress black-listed.

So you could contact EC with the url of the test-program and asked them "Why is  my webserver not allowed to access your site?"
They can check the script themselves when you put it in the root, with  www.komokaweather.com/test_url_ca.php?sce=view

But before that, ask your hosting company to do a traceroute if there is something in their servers to restrict access also.

Wim


« Last Edit: November 10, 2015, 10:15:23 AM by wvdkuil »

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5533
    • KomokaWeather
Re: Meteotemplate - new free website template
« Reply #688 on: November 10, 2015, 10:15:15 AM »
Hi Jachym,
I don't think this has any impact but thought I would share:
Yesterday GoDady support suggested I turn on error log which I did,  There are not many errors reported so far - the subject Canada.php time out and a couple of others, but one in particular
Quote
[Mon Nov 09 22:16:38 2015] [5379896] [fcgid:warn] (32)Broken pipe: [client 178.137.91.140:53808] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function, referer http://www.rospromtest.ru/questions.php
[Mon Nov 09 22:16:57 2015] [5379896] [fcgid:warn] (110)Connection timed out: [client 178.137.91.140:54116] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function, referer http://www.rospromtest.ru/questions.php
Should I be concerned about this and refere location?
 
Thanks,
Paul

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5533
    • KomokaWeather
Re: Meteotemplate - new free website template
« Reply #689 on: November 10, 2015, 10:17:04 AM »
Thanks Wim, and I will try your suggestions
 
Paul

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Meteotemplate - new free website template
« Reply #690 on: November 10, 2015, 10:57:18 AM »
Hi Jachym,
I don't think this has any impact but thought I would share:
Yesterday GoDady support suggested I turn on error log which I did,  There are not many errors reported so far - the subject Canada.php time out and a couple of others, but one in particular
Quote
[Mon Nov 09 22:16:38 2015] [5379896] [fcgid:warn] (32)Broken pipe: [client 178.137.91.140:53808] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function, referer http://www.rospromtest.ru/questions.php
[Mon Nov 09 22:16:57 2015] [5379896] [fcgid:warn] (110)Connection timed out: [client 178.137.91.140:54116] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function, referer http://www.rospromtest.ru/questions.php
Should I be concerned about this and refere location?
 
Thanks,
Paul

To be quite honest I dont know, I dont know how this is related to the template, I have never seen this Russian URL before and I can assure you that no page of the template uses any data from it.

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5533
    • KomokaWeather
Re: Meteotemplate - new free website template
« Reply #691 on: November 10, 2015, 11:13:49 AM »
Hi Jachym, and sorry, I was not suggesting it was anything with Meteotemplate, just that as I was checking the error log to try to determine the canada.php time out issue that ru url showed up on the log as well, and just wanted to pass on for information or guidance.
 
Paul

Offline AWL

  • Forecaster
  • *****
  • Posts: 728
    • Ardmore Weather Live
Re: Meteotemplate - new free website template
« Reply #692 on: November 10, 2015, 12:19:36 PM »
Hi Jachym, and sorry, I was not suggesting it was anything with Meteotemplate, just that as I was checking the error log to try to determine the canada.php time out issue that ru url showed up on the log as well, and just wanted to pass on for information or guidance.
 
Paul

Doing a search on "rospromtest" comes back as a spammer. Might want to block as a referrer in your htaccess. Nothing to do with the template.

-Doug
« Last Edit: November 10, 2015, 12:22:47 PM by DougW »

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5533
    • KomokaWeather
Re: Meteotemplate - new free website template
« Reply #693 on: November 10, 2015, 01:41:00 PM »
Thanks Doug,
I have not yet put any blocked addresses in my .htaccess. 
Is this what I would add?
Quote
order allow,deny
 deny from 178.137.91.140
 deny from 178.137.91
 deny from http://www.rospromtest.ru
allow from all

Paul

Offline AWL

  • Forecaster
  • *****
  • Posts: 728
    • Ardmore Weather Live
Re: Meteotemplate - new free website template
« Reply #694 on: November 10, 2015, 01:51:08 PM »
Thanks Doug,
I have not yet put any blocked addresses in my .htaccess. 
Is this what I would add?
Quote
order allow,deny
 deny from 178.137.91.140
 deny from 178.137.91
 deny from http://www.rospromtest.ru
allow from all

Paul

Here is a link that explains it better than I can.

http://www.javascriptkit.com/howto/htaccess14.shtml

Doug
« Last Edit: November 10, 2015, 02:09:53 PM by DougW »

Offline SimonB

  • Contributor
  • ***
  • Posts: 139
    • meteo.capetown
Re: Meteotemplate - new free website template
« Reply #695 on: November 10, 2015, 02:34:35 PM »
Jachym

Can I suggest a new project for you?

From the current weather conditions, upload those to Facebook, and if it's an extreme weather condition to do it automatically, my paypal account will suddenly be very active


Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5533
    • KomokaWeather
Re: Meteotemplate - new free website template
« Reply #696 on: November 10, 2015, 02:36:37 PM »
Thanks again Doug.
 
Now an update re the Canada.php script not working:  nothing resolved yet and GoDaddy says, after doing the trace route which showed some IP addresses time outs, it is not their IP addresses so no issue from their end and suggest it might by my ISP that is blocking it. 
 
I have called my ISP and their trace route shows no time outs and suggest to call GoDaddy back as the restriction on access would be from web hosting. 
 
Before I call GoDaddy for the fourth time I have contacted Environment Canada, as Wim suggested, to see if they would know of any reasons why the Canada.php script or the test_url_ca.php won't work from my site. (I have placed the test script in the root, and also in a couple of other domains and they all time out)
 
Paul

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Meteotemplate - new free website template
« Reply #697 on: November 10, 2015, 03:54:25 PM »
Thanks again Doug.
 
Now an update re the Canada.php script not working:  nothing resolved yet and GoDaddy says, after doing the trace route which showed some IP addresses time outs, it is not their IP addresses so no issue from their end and suggest it might by my ISP that is blocking it. 
 
I have called my ISP and their trace route shows no time outs and suggest to call GoDaddy back as the restriction on access would be from web hosting. 
 
Before I call GoDaddy for the fourth time I have contacted Environment Canada, as Wim suggested, to see if they would know of any reasons why the Canada.php script or the test_url_ca.php won't work from my site. (I have placed the test script in the root, and also in a couple of other domains and they all time out)
 
Paul

Interesting... I am really curious who and why is responsible for this  :grin:

Offline Maumelle Weather

  • Forecaster
  • *****
  • Posts: 1827
    • Maumelle Weather
Re: Meteotemplate - new free website template
« Reply #698 on: November 10, 2015, 08:51:52 PM »
Hi Jachym,

I just installed the live gauges (very cool BTW). I have one issue with the sunrise/sunset.  It is in Epoch time???? I'm not sure, plus my realtime.txt file does not have the sunrise/sunset info. The sunrise/sunset info is in the CUtags.php file. I checked.

Page is here.

Thanks,

John
« Last Edit: November 10, 2015, 08:55:49 PM by sacreyweather »
GR2AE, GR3, Cumulus

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Meteotemplate - new free website template
« Reply #699 on: November 11, 2015, 06:12:30 AM »
Hi Jachym,

I just installed the live gauges (very cool BTW). I have one issue with the sunrise/sunset.  It is in Epoch time???? I'm not sure, plus my realtime.txt file does not have the sunrise/sunset info. The sunrise/sunset info is in the CUtags.php file. I checked.

Page is here.

Thanks,

John

Hi,

I saw your post yesterday already, but I was not able to quickly find the issue so I am asnwering now. I was quite surprised when I saw this, because as you can see in the demo and on other websites, the exact same script produces normal time and the PHP generated output should be the same on all servers. Your time is in the UNIX format instead of HH:mm.
The times are not taken from any text files, these are actually calculated by the template, it is the same function that is also used in the "Astronomy" pages - sunset, sunrise etc. And to my surprise, those worked fine on your page as well, so I was puzzled by the fact these scripts work there and for some reason they dont work in the live gauges (despite the fact they work elsewhere). However, today I looked at the code more closely and I especially looked more closely at your site and I think I finally found the problem. The problem is you are using outdated version of the template and the compatibility of this plugin is obviously slightly limited - most stuff works, but the time conversion is one of the things that only work correctly in this plugin if you are using newer version of the template - i.e. version 2.0.
I therefore highly suggest you update, it is not that difficult. Version 2.0 brought many bug fixes which you might not even have noticed, it is also much more secure, the 1.x versions are quite prone to SQL injections and also all the sites were optimized so they load faster and important is also the fact that as of 2.0 all sites are in HTML 5 and validated by the W3 standard (pages in v. 1.x often contained several hundreds of errors, which could cause problems in various browsers etc.)
Upgrade is not difficult and in the future, new versions will build up on 2.0. However, the shift from 1.x to 2.0 was quite significant in terms of the code structure and also introduced new structure in the header code, footer code etc. which gave me much better potential for future development of plugins and so it is also likely that more and more plugins will stop or will not work at all right from the beginning. I can also assure you that future updates from 2.0 to new versions will be easier, the problem was that 1.x were still built on the original concept, which I found was impossible to continue.