How would I run two different web servers on the same server?
Solution 1:
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):
listen 192.168.1.100:80
nginx.conf:
server {
# port to listen on. Can also be set to an IP:PORT
listen 192.168.1.110:80;
. . .
Solution 2:
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.
server {
listen 1.2.3.4:80;
server_name apache_domain.com www.apache_domain.com;
location / {
proxy_pass http://1.2.3.4:81/;
proxy_redirect http://1.2.3.4:81/ /;
...
for apache listening on port 81.