码迷,mamicode.com
首页 > 编程语言 > 详细

云服务器(uCloud)部署java web项目(七) apacheHTTPS转发到tomctHTTPS

时间:2017-07-20 18:51:40      阅读:190      评论:0      收藏:0      [点我收藏+]

标签:关联   文件   步骤   res   退出   lin   tar   link   tom   

步骤如下:

    (1)cd /etc/apache2/mods-availalbe

             cp rewrite.load ssl.conf  ssl.load /etc/apache2/mods-enabled  (加载rewrite.load ssl.conf  ssl.load)

    (2)vi /etc/apache2/sites-available/default-ssl.conf   (配置apache,添加如下代码:)

           

           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)保存退出:wq

       (4)sudo apache2ctl configtest           (测试,如果现实OK,正面成功,如果出错,可能是关联文件没有加载到mods-enabled,按照步骤(1)加载相应的文件)

       (5)sudo /etc/init.d/apache2 restart    (重启apache)

       (6)输入:https://localhost:443            (如果看到tomcat首页,并且是https,说明配置成功)

 

云服务器(uCloud)部署java web项目(七) apacheHTTPS转发到tomctHTTPS

标签:关联   文件   步骤   res   退出   lin   tar   link   tom   

原文地址:http://www.cnblogs.com/suosui/p/7212548.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!