Nov 21, 2012

0 IIS + Apache

How to unbind IIS from all IPs and include only the ones you need: LINK








Extract the httpcfg.exe utility from the support tools area on the Win2003 CD.

  • stop all IIS services: net stop http /y
  • have IIS listen only on the IP address I’d designated for IIS:
  • httpcfg set iplisten -i 192.168.1.253
  • make sure: httpcfg query iplisten (the ip listed are only ip addresses IIS will be listening)
  • restart IIS Services: net start w3svc
  • start Apache service



To add an IP address to the IP inclusion list
1.    Click Start, and then click Run.
2.    Type cmd, and then click OK to open a command prompt.
3.    Type the following, where xxx.xxx.x.x is the IP address you want to add:
httpcfg set iplisten -i xxx.xxx.x.x
When this succeeds, Httpcfg returns the following:
HttpSetServiceConfiguration completed with 0

To view additional status codes, see the Httpcfg help.
4.    After the IP address is added, use the following command to list it:
httpcfg query iplisten
Httpcfg returns the following:
IP :xxx.xxx.x.x
5.    From the command prompt, stop the HTTP service and its dependent services. To do this, type the following string at the command prompt:
net stop http /y
6.    From the command prompt, restart the HTTP service and it dependent services. To do this, type the following string at the command prompt:
net start w3svc
Note When you start w3svc, all services that were stopped when HTTP was stopped will start.


Way Nr.2


For people who have NIC 
Add 192.168.0.2 to your IP adresses section 
Simply add your hosts file these lines 
(c:\windows\system32\drivers\etc\hosts) 
192.168.0.1 iishost [webpage1.com]
192.168.0.2 apachehost [webpage2.com]

Change your IIS config web site: 

/ ip adresses / advanced web site identification 
IP Address: 192.168.0.1 
TCP Port: 80 
Host Header Name: iishost [webpage1.com]
Add/modify these lines at your Apache config file by default 
(C:\Program Files\Apache Group\Apache\conf\httpd.conf) 

Listen 192.168.0.2:80 ServerName apachehost [webpage2.com]


NameVirtualHost apachehost [webpage2.com]


[webpage2.com]

ServerAdmin webmaster@apachehost 
DocumentRoot "C:/whereisyourrootdirectory/" 
ServerName apachehost [webpage2.com] 
ErrorLog logs/dummy-error 
CustomLog logs/dummy-host.example.com-access_log common 



Update : Nicely written article about the same problem : LINK