本文的服务端使用的linux+nginx
首先配置https访问
创建SSL证书
执行以下命令:
cd /usr/local/nginx/conf
openssl genrsa -des3 -out server.key 1024
openssl req -new -key server.key -out server.csr
cp server.key server.key.org
openssl rsa -in server.key.org -out server.key
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
编辑nginx.conf并按如下来更新:
server {
server_name example.com;
listen 443;
ssl on;
ssl_certificate /usr/local/nginx/conf/server.crt;
ssl_certificate_key /usr/local/nginx/conf/server.key;
access_log /usr/local/nginx/logs/ssl.access.log;
error_log /usr/local/nginx/logs/ssl.error.log;
}
重启nginx:
/usr/local/nginx/sbin/nginx -s reload
接下来把你打包好的ipa文件、plist文件和icon图标放到你的站点目录下面
然后创建一个html里面填写<a href="itms-services://?action=download-manifest&url=https://xxx.com/manifest.plist">InstallAPP</a>点击一下。是不是可安装了
注:必须得去申请个证书才能实现以上功能,免费的证书申请地址:https://www.startssl.com/?app=11&action=regform