rejetto forum

HFS Icons through an Apache Reverse Proxy

0 Members and 1 Guest are viewing this topic.

Offline chris.zeman

  • Occasional poster
  • *
    • Posts: 7
    • View Profile
HFS has proven to be an extremely valuable tool in our organization. Great job, rejetto! I am, unfortunately, having one problem.

I have a Linux server acting as an internet gateway for our LAN, and a general purpose web server. HFS is running on another employee's machine on our LAN. It's a long story, but both machines MUST be able to serve pages on port 80, so I can't simply forward port 80 to HFS. I configured Apache to act as a reverse proxy for the computer running HFS, assigning a sub-domain to the HFS macine. I can connect to HFS from the internet, upload and download files, but HFS's icons aren't being displayed.

I am sure this is a configuration problem with Apache, but figured this forum would be the best place to start. I just need something to go on.

Thank you,
Chris


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13523
    • View Profile
what icons?
you mean the icons aside the file names on the browser?


Offline chris.zeman

  • Occasional poster
  • *
    • Posts: 7
    • View Profile
Yes. Actually, pretty much any image. Here is a screenshot:




Thank you,
Chris


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13523
    • View Profile
check the "max connections" and "max connections from single address" options.
they should not be used, and can cause such problem.

if this is not the case, try posting the content of menu -> other options -> show customized options


Offline chris.zeman

  • Occasional poster
  • *
    • Posts: 7
    • View Profile
Those options were all disabled. Here are the customized options:

Code: [Select]
easy=no
default: yes

tpl-font=Tahoma|10|clBlack|
default: Tahoma|10|clWindowText|

log-file-name=C:\Log.txt
default:

log-date=yes
default: no

log-replies=no
default: yes

confirm-exit=yes
default: no

search-better-ip=no
default: yes

start-minimized=yes
default: no

files-stay-flagged-for-minutes=1000
default: 0

auto-save-vfs=yes
default: no

use-comment-as-realm=no
default: yes

beep-on-flash=yes
default: no

list-protected-items=yes
default: no

auto-save-vfs-every=6000
default: 0

auto-save-cfg-every=6000
default: 0

flash-on=connection
default: download

last-file-open=C:\My Documents\HFS.vfs
default:

find-external-on-startup=yes
default: no

mime-types=*.htm;*.html|text/html|*.jpg;*.jpeg;*.jpe|image/jpeg|*.gif|image/gif|*.png|image/png|*.bmp|image/bmp|*.ico|image/x-icon|*.mpeg;*.mpg;*.mpe|video/mpeg|*.avi|video/x-msvideo|*.txt|text/plain
default: *.htm;*.html|text/html|*.jpg;*.jpeg;*.jpe|image/jpeg|*.gif|image/gif|*.png|image/png|*.bmp|image/bmp|*.ico|image/x-icon|*.mpeg;*.mpg;*.mpe|video/mpeg|*.avi|video/x-msvideo|*.txt|text/plain|*.css|text/css

address2name=Mike|xx.xxx.xx.xx|Mike J Laptop|xx.xx.xxx.xx|Mike J Home|xx.xxx.xx.xx|Mike Home|xx.xxx.xxx.x|New Jersey|xx.xxx.xxx.xx
default:

recents=C:\My Documents\HFS.vfs
default:

tray-instead-of-quit=yes
default: no

out-total=135108178
default: 0

in-total=10388769
default: 0

copy-url-on-start=yes
default: no

connections-columns=IP;170|Filename;160|Status;100|Speed;80|Time left;55|%;512|
default: IP;120|Filename;180|Status;180|Speed;60|Time left;55|%;50|

Thank you,
Chris


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13523
    • View Profile
no idea.
and i actually don't know what the reverse proxy is.
let us know if you find something more.


Admin_from_Hell

  • Guest
HFS takes the Iconfiles always from the root folder.
The Apache reverse proxy takes the HFS-root to a subfolder of root e.g. /application-install/.
Now HFS still tries to get the icon files from / but there's nothing to find.
The solution would be that it would be possible to tell HFS to get his icon-files from a subfolder, or it would use relative links instead of absolute links to root.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13523
    • View Profile
HFS takes the Iconfiles always from the root folder.
The Apache reverse proxy takes the HFS-root to a subfolder of root e.g. /application-install/.
Now HFS still tries to get the icon files from / but there's nothing to find.

you are telling me that this proxy thing transforms the URL /~imgxx into /path/~imgxx ?
i don't see a reason for such behaviour, it seems a bug to me. do you know the reason?

Quote
The solution would be that it would be possible to tell HFS to get his icon-files from a subfolder, or it would use relative links instead of absolute links to root.

special URLs make impossible for you to use such filenames, that's why i limited them to the root.
and even if i would let them be working also in folders, the default template should always use the root, because this way the browser uses the cache instead of downloading the same icon twice, so you should edit the template yourself to make it work.
anyway i'm open to make the change i just described if you induce me to think the behaviour of this proxy thing is not a bug. How can this thing expect an URL works if it changes the path?


Offline chris.zeman

  • Occasional poster
  • *
    • Posts: 7
    • View Profile
Hi rejetto,

No, it's not a bug. I have a THEORY as to why Apache does this. I don't know if Apache is the only web server that does this, but here is my theory. If there was a web server with the domain example.com, and the server administrator allowed each user to have a web site on their server, the site would typically be accessed by going to http://example.com/~username. The server knows by the tilde (spelled right?) to serve the files located in the user's home directory.

I believe Apache is looking for home directories for imgxx or whatever. I think (and hope) I explained this right. :)

I think Admin_from_Hell's suggestion would do the trick.

Thank you,
Chris


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13523
    • View Profile
yes, maybe...  but as far as i know, the ~ has nothing to do with apache itself, it's a just a convention for user folders inherited by unix, where ~ means the user "home".
so, perhaps ~frank is just a link on the disk to the user www space, and apache doesn't treat it in any special way, just follows the file system.


Offline chris.zeman

  • Occasional poster
  • *
    • Posts: 7
    • View Profile
Yes, exactly. :)

I downloaded every image, moved it to a directory on my server, and then modified the template in HFS to load the images from a URL that wasn't being forwarded through my server. It didn't work right for some reason. I can't remember what icon showed up next to all the files, but it was the same for all the files. I must have done something wrong.

Chris


Offline chris.zeman

  • Occasional poster
  • *
    • Posts: 7
    • View Profile
I'll tell you what, Rejetto. I'll pledge $10 towards HFS is we can get this working. :)

Here is my Virtual Host configuration. Maybe someone will notice something that's missing. Perhaps the solution is simple. :)

Code: [Select]
NameVirtualHost *
<VirtualHost *>
        ServerAdmin webmaster@localhost

        DocumentRoot /var/www/
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
                # This directive allows us to have apache2's default start page
                # in /apache2-default/, but still have / go to the right place
                #RedirectMatch ^/$ /apache2-default/
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog /var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/access.log combined
        ServerSignature On

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

RewriteEngine On
RewriteRule .* - [CO=BALANCEID:balancer.automation:.domain.net]
</VirtualHost>

<VirtualHost *>
    ServerName eng.domain.net
    ProxyRequests Off
    ProxyPreserveHost On

    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>

    ProxyPass / http://172.16.1.20/
    ProxyPassReverse / http://172.16.1.20

    <Location />
        Order allow,deny
        Allow from all
    </Location>
</VirtualHost>





Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13523
    • View Profile
i guess you would get more help by the apache community.
did you notice ProxyPass has a trailing slash while ProxyPassReverse has not?
i saw an example on the apache website and it has no slash
Quote
ProxyPass /foo http://foo.example.com/bar
ProxyPassReverse /foo http://foo.example.com/bar

anyway, it's strange you are proxying the /
is that apache really serving any page on its own?


Offline ELEVENNNN

  • Tireless poster
  • ****
    • Posts: 257
  • havent been here lately, still wont be here?
    • View Profile
I read everything said and it doesnt sound like apache needs to be altered, it isnt working ideally by default but i'd imagine you can put absolute path's in your template so that it just calls it from a location (it would act as if it was a non-local address, but in fact it would be).  you said that when you made changes you got all the same icons, so thats somewhere to start. I would try doing a find+replace within the template and add absolute paths.  If that doesnt work you can tackle the harder stuff  :D

If my answer is blatantly wrong and I missed something feel free to slap me with a wet something of your choice.
-Kurt
« Last Edit: October 24, 2007, 04:44:07 AM by ELEVENNNN »
This is going to take a long time
.................+...........................................
...................+.............+.................+.........
......................................