Different databases in different part of vhosts ejabberd - multi-tenant

Is there a way to specify two different databases in different part of vhost??
for example if I run two vhosts on
1) port: 1234
2) port: 5678
then Can I able to change the bosh transport protocol to different ports for different tenants?

No, you cannot have port reserved specifically for some vhosts. Port are shared for vhost.
However, you can have a different databases for different vhost. See ejabberd documentation for reference: http://docs.ejabberd.im/admin/guide/configuration/#virtual-hosting
In the following example, two vhosts are configured to use different database backends:
host_config:
"example1.com":
auth_method: odbc
odbc_type: odbc
odbc_server: "DSN=example1;UID=ejabberd;PWD=ejabberd"
"example2.com":
auth_method: odbc
odbc_type: odbc
odbc_server: "DSN=example2;UID=ejabberd;PWD=ejabberd"

Related

Vagrant: Why forward database ports?

I'm a vagrant newbie trying to configure his first instance. But wherever I look on Vagrantfiles configuring PostgreSQL they're always using port forwarding to the host.
config.vm.network :forwarded_port, host: 5432, guest: 5432
What is the point of forwarding database's port to the host?
Shouldn't the database be operating inside the box?
Or is it just a practice to have better data persistance?
And even if this is desired workflow and everything's forwarded then what is the point of installing the database inside the box after all?
This is mainly so that you can use Graphical Database SQL tools to query your Postgres database from your host machine. Since vagrant is used mainly by programmers and they need to frequently check the database for testing/debugging, this is in place. IDEs like IntelliJ and Eclipse have tools that you use to query databases and they would run on the host machine and thus would need to have access to the database port.
If you don't need to query your database from your host machine and it is only accessed by the guest VM, then you don't need this set.
Shouldn't the database be operating inside the box?
Yes.
Or is it just a practice to have better data persistence?
There is no relation between port forwarding and data persistence.
And even if this is desired workflow and everything's forwarded then what is the point of installing the database inside the box after all?
What is the point of forwarding database's port to the host?
There is no need to always forward port. Port forwarding is only needed when you want to access that port from host machine, e.g. using graphical tools as pointed by blownie55's answer. If you don't need to access the port from host then there is no need to forward it.
And this is true for all kind of port forwarding, not only for database port.
As a side note, there are other ways to access resource inside guest from host, e.g. configuring a private network.

Docker Minecraft Host

I am trying to host Minecraft servers in docker containers on an ec2 instance, and point a different subdomain to each container, for example
a.example.com -> container 1
b.example.com -> container 2
c.example.com -> container 3
...and so on.
If these containers were running a website, I could forward the traffic with Apache, or node-http-proxy, etc. But because these servers are running TCP services, I cannot route the traffic this way.
Is this possible? And if so, how?
The Minecraft client has supported SRV DNS records for a while now (since 1.3.1 according to google). I suggest you assign your Docker containers a stable set of port mapping with the -p flag, and then create SRV records for each FQDN pointing to the same IP but different ports.
Google gives several hits on the SRV entry format - this one is from the main MCF site: http://www.minecraftforum.net/topic/1922138-using-srv-records-to-hide-ports-on-your-server-ip/
I have four MC servers running on the same physical host with a single IP address, each with a separate friendly entry for players to use in the Minecraft client, so none of my users need to remember a port. It did cause confusion for a couple of my more technical players when they had a connectivity issue, tested with dig/ping, then thought the DNS resolution was broken when there was no A record to be found. Overall, I think that's a very small downside.
Doesn't HAProxy http://haproxy.1wt.eu/ route tcp traffic?

Change Localhost to ip with port

I am trying to setup a development server in house. Our IP points to our live server but we have seperate servers set on different ports.
For example our testing server could be on:
external: 97.95.xxx.xxx:1234
internal: 192.168.0.100:1234
We can view the test server by entering either ip in our browsers. We want to change all our development computers to access that server by entering "testserver". We have logged in and edited
C:\Windows\System32\Drivers\etc\hosts
We have added the following line of code to the systems with no success.
97.95.xxx.xxx:1234 testserver
If we remove the port number it will connect to our live system. Is there another system we need to edit to use that port?
when you add the port, your hosts edit is simply wrong.
according to example your hosts entry must look like
97.95.xxx.xxx testserver
and accessing the testsystem would be f.e.
http://testserver:1234
or
telnet testserver 1234
whatever connectiontype / purpose your connection is.
It seems that you cannot set ports in the hosts-file,
but there seems to be a way to forward the port:
port-forwarding-in-windows
src: no ports with hosts serverfault

Mac Mini NAT redirection

My situation is as follow: an application I am working on works using multiple database servers (MySQL) connections, I work locally and these database servers do not allow connections from anywhere, so I have set up a local test server. How do I redirect all the outgoing traffic to these servers (port 3306) to this local server?
As far as I know - even though I never used it yet - you can use the ipfw tool on OSX for similar tasks as you would use iptables for (filtering, address translation etc.). Here you find some more hints: OSX pfctl manpage

can two mysql version can share same port number?

Hi
I have mysql 5.0 and going to install mysql 5.5
Can i use the same port 3306 for the both versions of mysql?
Will it create any problems?
Two services cannot listen on the same IP address and Port concurrently.
You have to either
Change the port number of one of the instances.
Run one instance on a second network interface (i.e. a different IP address).
Do not run them concurrently.
This is not due to any Mysql version restrictions. Its just a port cannot be taken by more than one application to listen on, on the same network address.
Yes you can, on different ip's.
Two running servers cannot share the same port on the same computer.
But if you only ever start exactly one of the servers then it shouldn't be a problem.

Resources