RPI 2 is not accessible after a week - raspberry-pi2

I have a RPI2 that acts as a web server and contains a web application for heating control. Everything was working fine about 6 months. Now, the RPI2 can't be accessed through ssh client or ftp server. Also, when I enter the URL of the web application it cant be accessed , I can only access the www folder of the web server ( The IT WORKS page ). When i plug off the RPI2 from power, and plug it in again, everything works for about a week ( i can access the web app, ssh is accessible, ftp is accessible). After a week passes the RPI2 gets stuck again. It seem that after a week of runtime i am losing permissions? Any thoughts?

First you would need to check the logs for those services to see if they give any clue as to why they are crashing or shutting down.
If there was no clue there, then you would need to look at the OS level.

Related

IIS can only support three instances of a Blazor server client?

I've download Visual Studio 2022 and tested the default Blazor Server template (Home/Counter/FetchData). In Visual Studio, IIS Express I can open as many tabs / instances of the application as I want.
When I host the default Blazor Server template in local IIS (Windows 10 Home 21H2, IIS 10) I can only open three instance of the application. The fourth will hang until the first is closed. I see someone has ran into nearly the exact same issue but there is no solution provided.
Anyone know whats going on? I don't understand why IIS Express can handle multiple instnaces but IIS 10 can not. Even Conveyor by Keyoti can support many many tabs compared to IIS 10.
Note: I notice SignalR has limitations on Windows / IIS of 10 concurrent connections, but I'm not even getting two.
Updates
Out of curiosity I tested it on Windows Server 2016 Standard and I can open hundreds of tabs.
I re-installed IIS on Windows 10 to make sure something wasn't wacky.
I've ensured WebSocket Protocol is enabled.
Windows 10 Home supports 3 concurrent connections at the same time, according to Microsoft.
Normal HTTP requests to IIS get process and response returned. So even if you manage to achieve 4 or more at the same time, IIS will work through the request queue and you may not have noticed that your request was slightly delayed unless your individual requests take a while to process.
However with SignalR, a persistent connection is maintained to the server. So if you open one connection per browser tab, and you have 4 tabs open, that 4th tab is going to hang indefinitely until one of the other page has its connection ended (by closing the tab, manually disconnecting via code, or refreshing the page).
I can't reproduce the issue, and I have tried to search some way to solve it.I will summarize a few ways below that you can try.
Try to install Websocket Protocol in your Win10. You can find it in Windows features.
Workaround: install IIS Express in Web Platform Installer.
Workaround: Try to deploy it in windows server, and check whether have same issue. I found some posts also mentioned it may related with OS version.
The solution was incredibly simple (maybe too simple?). Don't use IIS at all.
In Program.cs just before building the app I override Kestrel ports to listen on any ip (for now).
(Optional) I provide a custom SSL certificate in the UseHttps constructor so that it can be emailed and installed on iOS and Android devices.
(Required) Then I publish the applications to a folder and just run the .exe on the hosting machines.
Program.cs
builder.WebHost.ConfigureKestrel(opt =>
{
opt.ListenAnyIP(8000);
opt.ListenAnyIP(8001, listOpt =>
{
listOpt.UseHttps(#"Path to.pfx file", "password for pfx file");
});
});
Now Windows 10 Home can support as many connections as the hardware can handle at https://192.168.0.XXX:8001. Is this how Blazor Server is expected to be deployed within a local network? I don't understand how this overcomes the connection limit pointed out in masons answer. Please let me know in the comments if I'm missing something.

Windows Authentication localhost vs fully qualified name

Can someone please explain to me why I get two different results when running the same software? I've got a .NET Core application running with IIS.
When I access it as http://localhost/foo it all works as expected. I authenticate properly.
When I access it as http://machine.domain.com/foo I get a credentials dialog appear, asking me to enter a username/password and no matter what I type in I can't get it to authenticate.
It's the same piece of software running on the same box. The only difference is the URL I'm using to access it. My guess is that it must be something on the network causing this problem.
Btw, this machine is just being accessed across a corporate lan. Not the internet.

Sonos Sample Server Authentication Error

I am currently in the beginnings of developing an integrated Sonos app, and to get a better understanding of what needs to happen, I downloaded Sonos's provided sample server for the "Acme" service.
On first use, I was able to get it working and was able to play songs from the static directory that was provided within the package. However, after closing the server, leaving my computer for some time, and booting it back up again with ./gradlew bootRun, I noticed that I was not able to use the sample service anymore. On the window to link the sample account, it said that there was an error in authenticating and that it might be an issue with the connection.
First things first, I rebooted everything I could reboot. Turned the gradle server on then off. Removed the service and created it again. I even did a factory reset and put the Sonos device (PLAY:1 variety) on a different network at the office. The sample service still won't authenticate.
What could be causing the authentication for the sample Acme service to stop working just like that on every network? I should mention that I have been using the same config settings ever since I got it to work the first time, so it should not be a problem with my configurations in the customSD page. Also, I have not changed any code within the sample server.
TL;DR: The Sonos sample server worked one time for me, and hasn't worked since on multiple networks and devices, even after a factory reset. What could be causing this issue?
It sounds like the player possibly can't find the sample server any more. When you set up the service via customsd, you used an ip address for the endpoint. Is it possible that ip address has changed?

Which Google OAuth Flow is good for web application not reachable from the internet?

I wrote a small application which needs access to Google API with OAuth2 and which is typically run on maybe a Raspberry Pie to reduce power consumption since it needs to run pretty much 24/7. The device my application runs on is typically connected a LAN at home.
The user controls the application using a web interface from a PC/Tablet/... in the same network. However the web application is reachable from the LAN only, it cannot (and should not for security reasons) be accessed over the Internet, because it hides behind a NAT and/or a firewall.
The documentation states that I have the following options:
Web server applications
This forces me to use a redirect URL which must be known in advance. Since my app is most likely accessed by a dynamic private IP address, there is no way I know the URL in advance.
Installed applications
Yes, that would work. I just need people to copy and paste the returned code into a web form of mine. However that is somewhat uncool.
Client-side (JavaScript) applications
This does not give me a refresh token which I totally need.
Applications on limited-input devices
Polling? Well... If it works... However it requires the user to match a code shown on the device with a code displayed in the webbrowser. If I use that I can just as well ask the user to copy&paste the code returned by the installed app mode.
As far as I can see the copy&paste the code with installed app is my best chance. Is it really? Or is there is possibility to get along without that bit?

Issue with Internet Explorer 8 and 9 and MVC4 Web Site running on IIS 7.5 on Windows Server 2008 R2

We recently upgraded an MVC3 application to MVC4 and .Net 4.5. The upgrade was done by creating a new MVC4 site and adding all the controllers etc back in, manually.
The site was deployed internally to a win2008 R2 64 bit server, on which we installed .Net 4.5.
When we browse to the web site with IE8 or IE9 the application works well for a while as we navigate through various pages, including standard views, partial views, popups, paged lists etc.
At some point we end up going to a page in the site (any page, complex or not) and IE8 and 9 both just sit there for a long time (usually 1-3 minutes and displaying the page loading progress bar) eventually they both show the page as requested. Often the same behaviour occurs on the following few pages and then magically comes right (for a while)
If we browse to the same web site in Chrome, Ie10, Safari, FF at there are no issues at all. If we browse to the web site with one of these browsers from the same machine while the ie8/9 are "loading" then we can still access the site quite happily without any issues.
A check of task manager memory and performance on the client, web server and database server shows almost no CPU usage and no increased memory usage while this is happening. It is almost as if the browser is just taking a tea break. Fiddler shows nothing unusual either.
It should be noted that as this is an SAAS application we are managing multiple databases through the same site and these are configured into the users session state based on an incoming url in the web site bindings. Having said that as far as we can tell, the session state is remaining intact. a) The browser does eventually return with the expected data, b) there are no recycling events recorded in the event log (in fact there are no events at all around the time this issue occurs)
Application pool is set to framework 4.0.30319, integrated, enable 32bit, max worker processes = 1
We reverted the web site on the server back to the original MVC3 implementation and still retained the .net4.5 install on the web server. This now exhibits the same fault as the mvc4 site.
We re-imaged the server to a state before the .net4.5 was installed, ran the MVC3 site and everything operated again as we would expect. Repeating the install caused the same problem again.
It is almost like the .net4.5 install on the server has caused some problems for the IE8/9 browser. Back to fiddler again, which shows different host headers for the different version of .Net, but that seems to be the only difference.
Whilst we would love to be able to tell the user's not to use ie8/9 that is not practical, so now we are completely stuck.
Any help / ideas will be appreciated. Thanks.