How To: Run Apache HTTP Server and IIS on Windows Server 2003

By StrangeWork.com: This is the first article in a series of articles I plan to write on setting up a WAMP stack (Windows, Apache, MySQL, PHP) on Windows Server 2003.

I decided to install Apache HTTP Server on my dedicated Windows Server 2003 machine. I thought I would write a detailed article explaining the process for anyone else wanting to accomplish the same task. With just a few minor config changes you can easily have IIS and Apache running alongside each other on the same Windows server.

Step 1: Download Apache Server Win32 Binary (MSI Installer) from http://httpd.apache.org/download.cgi
Step 2: Install Apache with the default settings. Read the Apache Windows Help Documentation for more information.

In order to run IIS and Apache on a single server you need to specify what IP IIS and Apache will listen for port 80 on. You must have two different IP addresses available for use.

Step 3: For Apache: Edit the http.conf file to force Apache to run on a specific IP. Find the below text in your http.conf file. If you left the default install location unchanged the file will be located here:
C:Program FilesApache Software FoundationApache2.2confhttpd.conf

# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 80

Change the line Listen 80 to:
Listen xxx.xxx.xxx.xxx:80

xxx.xxx.xxx.xxx is the private IP address you want Apache to listen on.

Step 4: For IIS: Install the Windows 2003 support tools.
Insert your Windows 2003 CD and open up the file:
SUPPORTTOOLSSUPTOOLS.MSI
This will install additional support tools in “C:Program FilesSupport Tools”

Open up a command prompt (start menu > run > cmd)

At the command prompt, switch to the “C:Program FilesSupport Tools” folder (cd /d c:program filessupport tools)

Type the following command:

httpcfg set iplisten -i xxx.xxx.xxx.xxx

xxx.xxx.xxx.xxx is the private IP address you want IIS to listen on. This must be a different IP from the one used above for Apache.

Restart IIS and Apache for the changes to take affect. You might need to reboot depending on your server settings. Now IIS and Apache will run in harmony on the same Windows 2003 Server!

Troubleshooting Apache
If you run it to problems, the first place to start debugging is in your Apache error.log file. The file is located in your root Apache folder logs directory. The default install location is:
C:Program FilesApache Software FoundationApache2.2logserror.log

Common Errors
An attempt was made to access a socket in a way forbidden by its access permissions. : make_sock: could not bind to address xxx.xxx.xxx.xxx:80

You will receive this error in your error.log if IIS is still listening on the private IP that you set for Apache. If you followed my directions correctly an IIS reset should resolve this problem. If you are still having issues try rebooting your server.

Enjoy this post? Be sure to subscribe to my RSS feed and my WordPress Tips and Tricks Newsletter! Also check out my WordPress books: Professional WordPress Third Edition & Professional WordPress Plugin Development

Comments

  1. Good article. Not wanting to take the time to install all these individualy I’ve used WAMP Server and Zend Core for a few years with much success.

    http://www.en.wampserver.com/
    http://www.zend.com/en/products/core/

  2. hi, Can any body help me please with my apche thing. i install it in my pc, after that i open the cpanel and i clik start for the Mysql and its get started and then i click started for the apche and it doesn’t run can any one please tell me wat is the problem. thank you

  3. hi. I need to have 2 private IP addresses? How can I get them? Thank you very much.

  4. i ve installed wamp server 2 on windows 2003 server. before installed it i remove iis. everyday when i start server machine wamp database which i created was automatically removed. i have clicked both install services(appache and mysql) and i put it online , set to automatically start with widows startup. why auto remove that created database?

  5. Hi dears
    can anyone tell me how to setup the 2 ips step by step with apache and iis

  6. I am new to this . and i have a few questions.
    Is it all that necessary to use IIS? what other application can we use instead of IIS?

  7. Hi Brad, first o all congratulations about your article its very good, and second place I have a question I want to install only the Apache and the IIS its already configured, Do I have to follow only the Apache instructions that you post or another different thing?

    And the last one, I apologize myself because of my English Im a little inexpert

    Thank you for all

  8. Great article! I wrote something with a little more detail on binding both IIS and Apache to IP/ports for those interested.

    http://www.skonet.com/Articles_Archive/How_to_Run_IIS_and_Apache_on_the_Same_Machine.aspx

  9. (1) I have my own rejested domain (www.abc.com)name have Ip –so i want create webserver in my computer, how to manage two ip address …one ip i have alrady which is may domain hold, plz tell me …how to configure.two ip in my case..?……(2).and connect with my domain name,……..and—–(3)……where to store my web page in apache webserver which i install sucessfully and tested.it is ok…….(4).matching ip and domain —-then browse worldwide…..wow to confegure ? plz tell me fast..

  10. Outstanding program Mr. Ferguson has taken a complex subject and made it understandable, even entertaining. Ive watched it twice, and sent a link to my family and friends. Kudos.

  11. Kamran Saeed says:

    Hi Brad! Thank you so much for this article! This is exactly the help i was looking for! All the best and keep up the great work.

  12. Why is needed two IP Addresses? bit confusing what you said use different private address? What does this mean?
    can anyone tell me what are the two private IP address to listen on?

  13. Why we need two IP Addresses to have? bit confusing what you said use different private address? What does this mean?
    can anyone tell me what are the two private IP address to listen on?