MJYUN WXMP QuickStart
来自Jack's Lab
目录 |
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