• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 500
  • Last Modified:

Apache and IIS on same server

Can Apache be run on the same Windows Server as IIS, as I might want to test php files on Apache and asp on IIS?
0
ncw
Asked:
ncw
2 Solutions
 
KerryGCommented:
Certainly it can but they both cant run on the same port. So where IIS may be on port 80 you may need to set Apache on Port 8000. Or you can just run PHP scripts in IIS, its not that hard to configure.
0
 
humeniukCommented:
PHP runs well with IIS, so if that's your primary concern, you can go that route.  The two servers cannot listen to the same port on the same IP, so you can configure them to use different ports as KerryG suggested or you can use two IP addresses and bind IIS to one and Apache to the other.

This is how to do either (from www.faqts.com/knowledge_base/view.phtml/aid/9400):

"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

Follow these steps
1 - 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 !!!!!!!

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 "
0
 
ncwAuthor Commented:
Thank you
0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now