Koozali.org: home of the SME Server

ProxyPass - help with subdomain

Offline mchettle

  • 11
  • +0/-0
ProxyPass - help with subdomain
« on: June 08, 2013, 10:10:15 AM »
I would like some help setting up ProxyPass for a subdomain.

I have looked through as many of the previous posts as i can, but the more i look, the more confused i become. I have not found any specific examples on setting a subdomain ProxyPass. (ie:: http://sub.domain.com)
It would also help to get an overview on what the implications are when a ProxyPass is in place. In my case i only want the one subdomain passed to a machine on my internal network, but would like the ftp subdomain (on different ports) to continue pointing to a different machine on the internal network. I would also like the SME server to continue handling the www (iBay) and mail subdomains, and continue to handle the mail for this domain.

I have read that once setup, you can no longer manage the specific domain or subdomains from the GUI interface. What happens to those already in place? In addition can the ProxyPass subdomain still be accessed from the internal network, as it is now.

Thank You for your help.

PS: For what its worth, i noticed during my research discussions about having a GUI interface for this function. I would like to put my 'yes' vote for this feature.

Offline mmccarn

  • *
  • 2,626
  • +10/-0
Re: ProxyPass - help with subdomain
« Reply #1 on: June 08, 2013, 05:51:27 PM »
From http://wiki.contribs.org/SME_Server:Documentation:ProxyPass (assuming your internal host is at 192.168.1.8 )

Code: [Select]
db domains set sub.domain.com domain
db domains setprop sub.domain.com Nameservers internet
db domains setprop sub.domain.com ProxyPassTarget http://192.168.1.8/
db domains setprop sub.domain.com TemplatePath ProxyPassVirtualHosts
signal-event domain-create sub.domain.com

Is there something I'm not understanding?

(PS - the only hitch I reguarly hit doing this is that the trailing "/" in the ProxyPassTarget is important...)

Offline TerryF

  • grumpy old man
  • *
  • 1,821
  • +6/-0
Re: ProxyPass - help with subdomain
« Reply #2 on: June 09, 2013, 01:16:09 AM »
I think the OP may be reading it as I did at first, the wiki needs a small clarification to include the info the settings apply to subdomains as well, it is not apparent at first. If this is the case the OP should raise a bug on the documentation.
--
qui scribit bis legit

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: ProxyPass - help with subdomain
« Reply #3 on: June 09, 2013, 02:30:53 AM »
mchettle

Proxypass is not the right tool for what you are trying to achieve.
Remove the existing proxypass entry, if configured.

Use the Domains panel to configure DNS to resolve locally for the domain in question.
Then use the Hostnames and addresses panel to redirect various services (the subdomain part) eg just configure ftp.domainname to point to wherever.

For safe measure do a reboot after making these changes
« Last Edit: June 09, 2013, 02:32:37 AM by janet »
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline mchettle

  • 11
  • +0/-0
Re: ProxyPass - help with subdomain
« Reply #4 on: June 09, 2013, 03:54:03 AM »
Thank You all very much.

mmccarn :: Thanks for the clarification. What you have proposed is what i thought might be the requirement, but looks more like how one would configure a ProxyPass for a whole domain.

janet :: Thanks, but i will clarify my exact requirements so you understand all i am trying to do.

I currently have the domain (and subdomains) running successfully internally. The 'www.' is pointing to the ibay, 'ftp.' is pointing to the ftp machine (with port forwarding for incoming traffic from the internet), the 'orders.' is pointing to a separate machine running a web based database. The mail services are running on the SME server/Gateway. Basically all i am trying to do is expose only the 'orders.' subdomain for the http:// and https:// services to incoming traffic from the internet. I would like all else to remain the same. This includes leaving all other domains and services i have running on the SME Server/Gateway unaffected.

The other issue that is a little unclear, is :: do i need to remove the currently defined domain from the control panel, or just the SubDomain to which we will apply the ProxyPass. And once a ProxyPass is applied, will i be able to manage the other elements of the domain from the control panel?

Once again, thank you all very much.

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: ProxyPass - help with subdomain
« Reply #5 on: June 09, 2013, 04:23:08 AM »
mchettle

Your description of what you are trying to achieve is not clear, at least not to me, and somewhat ambiguous.

If by "expose", you mean you do not want external public access to certain parts of your site (subdomains as you call them), then configure external DNS records so that those parts of the site are not publicly accessible ie remove the sub domain names from external DNS records.

Anything else configured on your local server will still be accessible as an Intranet from your LAN.

For sure also, we do not know what all the other things are on your server that you want to keep functioning the same as they are now, you have to tell us


Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline mchettle

  • 11
  • +0/-0
Re: ProxyPass - help with subdomain
« Reply #6 on: June 09, 2013, 05:08:46 AM »
Sorry to be ambiguous janet, hopefully the below will help clarify.

The domain i am wanting to put the 'orders.mydomain.com' on is hosted on dyndns.org and has all the required SubDomains defined and working at present. (www. ftp. mail. and orders.)
The 'ftp.mydomain.com' is working for the ftp protocols (ports) using port forwarding of the ftp ports. The mail is being received by my SME Server/Gateway, and 'www.mydomain.com' is being handled by the ibay on the server. All the things i want to happen. What is not happening is that the http:// and https:// requested from anyone on the internet to 'orders.mydomain.com' are not getting to the machine on my internal network, but are being "intercepted" at the gateway, and are going to the ibay website.

What i would like to happen, is that anyone from the internet (and me on my internal network) to get "routed" to the internally located "orders" machine when they put in either http://orders.mydomain.com or https://orders.mydomain.com , and only those two subdomains (at present) to behave this way, without affecting anything else on the server.

Hope this helps. Thanks again.

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: ProxyPass - help with subdomain
« Reply #7 on: June 09, 2013, 06:11:10 AM »
mchettle

OK clear on what you want to happen & what is actually happening.

Less clear on what you have presently done to achieve the above. I think you have a proxypass setup. Please show us the actual configuration settings you are using and what you did to implement this.
Please obtain output ftom the db setting so thee are no errors or assumptions.

I'm also unclear why you are talking about your sme server being in server and gateway mode, but saying you had to forward ports. That should not be necessary in that mode.

I recall a similar report in the forums in recent months re hostname settings (I think) where the site was resolving to the main domain content location instead of where specified in the hostnames panel, so maybe there is a bug & if so you should lodge a bug at bugzilla.
« Last Edit: June 09, 2013, 06:17:15 AM by janet »
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.