简体   繁体   English

是否可以将Apache配置为同时托管ASP.NET Web服务和PHP网站?

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

Noob question (because I'm a noob when it comes to Web development). 新手问题(因为在Web开发方面我是新手)。 I'm not sure whether I should ask it here or at ServerFault. 我不确定该在这里还是在ServerFault询问。

I am developing an ASP.NET Web Service and a PHP Web site consuming the Web Service. 我正在开发一个ASP.NET Web服务和一个使用Web服务的PHP网站。 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 Apache to host both my Web Service and my Web site? 我想知道是否可以配置IIS Apache来承载我的Web服务和网站? Or, do I need to host the PHP site using Apache? 还是我需要使用Apache托管PHP网站?

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.) IIS 7.5 Apache HTTP Server 2.2 (注意:我对Apache没有什么反对。实际上,到目前为止,我比IIS更喜欢它,但是,我宁愿不在同一台计算机上安装两个Web服务器应用程序。)
  • PHP 5.3.4 PHP 5.3.4
  • .NET Framework 2.0 3.0 or 3.5 (whichever comes with Visual Studio 2008) .NET Framework 2.0 3.0或3.5(以Visual Studio 2008附带的形式为准)
  • mod_aspdotnet for Apache 2.2 适用于Apache 2.2的mod_aspdotnet

Apache can not host ASP.net websites. Apache无法托管ASP.net网站。 You will need to install IIS, which also works for PHP. 您将需要安装IIS,它也适用于PHP。 You can get an all-in-one installer from Microsoft here: http://go.microsoft.com/?linkid=9722553 您可以从Microsoft获得多合一安装程序: http : //go.microsoft.com/?linkid=9722553

You can't. 你不能 The best way is to setup apache and IIS on the same machine. 最好的方法是在同一台计算机上设置apache和IIS。 Since it is dev you can just bind Apache to port 8080 or something. 由于它是开发人员,因此您可以将Apache绑定到端口8080之类。 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. 如果需要在单独的IP上使用它们,并且要在端口80上同时运行IIS,则需要确保将IIS更改为不绑定到所有地址。

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. 我的设置与之类似,除了在dev中,我将apache绑定到端口8080,然后在生产环境中,我们同时运行具有IIS和Apache的服务器,其中每台服务器都必须绑定唯一的IP。

For running them on binded ports, same ip (dev) http://blogs.sitepoint.com/2010/07/13/run-apache-iis-same-time-1/ 要在绑定的端口上运行它们,请使用相同的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 为了在绑定到端口80上不同IP的同一台计算机上运行它们: http : //www.monochrome.co.uk/blog/2006/06/20/running-apache-and-iis-6-together-on-the-同一服务器

Apache does not officially support ASP, however, there are ports like Apache::ASP. Apache并不正式支持ASP,但是有类似Apache :: ASP的端口。
Please see the Apache Server FAQ 请参阅Apache服务器常见问题解答

It is possible. 有可能的。 Look at mod_aspdotnet project. 查看mod_aspdotnet项目。

.NET and PHP files will be triggered by extensions and/or directories. .NET和PHP文件将由扩展名和/或目录触发。 Just set them up correctly in your httpd.conf 只需在您的httpd.conf中正确设置它们

However, you will be working with older asp version. 但是,您将使用较早的ASP版本。 If you are on a Windows machine, the best course of action is to set up IIS and PHP. 如果您使用的是Windows计算机,最好的做法是设置IIS和PHP。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM