rejetto forum

Software => HFS ~ HTTP File Server => Topic started by: CeltiX on August 26, 2006, 09:47:20 PM

Title: Need help with HFS and Web Server
Post by: CeltiX on August 26, 2006, 09:47:20 PM
I am currently running a web server on port 80. I would like to also run HFS without using a non-standard port (I can only access port 80 from school and work). Does anyone have any suggestions?

I have tried running HFS from a different machine on my LAN, and using a PHP include on the webserver to point to HFS< but all the file paths are relative, so I can't click on anything usefully.
Title: Re: Need help with HFS and Web Server
Post by: rejetto on August 26, 2006, 10:37:25 PM
it is technically possible to make the other web server recognize the host and tunnelize all traffic to HFS (for a spefic host).
i know no real solution anyway, because i know no web server that can be configured to do so.
Title: Re: Need help with HFS and Web Server
Post by: ~GeeS~ on August 27, 2006, 02:02:36 PM
I am currently running a web server on port 80. I would like to also run HFS without using a non-standard port (I can only access port 80 from school and work). Does anyone have any suggestions?
1. Run on non-standard port and find a proxy which supports connection to non-standard ports or
2. Port 443 normally isn't blocked (https). Run Stunnel on port 443 and forward to HFS on any unused port.
see http://www.rejetto.com/forum/index.php?topic=3083.0
Advantage: Traffic between Stunnel and your PC on the external location is completely encrypted.
Edit: 3. Just tried, Standard https port 443 accepts non-standard request http://localhost:443. Maybe this will work too. No need for Stunnel.
Title: Re: Need help with HFS and Web Server
Post by: rejetto on August 29, 2006, 12:41:37 AM
if he can use 443, then just tell HFS to listen on 443
Title: Re: Need help with HFS and Web Server
Post by: CeltiX on August 29, 2006, 01:52:12 AM
It does indeed work on port 443, thanks for your help, guys.

I still have one problem: Once I login, HFS seems to reload the ip, but not with the port. Since I have a webserver running on port 80, after login, the page refreshes to the default website. Any insight on this?

EDIT:
If I use any non standard port, login leads to a "page not found"
Title: Re: Need help with HFS and Web Server
Post by: rejetto on August 29, 2006, 01:58:57 AM
please explain better your problem
Title: Re: Need help with HFS and Web Server
Post by: CeltiX on August 29, 2006, 02:17:22 AM
Ok, I have KeyFocus Web Server (port 80) and HFS (port 443) running on the same machine.

Here is the website: http://www.celtixnet.ca (http://www.celtixnet.ca)
Here is HFS: http://www.celtixnet.ca:443 (http://www.celtixnet.ca:443)

If I login to HFS, the page will refresh and come back to http://www.celtixnet.ca (http://www.celtixnet.ca), and I see my website instead of the HFS page.

I've created a user for you to experiment. Username: test password: hfs
Title: Re: Need help with HFS and Web Server
Post by: ledufe on August 29, 2006, 03:23:22 PM
well i've just tested your hfs link on 443 and logedin with the login instructions you provided and browsed your folders.... and there is nothing wrong with it....
i've tested with mozilla and everything works ok
but when i test it with internet explorer , the problem you mentioned apears to happen....
i guess it is not a hfs issue, but a browser problem, i donĀ“t know how to solve it, but i hope this info help you....

sorry for my poor english

Title: Re: Need help with HFS and Web Server
Post by: rejetto on August 29, 2006, 03:45:08 PM
which HF version?
Title: Re: Need help with HFS and Web Server
Post by: CeltiX on August 29, 2006, 03:46:26 PM
I've experienced this with 2.1 beta 14 and 15
Title: Re: Need help with HFS and Web Server
Post by: maverick on August 29, 2006, 03:53:34 PM
I've tested with Opera & mozilla browsers.  No problem.  Works as it should.

The problem shows up with Internet Explorer.  Don't know why but it seems to be a browser issue.
Title: Re: Need help with HFS and Web Server
Post by: ~GeeS~ on August 29, 2006, 03:59:46 PM
Tested with IE, nothing else available momentarily:

1. http://www.celtixnet.ca:443 loads correctly HFS
 
2. login, which is command http://www.celtixnet.ca:443/~login (authorisation window pops up correctly)

3. After entering the credentials test:hfs the page should reload with http://www.celtixnet.ca:443 and show the same page with your user name, but for some reason HFS drops the :443 and reloads with http://www.celtixnet.ca which is by default http://www.celtixnet.ca:80, your apache-server.

4. When you then do a "manual reload" by entering http://www.celtixnet.ca:443 (make sure not to load from browser cache!) you'll get your hfs page with correctly being logged in as user:test.

Conclusion:
Credential are correctly passed to HFS, but page reload goes wrong due to dropping off the port number in the reload request (by HFS or IE?), because a different port is requested. If this different port hosts a service, like your apache on port 80, you'll  get that apache server page. If the different port doesn't host a server, you'll get correctly "page not found".

When i was working on templates yesterday, i found another issue: the command %host%:%port% results in eg. "myserver:123", except for port 80 and 443, which just gives "myserver:" ; the portnumber isn't displayed.

Maybe there's a relation. Maybe something in the logs to conclude more specifically.
Title: Re: Need help with HFS and Web Server
Post by: maverick on August 29, 2006, 04:25:34 PM
the command %host%:%port%

I don't think %port% is a valid symbol.  I have no record of it.  I tested and it doesn't work here.  It just shows up in my pages as %port%.  v2.1b14.
Title: Re: Need help with HFS and Web Server
Post by: ~GeeS~ on August 29, 2006, 04:44:50 PM
I don't think %port% is a valid symbol. 
You are right! %host% returns url:port except if the port is 80 or 443, then it returns just url.

But this doesn't change the above story. Sorry for messing up.
See also the ~login discussion in the thread "How about SSL support".

... and also here about strange behaviour of port 443: http://www.rejetto.com/forum/index.php?topic=3623.0
Title: Re: Need help with HFS and Web Server
Post by: ~GeeS~ on August 31, 2006, 07:18:31 PM
Couldn't post for some reason the header logs from Proxomitron. You can download the txt-file here:
http://www.yousendit.com/transfer.php?action=download&ufid=5A75A94B3ECC29B1
or see attached file in footer of this post.
Here is an other reading about redirects
http://ppewww.ph.gla.ac.uk/~flavell/www/post-redirect.html



[attachment deleted by admin]
Title: Re: Need help with HFS and Web Server
Post by: CeltiX on August 31, 2006, 08:13:41 PM
Wow, that's about as comprehensive as I could think of. I'm glad i'm not the only one stumped by this problem!
Title: Re: Need help with HFS and Web Server
Post by: ~GeeS~ on September 01, 2006, 06:12:14 PM
This bothered me since a long time. Your questions just triggered the search for the problem.

In the source from HFS2.0a in hslib.pas line 1064:
Quote
HRM_REDIRECT, HRM_MOVED:
    begin
    s:=reply.url;
    if pos('://', s) = 0 then
      with request do
        s:='http://'
          +ifThen(user>'', user+ifThen(pwd>'',':'+pwd)+'@')
          +getHeader('Host')+s;
    sendHeader(replyheader_mode(reply.mode)+'Location: '+s );
    end;
'Host' obviously misses the port information.
Title: Re: Need help with HFS and Web Server
Post by: rejetto on September 17, 2006, 06:43:42 PM
check new beta, it shoud be fixed now
Title: Re: Need help with HFS and Web Server
Post by: ~GeeS~ on September 17, 2006, 07:02:57 PM
Great! Thx. Wil check tommorow... to much vino tonite  :)