As others have suggested, running IIS and Apache (and other web servers for that matter) on the same machine works well as long as they are assigned to listen on different ports.
If you are doing this on a public facing site you migth find hassle with some users who are behind very restrictive firewalls that do not allow much other than communication on standard HTTP(S) ports (80 and 443). One way around this issue is to put Apache on the standard port and use mod_proxy
to make IIS serve specific directories. Another is to have both Apache and IIS on non-standard ports and run nginx on port 80 with a config containing something like:
location / {
proxy_pass http://localhost:8000;
proxy_set_header X-Real-IP $remote_addr;
}
location /iis_app1 {
proxy_pass http://localhost:8000/iis_app1;
proxy_set_header X-Real-IP $remote_addr;
}
location /iis_app2 {
proxy_pass http://localhost:8000/iis_app1;
proxy_set_header X-Real-IP $remote_addr;
}
location /apache_app1 {
proxy_pass http://localhost:8001/apache_app1;
proxy_set_header X-Real-IP $remote_addr;
}
location /apache_app2 {
proxy_pass http://localhost:8001/apache_app2;
proxy_set_header X-Real-IP $remote_addr;
}
(the above assuming you have IIS listening on port 8000, Apache listening on port 8001, and IIS is intended to serve the root documents for the server (i.e. what a user gets in response to http://<servername_or_address>/
.)
Using a proxy setup like either of the above means that you don't need to worry about making sure links within or pointing to your sites/applications carry the right port designator as everything is served from the standard port 80.
For personal testing/playing though, this is probably overkill.