在一台 Windows 2003 机器上安装多个 Apache 实例

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/446571/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 17:08:13  来源:igfitidea点击:

Install multiple Apache Instances on a single Windows 2003 machine

apache

提问by Graviton

On my server I have installed a web application that comes with a bundle of Apache Services. Hence all the apache related dlls are located in the application folder's sub directory (e.g., C:\Program Files\MyWebApp\apache2). It seems that when the windows 2003 server is started all the request will be served by that apache services.

在我的服务器上,我安装了一个带有 Apache 服务包的 Web 应用程序。因此,所有与 apache 相关的 dll 都位于应用程序文件夹的子目录中(例如,C:\Program Files\MyWebApp\apache2)。似乎当 Windows 2003 服务器启动时,所有请求都将由该 apache 服务提供服务。

Now I want to install another instances of Apache and MYSQL, PhP to the default Program Folders ( e.g., C:\Program Files\Apache Service Foundation etc), however upon installation I can't configure it-- there is no way to get the second Apache Service up and running.

现在我想将 Apache 和 MYSQL、PhP 的另一个实例安装到默认的程序文件夹(例如,C:\Program Files\Apache Service Foundation 等),但是在安装时我无法配置它——没有办法获得第二个 Apache 服务启动并运行。

When I am installing the second Apache, I set the network domain name to "pm2", and choose the Port 8080 option. However, when apache is finished in installation, when I type in http://pm2:8080, I got a page cannot be displayed error.

我在安装第二个Apache时,将网络域名设置为“pm2”,并选择端口8080选项。但是,当 apache 安装完成后,当我输入http://pm2:8080 时,出现页面无法显示的错误。

Is there anything I miss?

有什么我想念的吗?

回答by Uresu

Does the original site still work ok? If it does, there is a chance that the second installation of apache is trying to install itself as a service with the same name as the first instance and therefore, failing.

原来的网站还能用吗?如果是这样,则 apache 的第二次安装可能会尝试将自身安装为与第一个实例同名的服务,因此失败。

To install apache as a second service use:

要将 apache 安装为第二个服务,请使用:

httpd -k install -n "Apache Instance 2" -f "C:\Program Files\Apache Service Foundation\path\to\your\conf file.conf"

回答by NVRAM

I know this is an old question, but in general you won't need to start a second processof Apache, much less installa second copy of the program. Look through the Apache manuals, specifically at Listenand VirtualHostfor details.

我知道这是一个老问题,但通常您不需要启动Apache的第二个进程,更不用说安装该程序的第二个副本了。查看 Apache 手册,特别是在ListenVirtualHost以了解详细信息。

If there are version conflicts for some requirements on the server sidethen this may not apply to your case, it wasn't clear from your post.

如果服务器端的某些要求存在版本冲突,那么这可能不适用于您的情况,您的帖子中并不清楚。

回答by Pervez Choudhury

A couple of thoughts:

一些想法:

  • Have you added an entry to either your DNS server or hosts file to ensure that PM2 is going to the correct server?
  • Try starting the second Apache instance from the command line, this way you will get error messages displayed on the console so that you can see if there are any errors preventing it from starting properly.
  • 您是否在 DNS 服务器或主机文件中添加了条目以确保 PM2 转到正确的服务器?
  • 尝试从命令行启动第二个 Apache 实例,这样您将在控制台上显示错误消息,以便您可以查看是否有任何错误阻止它正常启动。