Koozali.org: home of the SME Server

more than 1 sme server

Offline umbi

  • ****
  • 100
  • +0/-0
more than 1 sme server
« on: August 28, 2018, 02:28:24 PM »
Hello there

I have an SME Server 9.x (serveronly)  behind a Modem with 1 static address. I forward the needet Ports to my internal sme server with ip 192.168.x.1
in that server i have mailserver and some domains like www.domain.com

now i try to put a new sme server in the same network with ip 192.168.x.2 to serve some other hosts like  ticket.domain.com

in first server i tell the host is reachable on ip 192.168.x.2. but everytime i try to reach ticket.domain.com only the standard startdomain from server 1 is answering me. Can some one pls help me ?

Offline Daniel B.

  • *
  • 1,700
  • +0/-0
    • Firewall Services, la sécurité des réseaux
Re: more than 1 sme server
« Reply #1 on: August 28, 2018, 03:19:56 PM »
Well, of course. HTTP is only one port: 80 (same for HTTPS which is 443). Both are forwarded to 192.168.x.1. You can't have another web server directly reachable on those ports. You could use alternate ports (say, redirect 81 and 444 to 192.168.x.2 and specify it in URL like http://ticket.domain.com:81)
Or you can create a ProxyPass. Everything reaches 192.168.x.1 but for some domains (like ticket.domain.com), 192.168.x.1 proxify the requests to the real backend 192.168.x.2
See https://wiki.contribs.org/SME_Server:Documentation:ProxyPass for more info on how proxypass works
C'est la fin du monde !!! :lol:

Offline umbi

  • ****
  • 100
  • +0/-0
Re: more than 1 sme server
« Reply #2 on: August 28, 2018, 08:46:26 PM »
Salut Daniel

Thank you a lot for the fast answer but im not sure if its the right way for me. In the Server-Manager under Configuration / Host+Domains you can choose a host.domain and then tell where it should be routed. external, local or self. at local host you should can say 192.168.1.2 for ticket.domain.com....  thats the way i try because i wont work with additinal ports on router...

greez
umbee

Offline Daniel B.

  • *
  • 1,700
  • +0/-0
    • Firewall Services, la sécurité des réseaux
Re: more than 1 sme server
« Reply #3 on: August 28, 2018, 09:22:12 PM »
I'm not sure I understand what you mean
C'est la fin du monde !!! :lol:

Offline ReetP

  • *
  • 3,949
  • +6/-0
Re: more than 1 sme server
« Reply #4 on: August 28, 2018, 11:20:56 PM »
Salut Daniel

Thank you a lot for the fast answer but im not sure if its the right way for me. In the Server-Manager under Configuration / Host+Domains you can choose a host.domain and then tell where it should be routed. external, local or self. at local host you should can say 192.168.1.2 for ticket.domain.com....  thats the way i try because i wont work with additinal ports on router...

That doesn't route anything.

It just adds the name to the SME internal DNS database.

Daniel has explained your options.

Use a different port on your router

Get SME to proxy a specific request to another machine

...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline umbi

  • ****
  • 100
  • +0/-0
Re: more than 1 sme server
« Reply #5 on: August 28, 2018, 11:52:30 PM »
Dear ReetP

Thanks a lot, so i will try Proxify and will report my results on Weekend when i have a little more time to test it.

Great forum here with speedy answers  😊



Offline michelandre

  • *
  • 261
  • +0/-0
Re: more than 1 sme server
« Reply #6 on: August 28, 2018, 11:55:56 PM »
Hi umbi,

I would try:

On local ticket.domain.com server:
- In Server Manager, make sure the DNS NameServer is pointing to: Internet servers.

On main server:
- In Server Manager: make sure you have no domain: ticket.domain.com
- At the console:

Code: [Select]
db domains set ticket.domain.com domain
db domains setprop ticket.domain.com Nameservers internet
db domains setprop ticket.domain.com ProxyPassTarget http://192.168.x.2/  ####  (change the x)
db domains setprop ticket.domain.com TemplatePath ProxyPassVirtualHosts
signal-event domain-create ticket.domain.com

db domains show

At the registrar of domain.com:
- Add Cnames (all of them pointing at @):

Code: [Select]
...
ticket.domain.com
http.ticket.domain.com
https.ticket.domain.com
www.ticket.domain.com
...

* The emails from the Internet going to ticket.domain.com will be received by domain.com; the reverse-proxy is only for http. Make sure the users are created on both servers.
** Also, ticket.domain.com will be accesible from the Internet so, check the security.
*** When everything will be working, you can add a Let's Encrypt certificate to ticket.domain.com.
 
Hoping it will help you,

Michel-André

Offline umbi

  • ****
  • 100
  • +0/-0
Re: more than 1 sme server
« Reply #7 on: August 29, 2018, 12:26:53 AM »
Hello Michel-André

Wow havent expected so many helps here (surprised). Thanks to all guys here.

I have allso another idea to not overload the first main sme Server. Instead to proxyforward any hosts, maybe i forward only the mysql to external SME2 or NAS.  That means that the php script and host 'ticket.domain.com' will be on SME main Server and all Mysql requests go to the mysql external server. this is easy to handle and should not overload (lame down) the main SME which should respond fast on the www.

Im not the performance optimize expert but it can be a solution.

What would you do on my place? Proxy Host Forward or source out mysql ?

Offline ReetP

  • *
  • 3,949
  • +6/-0
Re: more than 1 sme server
« Reply #8 on: August 29, 2018, 12:32:39 AM »
Me....

Proxy. Don't directly expose mysql unless you absolutely have too (guess technically you could use a vpn)
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline michelandre

  • *
  • 261
  • +0/-0
Re: more than 1 sme server
« Reply #9 on: August 29, 2018, 12:34:19 AM »
Hi umbi,

I don't think the reverse-proxy will load the main server, it will only pass the requests which is a very small job for it.

KISS is marvelous,

Michel-André

Offline ReetP

  • *
  • 3,949
  • +6/-0
Re: more than 1 sme server
« Reply #10 on: August 29, 2018, 12:36:49 AM »
Hi umbi,

I don't think the reverse-proxy will load the main server, it will only pass the requests which is a very small job for it.
+1

Quote
KISS is marvelous,

+101 :-)
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline umbi

  • ****
  • 100
  • +0/-0
Re: more than 1 sme server
« Reply #11 on: August 29, 2018, 01:09:46 AM »
Hi Michel-André
Hi ReetP

Sure we all want Keep it simple and stupid (KISS).

For hardware freaks with the question "mysql exposition" yes or not, can open the can of pandora😂.

Theoretical an exposed Mysql Server with Gigalan connection to local Network and no other jobs feedet with SSD and big Fastmemory can give bether performance results as a server with hundrets of jobs. You Increase 1 query only with routing the mysql requests to server2.

Can... but must not be 😊.

I think you are the cracks here so i will follow your sugestions to proxyforward.