Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a Windows 2003 Server running IIS (due to an ASP Site needing to be hosted).

I wanted to add some non ASP sites (HTML, PHP and MySQL) so I was thinking I could just run apache on 8080.

What confuses me a bit is if someone hits DomiainA.com, IIS intercepts it and forwards it to DomainA.com:8080 where apache is running. I could do this by putting a server side javascript re-direct in the IIS www-root for the domain.

What else can I do that might be more proper?

share|improve this question

5 Answers 5

PHP runs under IIS. You're going to need to find a better reason than that to run httpd...

share|improve this answer

Typically this is solved by redirect rules, where the server tells the client the right location (transparent to the user, but he will see the correct URL). In Apache, redirect rules are very easy to employ, globally in the config or locally using .ht* files.

If it is hard to do with IIS, or IIS does not provide an inexpensive (e.g. performance, latency) solution, perhaps you want to run Apache on port 80 and IIS on 8080.

Otherwise, I would not want to maintain two webservers at once if I don't have to. (Sidenote: Apache is superior, so having a seperate IIS to serve ASP actually does make sense)

share|improve this answer

As someone else mentioned, there's no reason you can't run a PHP application under IIS. Having said that, you can configure IIS to only listen on specific IP addresses (by default is will occupy port 80 on every IP on the computer regardless if you have a site configured to use that IP or not). You could then run Apache on the IP address(es) that are not bound to IIS and have both side-by-side without any trouble. I would just run the PHP app within IIS unless there is some compelling reason to use Apache.

share|improve this answer

I also recomend the PHP under IIS option.
Buy if you really need the 2 servers working you can use ISA Server:
http://www.microsoft.com/forefront/edgesecurity/isaserver/en/us/features.aspx?pf=true
It allows you, among other things, to do port forwarding.

share|improve this answer

Don't do your redirects with JavaScript, that would be bad design.

If you want to handle this without a convoluted setup, just run PHP through IIS and skip the second server.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.