如何直接在localhost:8080而不是tomcat主页中打开我的Web应用程序

问题描述 投票:0回答:1

如何在localhost:8080而不是tomcat主页中打开Web应用程序例如,我希望mysite.com:8080/mywebapp在mysite.com:8080中打开不使用任何反向代理

java amazon-web-services tomcat8
1个回答
1
投票
您可以在没有任何反向代理的情况下执行此任务。当您键入http://localhost:8080时,您的网站将打开

将war文件重命名为ROOT.war,并将其放置在tomcat webapps目录中,然后重新启动tomcat

,或使用反向代理

  1. 将您的网站重命名为tomcat webapps目录中的ROOT.war
  2. 安装Httpd
  3. mod_proxy_http.so中启用加载mod_proxy.so/etc/httpd/conf/httpd.conf
  4. /etc/httpd/conf.d/example.conf下添加名为example.config的文件并添加以下配置

<VirtualHost *:8080> ServerName exmple.com ServerAlias *exmple.com ServerAdmin [email protected] ProxyPreserveHost On ProxyRequests off AllowEncodedSlashes NoDecode <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass / http://localhost:8080/mywebapp nocanon ProxyPassReverse / http://localhost:8080/mywebapp LogLevel debug ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>

© www.soinside.com 2019 - 2024. All rights reserved.