I know that you can't listen to the same port and IP using two different server processes, but apparently this is possible if you allocate a separate IP address to each. Is this the case? I'm contemplating running both ningx and Apache on the same server (I also welcome feedback on whether this is a good idea), basically because ideally I'd like to try switching over to nginx but supposedly its Tomcat support isn't great, so I'm thinking I'd need to keep apache around for that.
Has anyone done something similar; is it recommended, and how do you go about it?
Both apache and nginx take arguments for which addresses to listen on; if you want apache on 192.168.1.100 and nginx on 192.168.1.110, you would add the following to the respective conf files:
httpd.conf (or /etc/apache/ports.conf, depending on distro):
nginx.conf:
Yes, with 2 IP addresses you could have nginx and apache both listen on port 80. Alternatively you could configure apache to listed on the same IP address but on a different port and have nginx proxy requests to apache for the apache domains.
for apache listening on port 81.