Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I want to run multiple application servers on different ports on a single AWS instance with a different IP/domain pointing to each port.

I don't have a clue how to accomplish this. I don't know if there is a way to forward IPs to ports or what.

share|improve this question
1  
Which applications are you running? Are you talking about web apps or what? You can of course have multiple domains pointing and the same server and then for example in Apache map those domains to specific things. But without further information about which servers you want to run, it is impossible to give help. –  Jan Wikholm Jul 24 '13 at 5:09

1 Answer 1

up vote 1 down vote accepted

It is trivial. When you have an AWS instance, you basically have a server. You might or might not have multiple IPs assigned to an interface (in this case it sounds like you do). So, there isn't really a need for an AWS-specific way to do this; the general way is sufficient.

Services bind listening sockets to an IP address, protocol, and port combination. It is possible to not specify the IP address (by specifying 0.0.0.0, UNSPEC), thereby listening on all IPs for the given protocol and port. This is the usual case. However, you can tell your service to listen on only one particular IP (or set of IPs) if you like. The way to do this depends on your application, but there is generally some configuration option for this.

In addition, depending on what your application is, you might be able to do other things too. For instance, apache supports binding virtual hosts to particular IP addresses and ports (this is IP-based virtual hosting, in contrast to name-based virtual hosting).

share|improve this answer
    
Completely forgot about that configuration. All the time they say to let them bind at all IP's that I forgot you CAN bind to just one. THANKS! –  LordZardeck Jul 24 '13 at 14:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.