一起艳学3步把tomcat配置https(小程序)

news/2024/7/20 2:58:29 标签: tomcat, 程序开发, 阿里云, 小程序, https配置

这里写图片描述

前言:最近小程序开发挺火的,然后小编也研究一下,发现不对劲,开发可以用http,但上线要https,于是想弄个https玩玩,结果怎么配还是失败,于是请教了一个大神,他说3步就可以拿下。。。

1、 阿里云把配置文件下载下来放到tomcat根目录下的cert文件夹中

2、 server.xml配置三个

<Connector port="8081" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="443" URIEncoding="utf8" />


这个是从阿里云复制下来 改port,protocol
<Connector port="443"
    protocol="org.apache.coyote.http11.Http11Protocol"
    SSLEnabled="true"
    scheme="https"
    secure="true"
    keystoreFile="cert/00xx.pfx"
    keystoreType="PKCS12"
    keystorePass="00xx"
    clientAuth="false"
    SSLProtocol="TLSv1+TLSv1.1+TLSv1.2"
    ciphers="TLS_RSA_WIT。。。。。。。。C_SHA256"/>



<Connector port="8019" protocol="AJP/1.3" redirectPort="443" />

3、 web.xml配置一个,重启tomcat

<login-config>
        <auth-method>CLIENT-CERT</auth-method>
        <realm-name>Client Cert Users-only Area</realm-name>
    </login-config>
    <security-constraint>
        <web-resource-collection >
            <web-resource-name >SSL</web-resource-name>
            <url-pattern>/*</url-pattern>
        </web-resource-collection>
        <user-data-constraint>
            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
        </user-data-constraint>
    </security-constraint>

是不是很简单捏。。。

一起艳学小程序开发
1、简易教程:https://mp.weixin.qq.com/debug/wxadoc/dev/index.html
微信小程序 H5 功能 LOL英雄联盟
wxml html 骨架 英雄
wxss css 样式 皮肤
js js 逻辑 技能
json json 配置 符文/天赋

#首先要注册页面,小程序由哪些页面组成
app.json
"pages":[
    "pages/index/index",
    "pages/logs/logs",
    "pages/question/question",
    "pages/info/info",
    "pages/report/report"
  ],

#跳转页面
bindtap='onTap'

Page({
  onTap:function(event){
    wx.redirectTo({
      url: '../question/question'
    })
  }
});


#banner图
<swiper indicator-dots='true' autoplay='true' interval='5000'>
    <swiper-item>
      <image src='/images/index_banner.jpg'></image>
    </swiper-item>
    <swiper-item>1</swiper-item>
    <swiper-item>2</swiper-item>
  </swiper>

#循环遍历
 <block wx:for="{{posts_container}}" wx:for-item="item"></block>

this.setData({
      posts_container: postData.postList
    });


#数据绑定
var post_content = [{
  date: "Sep 184 2016",
  title: "dsa",
  post_img: "/images/index_banner.jpg",
  view_num: "121",
  collect_num: "86",
  auth_img: "/images/index_banner.jpg"
}, {
  date: "Sep 185 2016",
  title: "dsa",
  post_img: "/images/index_banner.jpg",
  view_num: "121",
  collect_num: "86",
  auth_img: "/images/index_banner.jpg"
}]

module.exports = {
  postList: post_content
}
var postData = require('../../data/data.js');

#shuju get
bindViewTap : function(){
    //console.log("111")
    wx.request({
      url: 'http://localhost:8080/index/wxProgram/index.do', //仅为示例,并非真实的接口地址
      data: {
        value: 'wo shi weixin'
      },
      header: {
        'content-type': 'application/json' // 默认值
      },
      success: function (res) {
        //console.log(res.data)
if(res.data.success){
          var arr = JSON.parse(res.data.result);
          for(var i in arr){
            console.log(arr[i]);
          }
        } 
      }
    })

  },

#id页面js传值
<view catchtap=“onPostTap” data-postId="item.postId"></view>

js中
onPostTap:function(event){
var postId = event.currentTarget.dataset.postid;
wx.navigateTo({
url:"post-detail/post-detail?id="+postId
});
}

另一个js 
Page({
onLoad:function(option){
var postId = option.id;

}
})

源码下载:链接:http://pan.baidu.com/s/1boKg5X1 密码:32vi


http://www.niftyadmin.cn/n/785513.html

相关文章

Gitlab添加sshkey

1.ssh-keygen -t rsa -C "your.emailexample.com" -b 4096 一路回车 2.cat ~/.ssh/id_rsa.pub 拷贝key内容&#xff0c;不留空格到网页端Add key 3.可以正常从远程仓库pull代码转载于:https://www.cnblogs.com/JazzerDaxian/p/7463653.html

L1011 A-B

L1-011. A-B 时间限制 100 ms内存限制 65536 kB代码长度限制 8000 B判题程序 Standard 作者 陈越本题要求你计算A-B。不过麻烦的是&#xff0c;A和B都是字符串 —— 即从字符串A中把字符串B所包含的字符全删掉&#xff0c;剩下的字符组成的就是字符串A-B。 输入格式&#xff1a…

高数一上册常用公式

不定积分公式&#xff1a; 泰勒展示&#xff1a;

hyper-v网络连接

win10 虚机 linux 1 具体安装步骤就不说了&#xff0c;此篇只说网络配置&#xff0c;上图说看这是都安装完成后 2 现在说网络配置&#xff0c; &#xff08;交换机配置&#xff09; 1、必须要建立虚拟交换机否则虚机之间和物理主机无法通信&#xff0c;并且&#xff0c;”红框处…

学习数据挖掘决策树ID3算法

一个月前的C语言程序设计课上学习了决策树ID3算法 然后自己用了两个多星期的时间开始用C语言实现&#xff0c;结果由于过程太过于复杂&#xff0c;写出来的东西就跟屎一样。 可能是自己对于这个算法理解的不够深刻&#xff0c;或者是在设计的时候没有构思好。 所以决定在这里写…

一起艳学java多线程(一)

/*** 需求&#xff1a;10人开通艳辉vip&#xff0c;但开通方法是加QQ&#xff0c;这里我开通2个QQ&#xff0c;* 同时能开通vip的只能有2个人&#xff0c;其他8个人只能等其中一个人开通完vip后才可以占用。。。* author colorbin* 创建时间: 2017年11月12日 下午5:26:20*/ pub…

HDU 1084 What Is Your Grade?(排序)

题目在这里:1084 题目描述: “Point, point, life of student!” This is a ballad&#xff08;歌谣&#xff09;well known in colleges, and you must care about your score in this exam too. How many points can you get? Now, I told you the rules which are used …

数据分析在实际项目上的应用

前几天开会拿到了某个项目的一部分数据 在会上大家发现了这些数据中出现了很多问题 并进行了讨论 由于保密的原因数据不能贴出来 但是大体的情况是这样的&#xff1a; 某个人流量采集系统&#xff0c;当一个人进入系统时&#xff0c;计数1&#xff1b;当一个人出去时计数-…