0

Okay, let me be very clear and specific. I am working on VirtualBox VM : CentOS7 64bit.
I am using NAT Network for VM and also enabled four network adapters. VM has 4 different static IPs.
Lets say..

192.168.x.a
192.168.x.b
192.168.x.c
192.168.x.d

But has single domain name bound with 192.168.x.a with 'A' record.

I am planning to install 4 different servers on same VM. i.e. FreeIPA server, Zimbra Mail server, Mono Server, Oracle Database server.

NOTE: These servers runs as desired on separate VMs. But I'm unable to collaborate them together.

I am stumped on port conflicts. I think, I have 2 options...

1) Either, I need to know how to tell a service to use ports from particular IP while installing it. (both Zimbra and FreeIPA check for ports while installation; Error occurs if port are being used by previously installed server.)

2) Or changing iptables and config files for installed service, so ports which are occupied before will now be opened for new service to be installed (servers like Zimbra and FreeIPA has default setting in config files and they are complex. If I do some change, I'm afraid of messing the whole system). If I do this; I can run any numbers of servers on a single IP by changing ports for every service. But, there is no clue for doing it after searching a lot.


I am in search for solution since many days, and you guys are only my hope. I am afraid of someone mark this as illogical question. Because, I did not mentioned version of Servers and their config file settings as well as my network file settings. I skipped them to make it focused on IP and ports per service issue.

P.S.: Docker can be useful but I found I should use Docker right now! topic on this link.
Seems like using Docker can be another mess for me.
So, Consider any services of your choice and they all should be given desired ports as per requirement on one condition. Only one IP is allowed per service. (But how?)

3
  • 1
    I don't understand your setup right now. Is the CentOS your host OS or is it a guest and you're trying to setup all those services on one single VM? Separate them into different VMs and give each VM its own NIC. You won't be able to have each of them use the same port forward on the host you will have to to map them (Host => Guest) like this 80 => A:80, 81 => B:80, 82 => 80 etc. as always a diagram that is attached to this post could really help.
    – Seth
    Oct 17, 2016 at 11:47
  • Sorry.. I should have mentioned that base OS is Windows server 2008 R2. And yes, CentOS is VM and I am trying to setup all services on that VM. because, soon I'll remove Win Server 2008 and make CentOS as Host OS. I already said that all servers work fine in different VMs. Now i need to run them on CentOS base OS in near future. Thanks for suggesting diagrams. Oct 18, 2016 at 6:26
  • Altough similar to Docker, I’d recommend taking a look at LXC. It’s usually used to run an entire Linux distribution in a container. It has a big advantage: You can use the container just like a real PC, with very few exceptions.
    – Daniel B
    Oct 18, 2016 at 7:12

1 Answer 1

0

If you want to run all of those services on a single machine you will have to delve into the configurations of those applications and configure them accordingly. Otherwise there are some workarounds available but it's usually better to properly configure those services.

To figure out how to change the configuration of the services you will have to check the official documentation or contact the vendor. Another alternative would be to run those services encapsulated into "something". So either a VM or a Container like Docker could work. As you said Docker might be way harder to implement in this scenario. As CentOs doesn't have any associated licensing fees it could be worth to checkout whenever a virtualization solution could help you out if you're uncomfortable reconfigureing the applications. On the other hand it's a bad idea to be afraid of it as it sounds like you're uncomfortable learning about the applicaitons you're running.

6
  • I want to learn about them.. I just don't want to mess up with all system. and make them useless.. I will try reconfigure them.. thanks. Oct 18, 2016 at 7:01
  • The port thing is a lie. If you bind a socket to a specific IP address, it will only 'reserve' the port on that IP address. Oct 18, 2016 at 7:14
  • @grawity And how to do it exactly? Oct 18, 2016 at 7:23
  • Usually by configuring the application. If an application doesn't support binding to a specific IP/Interface you will have to use some workarounds. I wouldn't be sure that you'd get support if you use those.
    – Seth
    Oct 18, 2016 at 7:28
  • Thanks for calling it a lie @grawity as a lie is deliberate it's surely not possible that I just didn't know better.
    – Seth
    Oct 18, 2016 at 8:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .