How do I serve different Ktor modules on different ports? - kotlin

I've got an application that I'm trying to serve different modules (with different application/routings) on different ports.
This is so that I can then restrict port access by different subnets.
Is this possible, and if so, how do I do it?
Alternatively, I can run multiple ktor servers within my application, but was recommended against it due to how ktor optimizes to run in the JVM.
Would love some guidance on this, thanks!

Related

How to configure/create a Load Balancer that handles users that need to be on the same server

I have node.js an application running on several instances under a load balancer.
Each instance is homogeneous (same code running on different servers). Users can be placed on different servers by the load balancer.
The problem is that when 2 users need to interact together, they need to be on the same instance (because they need to communicate together through websockets on the same server). So, I will need to swap the user into another server. I don't know which 2 users are going to interact together, so I don't know before hand which users need to be on the same server.
I haven't seen any configuration in any load balancers to handle this case. I will probably need to create one.
I can also try to use a cache (or any memory accessed by the all the servers), so the users that need to communicate together can do it through the cache, but I'm not sure if that's the best route.
I will appreciate any advice.

How to support multiple environments/DNS in Selenium Grid?

I have a suite of automated tests that run on a Selenium Grid. I have a need now to run these tests in multiple environments (QA, Stage, Production). The environments will be set up using a different DNS server for each one. So a test targeting the QA environment should use the QA DNS, Stage tests should use the Stage DNS, etc.
Ideally, I would like my test suite (which runs in Jenkins and accepts a parameter for which environment to target) to be able to tell the grid to allocate a node, set its DNS servers to (whatever), run the test, then put the DNS servers back the way it found them.
I don't see anything in Selenium's documentation about changing DNS settings on the individual nodes. I also tried looking for browser capabilities that could handle this, but no luck there either. What's the cleanest way to make this happen?
EDIT: The requirement to switch DNS servers is a new one, so there's currently no method in place (manual or automatic) for doing it. Before using this DNS-based method of differentiating environments, we were using environment-specific hostfiles, and switching between them with a custom service that listened on each node for a hostfile-switch request. We might have to create a similar service for switching DNS settings, but I was hoping there was something more "official" than that.
We worked around this issue by setting up a proxy server for each environment, and configuring the proxy servers to use the environment-specific DNS settings. Selenium permits setting a proxy on the individual nodes, so this was a way to programatically modify those settings.

Deploy two versions of the same wcf service

I have created WCF service and its deployed on IIS& under WAS with specific port.binding is the NetTcpBindig.
After we implement another feature to the service and deploy again with separate URL.
but our client wants us to have same URL with two different ports for two different versions of the service.
What is the best option to achieve this task.?
You can host both versions with different ports in IIS. You will have to create two different sites, but I assume you're familiar with that.

How to setup multiple OSQA instances on a Windows server accessible through IIS?

On my Windows server, I will be hosting a few unrelated websites that I would like to add the features of OSQA to. As such, there will be no shared data between the OSQA instances.
Is it possible to have multiple OSQA instances running off the same database (I'm guessing if it's not supported, some db and script tweaking would be required to ID the requesting site), or alternatively (and probably the simplest), having several OSQA instances running on the same box?
I have taken a look at the Bitnami OSQA stack, and this may be the simplest solution. However, this installs Apache, so I wouldn't want multiple instances of Apache running on my box either.
I would also like to be able to access these instances through IIS.
You should be able to install different OSQA instances on the same database server but you will need to create different databases (in that database server) for each instance. Unfortunately currently we BitNami) don't support IIS nor multiple OSQA installations on the same Apache server so you will need to do it manually.

Explain CouchDB's serving of websites, is CouchDB bundled somehow with Apache and how does it work?

I am trying to understand how CouchDB work. Does it come bundled up with separate Apache or does it use the Apache in the system. I am trying to understand how it determines where to serve the site and how are different directions done. This is important information because I am trying to understand how to implement the Apache 2.2 mod-proxy -module here with it. Do I need to tune CouchDB or do I need to tune a separate Apache process? Suppose you have 10 CouchDB processes and you want to direct their results to siteA, how can you do that?
Sorry I am now vague but I am trying to understand how to combine different things from one Site to another, having different authorization-cookies etc. I am having a problem where I have two separates sites hello.com/myCouchDb/ and hallo.de/someOthersite.html working separately. When I merge the codes, the authentication fails -- I think there are at least three different solution candidates:
A) redirect the verification things from the other site to another (a bit hackish) and/or
B) somehow configure the CouchDB Apache -settings, I have tried in Futon but failed.
C) store the authentication cookies to some dir or db and refresh them when they become old (or use never-old cookies)
So how can I merge different CouchDB -instances together with different authentication settings? Suppose you have ten people with different authentication cookies and you want to get them somehow incorporated to the same site. How can you do it? Do you tune network -settings, Apache -settings or CouchDB -settings? Or do you just stores the cookies to some directory or DB that you refresh every time they become old?
P.s. I am the admin so do not worry about the OAuth2.0, I have the authentication-cookies to do whatever I want with the different instances. I just cannot understand how to merge the different instances.
Perhaps related
CouchDB proxy? Apache As a Reverse Proxy?
https://stackoverflow.com/questions/12398389/different-definitions-of-the-term-proxy
What is a proxy? What is it in Apache? Does it have many different meanings?
It sounds like you're confused about the structure of CouchDB. CouchDB is a native JSON Database that has an HTTP API. That API is provided via Mochiweb, an Erlang based webserver that is bundled inside CouchDB. There's only one CouchDB server running, but it runs inside the Erlang Virtual Machine (BEAM) and has a fundamentally different architecture to the typical Apache httpd approach.
Regarding authentication, CouchDB has a per-instance (server) _users database that contains passwords and minimal account details. As an admin you can see this using Futon, although normal users only have access to their own profile. You can assign users into various roles, and then apply those roles and users to each database. Once the _security object is set on a DB, you need to be authenticated to read, and you can use validation update functions to enforce constraints on write. Some brief information on http://blog.couchbase.com/what%E2%80%99s-new-couchdb-10-%E2%80%94-part-4-security%E2%80%99n-stuff-users-authentication-authorisation-and-permissions and http://blog.mattwoodward.com/2012/03/definitive-guide-to-couchdb.html as well as on the wiki.