Koozali.org: home of the SME Server

redirecting a url to another sme server

Offline pearless

  • *
  • 38
  • +0/-0
redirecting a url to another sme server
« on: August 07, 2011, 11:18:08 AM »
I have yet to find this in the documentation, or contibs, but I have two SME servers behind a firewall, both act as servers only.

One is a production server (SMEServ v7.2), the other my test server (v8).

The firewall can only direct a port (80) to a single server (production) and has no ability to direct to a server based on the URL.

What I am trying to do is for a given domain that I host, I want to be able to re-direct the traffic from my production to my test server, and later restore it back to my production server.

This may well be a simple problem, but maybe it is a lack of coffee, I am a bit stuck for a simple solution.

Cheers Douglas

UPDATE: As typically happens, not sooner have I posted then I find the docuemtation for ProxyPass http://wiki.contribs.org/SME_Server:Documentation:FAQ#Proxy_Pass which seems to fit the bill.

Well I have tried this:

Code: [Select]
db domains set furryparrot.com domain
db domains setprop furryparrot.com Nameservers internet
db domains setprop furryparrot.com ProxyPassTarget http:172.22.0.73
db domains setprop proxypassdomain.com TemplatePath ProxyPassVirtualHosts
signal-event domain-create furryparrot.com

and then I went:
Code: [Select]
cd /etc/e-smith/templates-custom/etc/
mkdir httpd
cd httpd/
mkdir conf
cd conf
mkdir httpd.conf
cd httpd.conf/
mkdir ProxyPassVirtualHosts
cd ProxyPassVirtualHosts/
cp /etc/e-smith/templates/etc/httpd/conf/httpd.conf/ProxyPassVirtualHosts/26RewriteTraceAndTrack /etc/e-smith/templatescustom/etc/httpd/conf/httpd.conf/ProxyPassVirtualHosts/
nano 26RewriteTraceAndTrack
and added
Code: [Select]
ProxyPreserveHost Onand then went
Code: [Select]
signal-event remoteaccess-updateHowever, when I try to access http://furryparrot.com I get a 403 error:
Code: [Select]
Forbidden

You don't have permission to access / on this server.

If I go
Code: [Select]
db domains show furryparrot.comI get
Code: [Select]
furryparrot.com=domain
    Nameservers=internet
    ProxyPassTarget=http:172.22.0.73/

Ideas anyone????
« Last Edit: August 07, 2011, 01:03:18 PM by pearless »

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: redirecting a url to another sme server
« Reply #1 on: August 08, 2011, 01:20:31 AM »
Well I have tried this:

db domains set furryparrot.com domain
db domains setprop furryparrot.com Nameservers internet
db domains setprop furryparrot.com ProxyPassTarget http:172.22.0.73

That should say:

db domains setprop furryparrot.com ProxyPassTarget http:/172.22.0.73/

Quote
db domains setprop proxypassdomain.com TemplatePath ProxyPassVirtualHosts

That should say:

db domains setprop furryparrot.com TemplatePath ProxyPassVirtualHosts

Offline pearless

  • *
  • 38
  • +0/-0
Re: redirecting a url to another sme server
« Reply #2 on: August 08, 2011, 02:53:16 AM »
That should say:

db domains setprop furryparrot.com ProxyPassTarget http:/172.22.0.73/

That should say:

db domains setprop furryparrot.com TemplatePath ProxyPassVirtualHosts

Thanks  :-P clearly I didn't have enough coffee to miss something as obvious as that!

Now I get in the httpd error log:

Code: [Select]
[Mon Aug 08 12:43:10 2011] [error] [client 203.163.71.197] error parsing URL 172.22.0.73/: Malformed URL
Any ideas?
« Last Edit: August 08, 2011, 03:08:26 AM by pearless »

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: redirecting a url to another sme server
« Reply #3 on: August 08, 2011, 03:49:23 AM »
That should say:

db domains setprop furryparrot.com ProxyPassTarget http:/172.22.0.73/

Actually, no it shouldn't. It should say:

http://172.22.0.73/

Offline pearless

  • *
  • 38
  • +0/-0
Re: redirecting a url to another sme server
« Reply #4 on: August 08, 2011, 11:15:56 AM »
Actually, no it shouldn't. It should say:

http://172.22.0.73/

Clearly time for coffee, now works perfectly.  Thanks.