开发者

Is it possible to configure Apache to host both an ASP.NET Web Service and a PHP Web site?

开发者 https://www.devze.com 2023-02-02 10:49 出处:网络
Noob question (because I\'m a noob when it comes to Web development). I\'m not sure whether I should ask it here or at ServerFault.

Noob question (because I'm a noob when it comes to Web development). I'm not sure whether I should ask it here or at ServerFault.

I am developing an ASP.NET Web Service and a PHP Web site consuming the Web Service. They are meant to be run on different machines. However, only for development purposes, I need to run both on my machine. I cannot use virtual machines.

I would like to know if it is possible to configure IIS A开发者_运维知识库pache to host both my Web Service and my Web site? Or, do I need to host the PHP site using Apache?

I am using

  • IIS 7.5 Apache HTTP Server 2.2 (NOTE: I have nothing against Apache. In fact, so far I like it more than IIS, however, I would rather not have two Web server applications installed in the same machine.)
  • PHP 5.3.4
  • .NET Framework 2.0 3.0 or 3.5 (whichever comes with Visual Studio 2008)
  • mod_aspdotnet for Apache 2.2


You can't. The best way is to setup apache and IIS on the same machine. Since it is dev you can just bind Apache to port 8080 or something. If you need them on separate IPs you need to make sure to change IIS to not bind to all addresses if you want to run both on port 80.

My setup is similar except in dev I bind apache to port 8080 and then on production we run servers with both IIS and Apache where unique IPs have to be binded to by each server.

For running them on binded ports, same ip (dev) http://blogs.sitepoint.com/2010/07/13/run-apache-iis-same-time-1/

For running them on same machine binded to different IPs on port 80: http://www.monochrome.co.uk/blog/2006/06/20/running-apache-and-iis-6-together-on-the-same-server


Apache can not host ASP.net websites. You will need to install IIS, which also works for PHP. You can get an all-in-one installer from Microsoft here: http://go.microsoft.com/?linkid=9722553


Apache does not officially support ASP, however, there are ports like Apache::ASP.
Please see the Apache Server FAQ


It is possible. Look at mod_aspdotnet project.

.NET and PHP files will be triggered by extensions and/or directories. Just set them up correctly in your httpd.conf

However, you will be working with older asp version. If you are on a Windows machine, the best course of action is to set up IIS and PHP.

0

精彩评论

暂无评论...
验证码 换一张
取 消