-->

a2ensite 「confのpath」
LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so
LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so
#強制的にhttps接続へ受け流す。
<VirtualHost *:80>
DocumentRoot /var/www/
ServerName unity-engineer.top
ErrorLog /var/log/apache2/unity-engineer.top.error.log
CustomLog /var/log/apache2/unity-engineer.top.access.log combined
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301]
</VirtualHost>
#https接続でもhttp接続でもこちらを通る。
<VirtualHost *:443>
DocumentRoot /var/www/
ServerName unity-engineer.top
ErrorLog /var/log/apache2/unity-engineer.top.error.log
CustomLog /var/log/apache2/unity-engineer.top.access.log combined
SSLEngine on
SSLProtocol all -SSLv2
SSLCertificateFile 「unity-engineer.top の cert.pem(SSLサーバー証明書)の path」
SSLCertificateKeyFile 「unity-engineer.top の privkey.pem(秘密鍵)の path」
SSLCertificateChainFile 「unity-engineer.top の chain.pem(中間証明書)の path」
ProxyRequests Off
SSLProxyEngine On
ProxyPass / https://unity-engineer.top:「Tomcatのhttpsポート設定」/「Tomcatのwebapps下サイトディレクトリ」
ProxyPassReverse / https://unity-engineer.top:「Tomcatのhttpsポート設定」/「Tomcatのwebapps下サイトディレクトリ」
</VirtualHost>
a2enmod rewrite
sudo service apache2 restart