我想从一个ec2实例托管多个战争和多个wordpress应用程序。我设法承载了多个战争或多个wordpress应用程序,但不是两个。用例可能是这样的:
申请www.tomcatA.com应该由tomcat交给A.war
申请www.tomcatB.com应该由tomcat交给B.war
申请www.ApacheA.com应由apache提交,申请A
申请www.ApacheB.com应由apache提交,申请B
我设法为tomcat或apache创建虚拟主机。但是我怎么能为apache和tomcat做这个呢?
答案 0 :(得分:0)
据推测,您可以代理tomcat应用程序,并为apache应用程序提供不同的DocumentRoot
。类似于以下内容:
<VirtualHost *:80>
ServerName www.tomcata.com
ProxyPass / http://localhost:8080/A
</VirtualHost>
<VirtualHost *:80>
ServerName www.tomcatb.com
ProxyPass / http://localhost:8080/B
</VirtualHost>
<VirtualHost *:80>
ServerName www.apachea.com
DocumentRoot /applicationA
</VirtualHost>
<VirtualHost *:80>
ServerName www.apacheb.com
DocumentRoot /applicationB
</VirtualHost>