Iis – How to make Windows Server start the Apache service after the IIS service

iistomcatwindows-service

I have both Apache and IIS on a Windows Server 2k3. The Apache server is reached by tunneling through IIS using the Apache Tomcat Redirector

Everything works just fine until I reboot. When I do apparently the Apache Tomcat 6 service starts before the World Wide Web Publishing (W3SVC) service. Manually stopping and restarting the Apache Tomcat service fixes the problem, but I don't want to have to continue to do it manually every time I reboot.

How can I get Windows to start Apache after IIS?

Best Answer

Change the Apache service to be dependant on W3SVC. From an elevated command prompt:

sc config ApacheServiceName depend= W3SVC

Note the space after the equals next to "depend". It needs to be there. Replace ApacheServiceName with the service name (not the display name) of your apache service.