faqts : Computers : Internet : Web Servers : Apache : Installation and Setup

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

308 of 345 people (89%) answered Yes
Recently 10 of 10 people (100%) answered Yes

Entry

How can I run Apache and IIS on the same Windows NT server?

Jul 15th, 2007 14:59
Gael Philippot Huang, Mags Ingval, Anthony Boyd, Garner Fukumitsu,


Basis...
IIS and Apache will default to listening on Port 80 (the http port).
IIS will also listen on all IP by default (even if you specify an ip for
your http service in the IIS managment console).
Apache will listen on the IP (one or more) you specify in httpd.conf
But it's not possible for two apps to share the same port for the same 
IP, which explains your trouble. 
You have two solution to this problem depending the number of IP your
machine are hosting.
-> Only one IP
So, you need to change the port of one of the servers.  One can listen 
on Port 80, the other on Port 8080 (or whatever).
To change IIS to a new port :
- IIS managment console : open the property page for your site (or the
default if you wish to change all the site you are hosting) and switch
"TCP Port" to an other value.
- Web console : I just clicked through the Web-based config screens
until I found the spot for changing the port.  Try it.
Restart all the IIS services
To change Apache to a new port :
open httpd.conf and look for two lines, one is "Listen 80" (or listen
YourIpAdress:80) and the other is "Port 80".  Change them to a different
number, perhaps like this:
Port 8080
Listen 8080
Then save the file and restart the server.  Now you can have Apache 
running and IIS running.  One will run on the default 80 port, so 
http://www.mysite.com/ should work ("mysite" should be the name of your 
site, of course).  The other will run on a different port, and will 
need to be specified, like this:
http://www.mysite.com:8080/
-> More than one IP
1a - If you are running IIS 5.x 
disable the IIS multi address listning (this is the trick :-)
open a console ([start] [execute] cmd )
At a command prompt, switch to the "C:\InetPub\AdminScripts" folder. 
Type the following command: 
CSCRIPT ADSUTIL.VBS SET W3SVC/DisableSocketPooling TRUE 
exit the console
Restart all the IIS process
IIS is now listening only on the IP you wish !!!!!!!
go to step 2
1b - If you are running IIS 6.x 
1st, you need to install the Windows 2K3 support tools.
look in the \SUPPORT\TOOLS directory of your Windows 2k3 CD and run
SUPTOOLS.MSI. It will install additional tools in "C:\Program
Files\Support Tools".
open a console ([start] [execute] cmd )
At a command prompt, switch to the "C:\Program Files\Support Tools" folder. 
Type the following command: 
httpcfg set iplisten -i xxx.xxx.xxx.xxx
where xxx.xxx.xxx.xxx is the IP address you want IIS to listen.
After, type the following command: 
httpcfg query iplisten
to check you settings.
exit the console
Restart all the IIS process (or restart your system, I had to...)
IIS is now listening only on the IP you wish !!!!!!!
go to step 2
2 - specify the IP you wish for your IIS sites
Open IIS managment console
open the property page for each of your sites and set the "IP Adress" 
value.
3 - specify the IP you wish for your Apache
open httpd.conf.
For each of your sites, 
- change the ligne   listen YourIpAdress:80.  
- Change the virtualhost sections (if you have more than one site on
your apache - refere to apache docs)
4 - Restart apache and IIS
You ar now hosting multisite on apache and IIS :-)))
see 
http://support.microsoft.com/?scid=kb%3Ben-us%3B813368&x=12&y=9
and
http://support.microsoft.com/default.aspx?scid=kb;en-us;813368&Product=iis60
for more information on IIS 6.x