The steps are as follows:
(1) Cd/etc/apache2/mods-availalbe
CP rewrite.load ssl.conf ssl.load/etc/apache2/mods-enabled (load rewrite.load ssl.conf ssl.load)
(2) vi/etc/apache2/sites-available/default-ssl.conf (Configure Apache, add the following code:)
Sslproxyengine on
Sslproxyverify None
SSLPROXYCHECKPEERCN off
Sslproxycheckpeername off
Sslproxycheckpeerexpire off
Requestheader set Front-end-https "on"
Proxyvia on
Proxypreservehost on
Proxyrequests OFF
proxypass/https://127.0.0.1:8443/
proxypassreverse/https://127.0.0.1:8443/
<proxy *>
Order Deny,allow
Allow from all
</Proxy>
<location/>
Require all granted
</Location>
Rewriteengine on
Options +followsymlinks
Rewritecond%{server_port}!^8443$
Rewritecond%{http_host}!^www\. [NC]
Rewriterule ^ (. *) $ https://www.%{http_host}$1 [l,r=301]
(3) Save exit: Wq
(4) sudo apache2ctl configtest (test, if the reality OK, positive success, if error, may be associated file is not loaded into mods-enabled, follow step (1) load the corresponding file)
(5) sudo/etc/init.d/apache2 restart (restart Apache)
(6) Input: https://localhost:443 (if you see the Tomcat home page and HTTPS, the configuration is successful)
Cloud Server (Ucloud) Deployment Java Web Project (vii) APACHEHTTPS forwarding to Tomcthttps