如何在localhost:8080而不是tomcat主页中打开Web应用程序例如,我希望mysite.com:8080/mywebapp在mysite.com:8080中打开不使用任何反向代理
http://localhost:8080
时,您的网站将打开将war文件重命名为ROOT.war
,并将其放置在tomcat webapps目录中,然后重新启动tomcat
,或使用反向代理
ROOT.war
Httpd
mod_proxy_http.so
中启用加载mod_proxy.so
和/etc/httpd/conf/httpd.conf
/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>