rejetto forum

HFS "Maintenance page"

0 Members and 1 Guest are viewing this topic.

Offline etherknight

  • Occasional poster
  • *
    • Posts: 23
    • View Profile
I know something like this has been discussed before (something about a downtime page). But I am looking something a bit different.

Should HFS be down completely (switched off), can I have the server serve (see what I did there?) a simple 'try again later' page? Obviously a tpl won't work because HFS is off. So I am thinking an html page in place that would only come up in this circumstance.

The thing is, I don't really know how HFS presents itself to the web. I have Apache installed on the same server, and I still do and it's running. T here is a 'index.htm' file in the www folder. Before I had HFS, anyone who went to my site saw the index file. But once HFS was running all requests were taken to the HFS frontdoor. Given that fact, one would assume (as I did) that HFS could just be turned off again and people would see the index.htm file again, but now they just see a 404 error (or equivalent) unless that go to the specific I| (including the port).I  didn't make any changes to my server (other than running a single exe for HFS), so I don't really know how HFS does this.

Can someone educate me? And, if this is in a FAQ somewhere, please point me there?


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
here's some theory, but i won't mention all details.

when you access a server, you are connecting to IP:PORT where IP may even be google.com
if you don't specify PORT, then you are using the default port.
for the web, default is 80.

on the same machine (network interface) you can't have 2 servers on the same port.
So if your HFS is running and Apache is running too, when you turn HFS off you won't get Apache, but "no answer".
This is not true if Apache is acting as proxy for HFS, so you access HFS through Apache. But this requires special configuration.

Another possibility is that you have HFS on and Apache off. Then when you switch HFS off you turn on Apache.
So they can work on the same port, but not at the same time.

You can find many information if you google for: how does a web server work


Offline etherknight

  • Occasional poster
  • *
    • Posts: 23
    • View Profile
I think I have at least a passing familiararity with how web servers work ;) I don't think I really wrote my question right....

I have never used an server engine that can run from a single EXE, and yet has so much flexibility (which is very cool, BTW). Nor have I ever started a daemon/service (IIS, Apache, etc) that just 'takes over' port 80 without a single bit of configuration. One moment Apache is answering on 80, then after I ran HFS for the first time, it's not. In that past, when I setup two web servers and forget to redirect ports properly, I will get some kind of 'port conflict' error and neither of them will work.... I am assuming HFS is coded to be the dominate web daemon regardless.

I am getting a distinct whiff of 'trade secret' here....which is totally okay with me. That's what decompilers are for  :D

I kid, I kid.. I kid because I love....


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
if HFS was able to sit on port 80, then the only way i know is that port 80 was available (not used).
so, if your apache was correctly functioning on port 80, there's no way HFS would dethrone it. (without being specifically programmed to do it)
if apache was configured for port 80, then it was not running at the time, and would fail when you run it after HFS occupied port 80.
otherwise apache is not configured for using port 80.

HFS is programmed to use port 80 if available, otherwise it tries some other ports.