NetTalk Central

Author Topic: Multiple sites - one server - part two  (Read 5265 times)

bergsj

  • Jr. Member
  • **
  • Posts: 81
    • MSN Messenger - swjvandenberg@hotmail.com
    • View Profile
    • Email
Multiple sites - one server - part two
« on: January 22, 2009, 11:23:01 PM »
You can bind a NetTalk Webserver to a specific IP-address, but is it also possible to bind NetTalk to host headers? Much like IIS can do?

I think not, because the multiple Nettalk webapps do not know each other so routing is purely based on the IP protocol limitations.

Does anyone have a tip on how to accomplish this?
Greetz,
Sjoerd

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Multiple sites - one server - part two
« Reply #1 on: January 24, 2009, 08:28:17 PM »
Hi Sjoerd,

The good news is that it can be done.
The bad news is that it requires NetTalk 5. Well sort of. If you're in a big hurry for this feature contact me.

At the moment we're using it in a "test" phase to host www.capesoft.com and www.cstimeclocks.com. It's been working for a while so I'm reasonably happy with the technology.

It works by you turning your app into a DLL rather than an Exe. The WebServer and WebHandler procedures are then set as "exported" in the DLL. Nothing else has to be exported.

The "host" is a separate exe to which you can attach (at runtime) your DLL. The Host has a web server in it as well, so you can manage the process remotely via a browser. You can start, and stop sites independently of each other, and you can add new sites without stopping the server.

At this stage you're only allowed 1 secure site though (which effectively means secure sites run on their own port as before.)

Cheers
Bruce


Graham

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Multiple sites - one server - part two
« Reply #2 on: January 25, 2009, 01:15:52 AM »
Hi Sjoerd,

As Bruce indicated, it can be done.

We did something a while back in NT 4.31, slightly different to Bruce's approach but works well.

Have a look at http://www.watchmanager.net/nettalk/index.html

Regards
Graham

Johan de Klerk

  • Full Member
  • ***
  • Posts: 217
  • Johan de Klerk
    • View Profile
    • Designer Software
Re: Multiple sites - one server - part two
« Reply #3 on: January 25, 2009, 11:39:59 PM »
Hi Bruce,

I have been looking into this at one stage and see that you already have it working.

I am very interested in this.

Question:
a) Does this new way do away with the ports (www.xxxxxx.co.za:89)?
b) Does this mean that the user will only put in www.xxxxx.co.za and get to the NT app?
c) If b) is true will I be able to run mixes of the old and new way?

Regards

Johan de Klerk
Clarion 10, NT 11.57

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Multiple sites - one server - part two
« Reply #4 on: January 25, 2009, 11:48:04 PM »
Hi Johan,

Good questions...

>> a) Does this new way do away with the ports (www.xxxxxx.co.za:89)?
>> b) Does this mean that the user will only put in www.xxxxx.co.za and get to the NT app?

At the moment you only need to use the extra port syntax if you have multiple web servers on the same machine, sharing the same IP number. So, for example, if you have Apache or IIS running on port 80, then you can't (easily) run another app on port 80.

[aside: Graham Smith, and others have examples showing how to do this with Apache if that's what you need to run as well.]

[aside: Skype defaults to port 80 as well, but you can change this in your skype settings. ]

Now, currently if you have _more than 1_ NT web app, then at last one of them will be on a port other than 80. Forcing the syntax you described above.

With NT5, the "single server" can serve multiple _non SSL_ sites. So, assuming port 80 is available to this app, then all your sites can be shared on port 80, and hence the user won't need to type in the :89.

>> c) If b) is true will I be able to run mixes of the old and new way?

all the rules still apply. The "single server" owns one port/ip combination. Other programs use other ports etc. So you can still have other programs running on port 89 as before, or any other port. The new "single server" exe does not interfere with other NetTalk web apps, or indeed other apps of any kind, in any way.

Cheers
Bruce

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Multiple sites - one server - part two
« Reply #5 on: January 26, 2009, 12:34:04 AM »
to be clear...

- your current NT4 app converts _very_ easily to the new format. There are 2 or 3 settings to change in the app, that's all. Takes about 30 seconds to do.

- you can continue to build, and test, the app as an EXE, then it gets converted to be a DLL before you deploy.

- You can still deploy as a stand-alone exe if you choose - you don't _have_ to use the single-server.

- multiple apps (DLL's) can be attached to the same Single Server.

 - the single server chooses which dll to use based on the host name. So multiple apps (DLLs) share the same port. The single-server determines which DLL gets the request based on the host name.

Bruce

bergsj

  • Jr. Member
  • **
  • Posts: 81
    • MSN Messenger - swjvandenberg@hotmail.com
    • View Profile
    • Email
Re: Multiple sites - one server - part two
« Reply #6 on: January 26, 2009, 04:43:54 AM »
Bruce,

This is great news!

I look forward to see N5. When will it become available?
What do I have to do when I would like to have this functionality earlier in my current environment?
Greetz,
Sjoerd