How to Run Apache and IIS at the Same Time: Part 1By Craig Buckler
Whether you’re a freelancer or an employee, it’s often necessary to work with a diverse range of platforms and applications to get the job done. If you’re a PHP developer, you may become involved with Microsoft SQL Server and Windows hosting. If you’re a .NET developer, you could be asked to write an Apache-based URL rewriting system. Don’t be afraid: embrace the tools and learn from the experience!
It’s not always that easy, of course. It’s best to use a development environment which is similar to your hosting platform so you’ll normally require either Apache HTTP Server or Microsoft Internet Information Server/Services (IIS). But what if you require both?
Do You Require Both Servers?
From a development perspective, IIS and Apache do the same thing. It’s great if you can use a similar set-up to your web host, but it’s not strictly necessary.
If your requirements are relatively modest, I’d suggest running IIS only. It’ll happily run ASP.NET, Classic ASP and PHP on the same installation.
Apache does not (directly) support ASP.NET. You can use Mono, the open source equivalent, and I suspect some clever hackers have found a way to run Microsoft’s ASP.NET on Apache. But is it worth the effort? You’ll almost certainly encounter issues — especially when using Visual Studio.
If you only want to maintain one server on your Windows PC, IIS could be the best solution.
Down on the Development Farm
If you’ve got two or more machines, then it’s straight-forward to install Apache on one PC and IIS on another. Shared folders can be configured so it’s easy to deploy and run files on a remote server.
This is a great solution if you’re working in a team and allows backup facilities to be implemented. However, it’s overkill for one person and will certainly increase your electricity bill.
Valuable Virtual Machines
VM software allows you to create a software-simulated PC inside your PC. I’m a big fan of VirtualBox, although Microsoft Virtual PC and VMware have their good points.
The advantage of a VM is that you can set up any number of server configurations and switch to the one that’s most appropriate. Developers can still access shared folders and backup systems will work just as well as on a real server.
However, VMs add an extra layer of effort and must be configured and maintained. On a single PC, you’ll also need to boot your VM whenever you start coding. That may only take a minute or two, but it’ll soon become tiresome. Finally, VMs are just blocks of data — they’re easy to back up, but they’re fragile. An OS crash, corruption, or file deletion could trash your VM and destroy your work.
If none of these solutions appeal to you, head over to part 2 — it provides two methods for running Apache and IIS on the same Windows PC at the same time.