Posted on 04 February 2009 by Shane Welldon
I’m currently evaluating Small Business Server 2008 on a machine which I also use for testing websites and learning PHP. With such tight integration of IIS7 to run the SBS services of remote access to Exchange email, SharePoint and even just web-based remote access of machine it makes it impossible to simply stop IIS and replace it with Apache. Instead we need to set them both up to run side-by-side.
At first I told Apache to run on a different port but got tired of appending the port number to the URL every time I needed to access it from my PC.
After some more research I found a way of giving the server a second IP address and running IIS7 on one and Apache on the other, both still on port 80. One caveat to this setup is that to keep outside access to Small Business Server’s remote applications is that external SSL connections on port 443 must remain routed to IIS7.
Add a Second IP Address
- Login to your server’s desktop and click Start –> Control Panel then open Network and Sharing Center and click Manage Network Connections under Tasks in the left panel
- Right-click the machine’s network adapter and click Properties, clicking Continue on the UAC prompt if enabled
- In the list select Internet Protocol Version 4 (TCP/IPv4) and click the Properties button
- In the Properties dialog click the Advanced… button down the bottom-right
- On the IP Settings tab click the Add… button in the IP addresses grouping
- Enter the new IP address of your choice and the required Subnet mask then click Add
- You should now have two IP addresses assigned to your machine. Click OK or close all open dialogs and windows
Bind IIS to a Single IP Address
- Click Start, type “cmd” in the search box then right-click cmd.exe in the Programs list and choose Run as Administrator. Click Continue on the UAC prompt
- In the command prompt type the following:
netsh http show iplisten
The list returned should be empty
- In the command prompt type:
netsh http add iplisten ipaddress=192.168.1.100
Replacing 192.168.1.100 with the existing IP address of your machine
- Type out the show command from step 2 a second time and you should see your IP address in the list
- Reboot the IIS services by typing the following in your open command prompt
It will take a few minutes to completely shutdown and restart IIS
- Once IIS has reset close the command prompt and test both your IPs in a web browser again, this time IIS should only display on a single IP address
Install and Configure Apache
For the installation of Apache you’re on your own. You can either install it from scratch or use one of the combined WAMP packages out there. Personally I use XAMPP as I am quite lazy and no longer have the time to manually install all the required components separately.
Once you have installed Apache, we need to bind it to the second, unused IP address
- Run notepad as an administrator using the method from step 1 above
- In Notepad click File –> Open and navigate to the folder Apache installed in. Within this folder select the ‘conf’ folder then open up the httpd.conf file (NOTE: make sure you have All Files (*.*) selected in the drop-down box at the bottom right otherwise you will not see the files)
- Locate the line
And change it to
Replacing 192.168.1.110 with the second IP you assigned to your machine.
- Save your changes then go to File –> Open and navigate to the ‘extras’ subfolder of the conf folder and open the httpd-ssl.conf file
- Locate the line
And change it to
Again replacing the IP address written here with your own
- Save your changes and start/restart Apache
You should now be able to view IIS on your original IP address and Apache on the new one you added. To get external access to Apache instead of IIS you would simply change the port forwarding rule for port 80 in your router to point to this new IP address instead of the original one.
Make sure that you do not change port forwarding for port 443 though as this will stop all remote access to email and other SBS 2008 services!