Page 1 of 1

Proxying access to internal web URLs from outside

Posted: Sat Aug 15, 2009 12:08 am
by geekraver
Hi all

I have migrated my web server over from Ubuntu to my new Amahi server and most things are working well, including things like demuxing SSL connections to Outlook Web Access on my Exchange server. I thought I would use a similar proxying trick to access URLs such as http://hda from outside, with http://<mywebsite>/hda. So I added proxy entries like this to my Apache custom conf file for my SSL vhost:

<Location /setup>
ProxyPass http://setup
ProxyPassReverse http://setup
SSLRequireSSL
AuthUserFile "/var/hda/web-apps/htpasswd"
AuthName "Foo"
AuthType "Basic"
require valid-user
</Location>

However, whenever I access these URLs from outside I just get the Apache "Fedora test page".

Does anyone have any ideas about how else I could make this work? I don't care in the end if it is done with proxying; I just want authenticated access iover SSL from outside to the internal vhosts (mwiki, hda, setup, ...)

Re: Proxying access to internal web URLs from outside

Posted: Sat Aug 15, 2009 12:33 pm
by geekraver
Ah, I figured out a way. In my vhost directory for the externally accessible site I make symlinks to the various var/hda/web-apps/APP directories such as phpsysinfo. Then in my config for my vhost I added:

Redirect /info https://www.myhost.com/phpsysinfo/html
<Location /phpsysinfo/html>
Options Indexes FollowSymLinks +ExecCGI
AddHandler fcgid-script .fcg
</Location>

(The options and addhandler entries I pulled out of the conf file for phpsysinfo)

And now I can access my info with:
https://www.myhost.com/info

Re: Proxying access to internal web URLs from outside

Posted: Sat Aug 15, 2009 12:57 pm
by geekraver
This works for phpsysinfo and ajaxexplorer but not for mwiki or ampache as they don't preserve the path prefix.

Re: Proxying access to internal web URLs from outside

Posted: Sat Aug 15, 2009 2:04 pm
by cpg
if you are opening the port and can allow direct access, you can solve it by simply adding a serveralias to the webapp to match the name under which it's being accessed.

we'd like to make this an option under webapps. if you know ruby we can work on making this an option.