This problem for a long time, should be the development of code to get the relative path of the project and the absolute path of the problem, but do not change the code with the Apache proxy solution can be implemented? The answer is Yes.
Below is the configuration of Apache proxy tomcat access and HTTPS access
Apache2.2,yum installation of
tomcat7,jdk1.7
Tomcat's server.conf Configuration
Add context to Host
unpackwars= "true" autodeploy= "true" >
<context docbase= "/usr/local/tomcat/apache-tomcat-7.0.70/webapps/test/"
Path= "" reloadable= "true" crosscontext= "true"/>
Save
HTTPD.CONF configuration file, Implementation of HTTP Automatic skip to https, certificate and so on is not introduced.
<virtualhost *:80>
ServerName localhost
Proxyvia OFF
Proxyrequests OFF
<ifmodule mod_rewrite.c>
Rewriteengine on
rewritecond%{server_port} 80
Rewriterule ^.*$ https://%{server_name}%{request_uri} [r=301,l]
</IfModule>
</VirtualHost>
ssl.conf configuration file main section, URL jump to tomcat service, 9090/after No addition to the project, Because the docbase in the server.conf file already has test set, the default access to Tomcat's 9090 port is to access test, so Apache jumps directly to the root/on the LINE.
Proxyrequests OFF
<proxy *>
Options MultiViews
Order Deny,allow
Allow from all
</Proxy>
proxypass/http://172.26.124.219:9090/
proxypassreverse/http://172.26.124.219:9090/
</VirtualHost>
This is the browser input/http/domain name
directly on it. Have accumulated experience, hope to help .....
This article is from the "11617433" blog, please be sure to keep this source http://11627433.blog.51cto.com/11617433/1942040
Apache agent Tomcat could not load css,js, pictures and other resources to solve the method