MJYUN WXMP QuickStart
来自Jack's Lab
(版本间的差异)
(→WXMP Setup) |
|||
第92行: | 第92行: | ||
wx.yourdomain.com | wx.yourdomain.com | ||
+ | |||
+ | <br><br> | ||
+ | |||
+ | === Disable 自动回复 === | ||
<br><br> | <br><br> |
2016年6月3日 (五) 15:28的最后版本
目录 |
[编辑] 1 Prepare Server
- Buy a Aliyun server as the WXMP Server
- Buy a domain name, something link www.yourdomain.com
- Setup the DNS to make wx.yourdomain.com point to the WXMP Server
[编辑] 2 Setup WXMP Server
[编辑] 2.1 Install Web Server
$ sudo apt-get install ssh $ sudo apt-get install apache2 $ sudo apt-get install php5 php5-curl
[编辑] 2.2 Setup Perl tools
$ sudo apt-get install perl perl-modules $ sudo apt-get install libdbi-perl libjson-perl libdatetime-perl liblwp-online-perl
[编辑] 2.3 Clone the MJYUN WXMP Framework
$ cd /opt $ git clone git://bitbucket.org:dddmjyun/wxmp.git wxmp
Modify the common/config.php:
<?php define('WXMP_OPENID', 'Your_WXMP_Open_ID'); define('WXMP_TOKEN', 'Your_WXMP_token'); define('WXMP_APPID', "Your_WXMP_appid"); define('WXMP_APPSECRET', "Your_WXMP_appsecret"); define('WXMP_URL', "http://wx.yourdomain.cn"); ?>
[编辑] 3 WXMP Setup
[编辑] 3.1 公众号设置
The "原始ID" is Your_WXMP_Open_ID
In "功能设置", Setup the "业务域名" and "JS接口安全域名" with:
wx.yourdomain.cn
[编辑] 3.2 开发 --> 基本配置
Get the appid and appsecret in here
- 服务器配置
URL: http://wx.yourdomain.cn/robot.php Token(令牌): XXXXXXXXXXXX11111111 <----------------配一个,英文或数字,长度为3-32字符 == Your_WXMP_token EncodingAESKey(消息加解密密钥): XXXXXXXXXXXXXXXXXXXXXX <----------------随机生成 消息加解密方式: 明文模式
[编辑] 3.3 开发 --> 接口权限
网页服务 --> 网页账号 --> 网页授权获取用户基本信息 --> 修改
Setup the 授权回调页面域名:
wx.yourdomain.com
[编辑] 3.4 Disable 自动回复
[编辑]
Enter the wxmp/tools/mp-menu:
$ sudo cd /opt/wxmp/tools/mp-menu # modify the menu.json and then: $ ./mp-menu.pl # To setup the menu of WXMP