# Apache und IIS 7 auf derselben Maschine

**URL:** <https://entwicklergate.de/t/apache-und-iis-7-auf-derselben-maschine/537>\
**Category:** Administration\
**Tags:** windows-server, apache, iis\
**Created:** [7. April 2023 um 07:06 UTC](https://entwicklergate.de/t/apache-und-iis-7-auf-derselben-maschine/537 "2023-04-07T07:06:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![UweKeim](https://entwicklergate.de/user_avatar/entwicklergate.de/uwekeim/32/432_2.png) [@UweKeim](https://entwicklergate.de/u/UweKeim)\
**Post date:** [7. April 2023 um 07:06 UTC](https://entwicklergate.de/t/apache-und-iis-7-auf-derselben-maschine/537/1 "2023-04-07T07:06:16Z")

</div>

### IIS nur noch auf eine IP-Adresse lauschen lassen

[Hier gibt es eine kleine Anleitung](https://web.archive.org/web/20170902011012/http://iislogs.com/steveschofield/2007/07/07/iis7-post-44-iis7-and-apache-on-the-same-machine/). Auszüge:

> There was a question on [http://forums.iis.net](http://forums.iis.net/) about having Apache and IIS7 on the same box. here are the instructions I tested on Vista RTM and Windows Server 2008 B3. This assumes you have two IP addresses on the box, 192.168.0.90 and 192.168.0.91. It can be any IP addresses.
> 
> 1. Added or make sure your machine has two IP addresses
> 2. Open a command prompt
> 3. Type **netsh**
> 4. Type **http**
> 5. Type **sho iplisten. It should be blank**
> 6. Type **add iplisten ipaddress=192.168.0.90**  
> _You should get IP address successfully added_
> 7. Type **sho iplisten again**  
> It should **sho 192.168.0.90 in the list**
> 8. Type **exit** to get out of netsh
> 9. Type type **netstat -an**. See if you notice **192.168.0.90:80** in the list. If you see 0.0.0.0:80, do an iisreset
> 10. [Download](https://www.apachelounge.com/download/) and install Apache
> 11. Do a default install
> 12. Open httpd.conf and adjust the ip listen to 192.168.0.91:80
> 
> > Listen: Allows you to bind Apache to specific IP addresses and/or  
> > ports, instead of the default. See also the `<VirtualHost>`  
> > directive.
> > 
> > Change this to Listen on specific IP addresses as shown below to  
> > prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
> > 
> > Listen 12.34.56.78:80  
> > Was 80  
> > Change to
> > 
> > Listen 192.168.0.91:80
> 
> 13. Restart the Apache service. (for some reason the start / stop thing didn’t work for me, I used net stop apache2 net start apache2.)
> 14. Type netstat -an
> 15. You should see **192.168.0.90:80** and **192.168.0.91:80**. Open a browser and test both IP’s to see if IIS7 and Apache come up.
> 16. Test restarting Apache service to see if it works after that.
> 17. Turn off Apache, browse IIS, turn of IIS, browse Apache. Test it every which way to see if it works.

([Link-Quelle](https://stackoverflow.com/a/5958007/107625))

Geht übrigens auch mit mehreren IP-Adressen für den IIS. Dann einfach mehrfach das „_add iplisten ipaddress=…_“ aufrufen. Geschickt, wenn z. B. mehrere SSL-Websites auf dem IIS installiert werden sollen.

### Firewall-Regel erstellen

Wichtig ist auch, auf der Server-lokalen **Firewall** auf dem Windows-Server, eine **eingehende Regel für Apache** einzurichten.

Bei mir sah die Regel grob so aus:

- Name: Apache HTTP Server
- Enabled: Ja
- Action: Allow the connection
- Program: %ProgramFiles%\Apache24\bin\httpd.exe
- Profiles: Domain, Private, Public

Es ist also eine Regel auf ein Programm, nämlich „httpd.exe“, das in allen Profilen aktiv ist. Extra Ports habe ich nicht angegeben.

### Service verzögert starten lassen

Nachdem Apache mit folgendem Befehl als Dienst installiert wurde…

```cmd
httpd.exe -k install -n "Apache HTTP Server"

```

…war es weiterhin wichtig, dass der Apache-Dienst als **Starttyp „Automatisch (Verzögerter Start)“** eingerichtet hat. Ansonsten kam es bei mir vor, dass der IIS seine Sites deaktiviert hatte, und auch Apache nicht lief. Keine Ahnung, ob das Korrelation oder Kausalität war.
