简体   繁体   English

在Amazon AWS中部署WAR文件-Tomcat和Apache HTTP Server冲突

[英]Deploying WAR file in Amazon AWS - Tomcat and Apache HTTP Server conflict

I'm using an Amazon Linux AMI instance and I've deployed a war file on it. 我正在使用Amazon Linux AMI实例,并且已在其中部署了war文件。

控制台

The deployed war file shows up in the 'webapps' folder of tomcat6. 部署的war文件显示在tomcat6的'webapps'文件夹中。

The real problem is - Apache HTTP 2.2 server is also installed. 真正的问题是-还安装了Apache HTTP 2.2服务器。

When I access my instance's URL ( http://ec2-107-20-92-32.compute-1.amazonaws.com ), I see the default page of Apache HTTP 2.2 Only, which, if I'm not wrong, works on port number 80. 当我访问实例的URL( http://ec2-107-20-92-32.compute-1.amazonaws.com )时,我看到仅Apache HTTP 2.2的默认页面,如果我没有记错的话,在端口号80上工作。

Now, how do I get my Apache HTTP 2.2 Server communicate with tomcat6 to display the website deployed in Tomcat? 现在,如何让我的Apache HTTP 2.2服务器与tomcat6通信以显示部署在Tomcat中的网站?

Or, are there any other alternatives to it? 或者,还有其他替代方法吗?

(I use MacOS X's terminal to connect to my Instance and I uploaded the WAR on S3 to deploy it in tomcat.) (我使用MacOS X的终端连接到我的实例,并在S3上上传了WAR,以将其部署在tomcat中。)

TIA :) TIA :)

In addition to mac's suggestions (shutting down Apache and making Tomcat listen at port 80, or configuring the Tomcat connector on Apache), you might also set a pair of ProxyPass / ProxyPassReverse directives on your Apache configuration, like the example at mod_proxy documentation . 除了mac的建议(关闭Apache并让Tomcat在端口80上侦听,或者在Apache上配置Tomcat连接器)之外,您还可以在Apache配置上设置一对ProxyPass / ProxyPassReverse指令,例如mod_proxy文档中的示例。

If you decide to follow this suggestion, your rules would look like follows (in the VirtualHost listening at port 80): 如果您决定遵循此建议,则规则如下所示(在VirtualHost侦听端口80的情况):

ProxyPass / http://ec2-107-20-92-32.compute-1.amazonaws.com:8080/
ProxyPassReverse / http://ec2-107-20-92-32.compute-1.amazonaws.com:8080/

Nothing worked. 没事。 I deleted the instance and tried the same with Ubuntu 12.04 64 bit instance, it worked. 我删除了实例,并尝试使用Ubuntu 12.04 64位实例进行了同样的操作,它可以正常工作。 I have no clue why it didnt work in Amazon Linux AMI :( 我不知道为什么它在Amazon Linux AMI中不起作用:(

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

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