Koozali.org: home of the SME Server
		Obsolete Releases => SME Server 7.x => Topic started by: pearless 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:
 
 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:
 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
 ProxyPreserveHost Onand then went
 signal-event remoteaccess-updateHowever, when I try to access http://furryparrot.com I get a 403 error:
 Forbidden
 
 You don't have permission to access / on this server.
 If I go
 db domains show furryparrot.comI get
 furryparrot.com=domain
 Nameservers=internet
 ProxyPassTarget=http:172.22.0.73/
 
 Ideas anyone????
 
- 
				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/
 
 db domains setprop proxypassdomain.com TemplatePath ProxyPassVirtualHosts
 
 
 That should say:
 
 db domains setprop furryparrot.com TemplatePath ProxyPassVirtualHosts
 
- 
				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:
 
 [Mon Aug 08 12:43:10 2011] [error] [client 203.163.71.197] error parsing URL 172.22.0.73/: Malformed URL
 Any ideas?
- 
				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/
- 
				Actually, no it shouldn't. It should say:
 
 http://172.22.0.73/
 
 
 Clearly time for coffee, now works perfectly.  Thanks.