Cache Folder IIS

Post Reply
spd2612
Forecaster
Forecaster
Posts: 185
Joined: Thu Jan 23, 2020 4:00 pm
Location: Jonesboro Ar
Station model: Ecowitt Wittboy /GW2000
Software: ECOWITT Plugin
Contact:

Cache Folder IIS

Post by spd2612 » Sat Nov 06, 2021 9:33 pm

I have disabled the error reporting that Meteotemplate throws if cache folder is no writeable, how ever the warning is still there if i inspect the page. something is wrong here
Warning shows it deletes and recreates the same date file
Is there anyone that has found why this happens or how to fix
attached you will see my cache folder and also the error from the browser
You can see that its writeable by the file structure
errors.jpg
errors.jpg (110.98 KiB) Viewed 5054 times
cache folder.jpg
cache folder.jpg (46.99 KiB) Viewed 5054 times
Image

WS90 Wittboy Pro
HP2564 Console
GW2000 Gateway
WH40 Rain Gauge
WH57 Lightning Detector

User avatar
Daali
Advisor
Advisor
Posts: 56
Joined: Mon Jul 26, 2021 8:06 pm
Location: Georgia, US
Station model: Ecowitt GW1002
Software: Meteobridge, FOSHKplugin
Contact:

Re: Cache Folder IIS

Post by Daali » Sun Nov 07, 2021 12:29 pm

I guess whatever system user PHP is using has a rights issue?
https://www.jeffersonweather.com
GW1000 gateway
WS68 Anemometer
WH40 Rain Gauge
WH32 Temp/Hum
WH57 Lightning
WH41 PM2.5 Air Quality
WH45 PM2.5/10/Co2 Air Quality
WN34S Soil temperature
WH31SM Soil Moisture

davidefa
Expert
Expert
Posts: 888
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: Cache Folder IIS

Post by davidefa » Tue Nov 09, 2021 2:58 pm

The warning you reported is relative to the homepage/blocks/summary/cache folder.
You can try the following:
- extract the attached scripts in your homepage/blocks/summary folder
- from the browser execute the unlink1.php script ( https://hurricanepub.com/homepage/block ... nlink1.php )
- this should delete the homepage/blocks/summary/cache/yesterday.txt file, using a relative path to the file, in the same way as the summary block does ( and it should not work, as it does not work in the summary block )
- from the browser execute the unlink2.php script ( https://hurricanepub.com/homepage/block ... nlink2.php )
- this should delete the homepage/blocks/summary/cache/yesterday.txt file, using an absolute path to the file ( hope it works )
a) if both scripts fail you should have problems with folder permission
b) if the unlink2.php succeeds you should have problems with file access using relative paths

P.S.
In any case you should have similar problems with other blocks/plugins that use a cache folder ( they generally fail without reporting anything )
Attachments
unlink.zip
(502 Bytes) Downloaded 359 times
Image

spd2612
Forecaster
Forecaster
Posts: 185
Joined: Thu Jan 23, 2020 4:00 pm
Location: Jonesboro Ar
Station model: Ecowitt Wittboy /GW2000
Software: ECOWITT Plugin
Contact:

Re: Cache Folder IIS

Post by spd2612 » Sat Nov 13, 2021 10:39 pm

Well I did not see your replys Thank you for them

However IIS and PHP are very funny the way they play togeather
I did this

created a simple PHP file on the concerned website. The content of this file was:

<?php var_dump(ini_get('fastcgi.impersonate')); ?>

I Navigated to this file using a browser.



My browser shows :

string(1) "1"

I ran this from cmd prompt

%windir%\system32\inetsrv\appcmd.exe list config "My Web Site" ^
/section:anonymousAuthentication

And to my surprise PHP was not running on the APP Pool for that site
here is the return from cmd prompt

<system.webServer>
<security>
<authentication>
<anonymousAuthentication enabled="true" userName="IUSR" />
</authentication>
</security>
</system.webServer>

So I added IUSER to the cache folder and gave it write permissions

Then uncomented the lines in indexDesktop.php Now its all good
I guess just because the web site runs under its appPool, that does not mean PHP BACK END GOES THE SAME WAY

I got this info from a different source but here it is if anyone needs it

Code: Select all

The first thing to do is to create a simple PHP file on the concerned website. (It's important to create the file on the concerned website because each website can have a different setting.) The content of this file should be:

<?php var_dump(ini_get('fastcgi.impersonate')); ?>
Navigate to this file using a browser.

** Case 1 **

If your browser shows :

string(1) "1"
Then, you need to execute the following command (you need to replace "Default Web Site" by the name you gave to your website in IIS) :

%windir%\system32\inetsrv\appcmd.exe list config "Default Web Site" ^
/section:anonymousAuthentication
You will receive an answer which looks like this :

<system.webServer>
  <security>
    <authentication>
      <anonymousAuthentication enabled="true" userName="IUSR" />
    </authentication>
   </security>
</system.webServer>
The information you are looking for is the value of the username attribute of the anonymousAutthentification tag.

If this value is not empty, its content is the name of the user you need to give write permissions to.
If this value is empty or if the attribute is simply missing, you need to give write permissions to IIS AppPool\AppPoolName (replace "AppPoolName" with the name of your website's application pool).
** Case 2 **

If your browser shows :

string(1) "0"
You need to give write permissions to IIS AppPool\AppPoolName (replace "AppPoolName" with the name of your website's application pool).
Image

WS90 Wittboy Pro
HP2564 Console
GW2000 Gateway
WH40 Rain Gauge
WH57 Lightning Detector

davidefa
Expert
Expert
Posts: 888
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: Cache Folder IIS

Post by davidefa » Sat Nov 13, 2021 10:42 pm

Thanks for sharing
Image

spd2612
Forecaster
Forecaster
Posts: 185
Joined: Thu Jan 23, 2020 4:00 pm
Location: Jonesboro Ar
Station model: Ecowitt Wittboy /GW2000
Software: ECOWITT Plugin
Contact:

Re: Cache Folder IIS

Post by spd2612 » Sat Nov 13, 2021 11:59 pm

davidefa wrote: Sat Nov 13, 2021 10:42 pm Thanks for sharing
I have been running IIS servers since the early 90’s and Microsoft just wont leave crap alone
Whats the point of being able to pick a app pool to run iis under if you still have to manually add credentials for php to use for non default permissions
Image

WS90 Wittboy Pro
HP2564 Console
GW2000 Gateway
WH40 Rain Gauge
WH57 Lightning Detector

Post Reply