Koozali.org: home of the SME Server

Apache mod_rewrite and mod_proxy - Need Help!

superbytes

Apache mod_rewrite and mod_proxy - Need Help!
« on: August 22, 2006, 11:46:22 AM »
I want to accomplisch the following:

reverse proxy / mod_rewrite https://vpn.foo.com to
a internal address https://hostname.domain:port which is not reachable from the internet. This without affecting the https://www.foo.com/webmail address.


In my custom dns already made vpn.foo.com available on the internet. Also added this on my server.

I really need some how to configure apache and setup the rules. I am running SME 7.0 final server.

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Apache mod_rewrite and mod_proxy - Need Help!
« Reply #1 on: August 22, 2006, 01:00:57 PM »
Quote from: "superbytes"

reverse proxy / mod_rewrite https://vpn.foo.com to
a internal address https://hostname.domain:port which is not reachable from the internet. This without affecting the https://www.foo.com/webmail address.
/quote]

You might try:

db domains set vpn.foo.com domain Nameservers internet
db domains setprop vpn.foo.com ProxyPassTarget http://hostname.domain:port/
db domains setprop TemplatePath ProxyPassVirtualHosts
 
signal-event domain-create vpn.foo.com

I'm not sure that this will do https correctly, but it'll be close.

superbytes

Re: Apache mod_rewrite and mod_proxy - Need Help!
« Reply #2 on: August 23, 2006, 10:48:59 PM »
Quote from: "CharlieBrady"
Quote from: "superbytes"

reverse proxy / mod_rewrite https://vpn.foo.com to
a internal address https://hostname.domain:port which is not reachable from the internet. This without affecting the https://www.foo.com/webmail address.
/quote]

You might try:

db domains set vpn.foo.com domain Nameservers internet
db domains setprop vpn.foo.com ProxyPassTarget http://hostname.domain:port/
db domains setprop TemplatePath ProxyPassVirtualHosts
 
signal-event domain-create vpn.foo.com

I'm not sure that this will do https correctly, but it'll be close.





-----------------------

Thanks for the hint. I tried, but did not work. Maybe because I'am not clear what is ment by : db domains setprop TemplatePath ProxyPassVirtualHosts

I entered : db domains setprop TemplatePath ProxyPassVirtualHosts /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/

I gues I did something wrong

Offline pfloor

  • *****
  • 889
  • +1/-0
Re: Apache mod_rewrite and mod_proxy - Need Help!
« Reply #3 on: August 24, 2006, 09:16:53 AM »
Quote from: "superbytes"


Thanks for the hint. I tried, but did not work. Maybe because I'am not clear what is ment by : db domains setprop TemplatePath ProxyPassVirtualHosts

I entered : db domains setprop TemplatePath ProxyPassVirtualHosts /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/

I gues I did something wrong


Just follow Charlie's steps exactly as he put them.  The only thing you need to do is put *your* hostname.domain:port in the second command.  You don't need to add a path to the third command.
In life, you must either "Push, Pull or Get out of the way!"

Offline pfloor

  • *****
  • 889
  • +1/-0
Apache mod_rewrite and mod_proxy - Need Help!
« Reply #4 on: August 24, 2006, 09:35:47 AM »
Sorry, I stand corrected.

Third command should be:

db domains setprop vpn.foo.com TemplatePath ProxyPassVirtualHosts
In life, you must either "Push, Pull or Get out of the way!"

sicnus

Apache mod_rewrite and mod_proxy - Need Help!
« Reply #5 on: August 25, 2006, 06:54:17 AM »
I haven't gotten around to testing it but what is the vpn.foo thing all about?  what's its use?

Also is the 3 or 4 lines of code usable as proxypass? I just want http://mydomain.com on port 8080 to go through my SME server/gateway to my webserver that is in my LAN.

Offline pfloor

  • *****
  • 889
  • +1/-0
Apache mod_rewrite and mod_proxy - Need Help!
« Reply #6 on: August 25, 2006, 08:51:53 AM »
Quote from: "sicnus"
I haven't gotten around to testing it but what is the vpn.foo thing all about?  what's its use?

It is used to pass port 80 to an internal server.  It can also be used to create re-directs like:

forum.domain.com redirects to domain.com/forum

Quote from: "sicnus"
Also is the 3 or 4 lines of code usable as proxypass? I just want http://mydomain.com on port 8080 to go through my SME server/gateway to my webserver that is in my LAN.


No, proxypass only deals with port 80, what you want to do is create a port forward rule in the server-manager like this:

protocol = tcp
source port = 8080
destination hos IP address = ip address of internal server
destination port = 80
In life, you must either "Push, Pull or Get out of the way!"

superbytes

Apache mod_rewrite and mod_proxy - Need Help!
« Reply #7 on: August 25, 2006, 11:40:22 AM »
Quote from: "pfloor"
Sorry, I stand corrected.

Third command should be:

db domains setprop vpn.foo.com TemplatePath ProxyPassVirtualHosts


Hi Pfloor, I repeated the commands with the proper corrections as provided by you. I'am sorry to say that it is somehow not working.

When I browse to (from a remote site) to http://vpn.foo.com I just get my main site instead of that it is redirecting to a internal server https://host.foo.domain:port.

What am I doing wrong? Do I need to do additional commands after the signal-event domain-create vpn.foo.com?

Offline pfloor

  • *****
  • 889
  • +1/-0
Apache mod_rewrite and mod_proxy - Need Help!
« Reply #8 on: August 25, 2006, 12:42:52 PM »
>> What am I doing wrong?

1-I don't know, I didn't write the code.
2-I don't think the code is complete yet.
3-As Charlie stated above, it may not work on https and it appears he is correct.
In life, you must either "Push, Pull or Get out of the way!"