windows安装并配置apache https 网站 &发布企业级iOS APP(enterprise)

1. 安装并配置apache
安装apache时,域名和服务器名使用服务器IP,建议端口选8080(检查端口是否被占用?netstat -ano)
下载apache_2.2.8-win32-x86-openssl-0.9.8g.msi,这个版本自带openssl,安装后配置httpd.conf文件(在conf文件夹里):
1.去掉LoadModule ssl_module modules/mod_ssl.so前面的#号
2.去掉Include conf/extra/httpd-ssl.conf前面的#号
配置httpd-ssl.conf文件(在extra文件夹里):
1.在SSLSessionCache        "shmcb:D:/Program Files (x86)/Apache Software Foundation/Apache2.2/logs/ssl_scache(512000)"最左边加#,注释掉。否则报错:SSLSessionCache: Invalid argument: size has to be >= 8192 bytes
2.在Listen 80或Listen8080 前加 # (对应apache安装时选择的端口)


2. 生成证书
将文件openssl.cnf拷贝到bin目录下,依次执行下列语句:


开始运行cmd  cd C:\Apache2.2\bin (进入bin目录)


右键复制粘贴如下命令:


openssl genrsa -out server.key 1024


openssl req -new -key server.key -out server.csr -config openssl.cnf


openssl genrsa  -out ca.key 1024


openssl req  -new -x509 -days 365 -key ca.key -out ca.crt  -config openssl.cnf 
(这里调成3650无效…还是1年有效…)


如提示输入Common Name,请输入服务器IP或域名。


在bin目录创建demoCA,里面创建文件夹newcerts和文件index.txt及serial,index.txt为空,serial内容为01。(Serial无后缀)


openssl ca -in server.csr -out server.crt -cert ca.crt -keyfile ca.key -config openssl.cnf


将生成的文件server.crt和server.key拷贝到D:\Program Files\Apache Group\Apache2\conf下面,这个位置可以在httpd-ssl.conf文件中修改


将ca.crt 文件拷贝到 D:\Program Files\Apache Group\Apache2\htdocs


将.plist和.ipa文件拷贝到D:\Program Files\Apache Group\Apache2\htdocs,这个位置也可以在httpd-ssl.conf中修改,如果是http访问方式则在httpd.conf中修改




*注意 步骤2和步骤4输入信息一致,步骤2要多输入个别名和密码




2. index.html 网站编写
建立凭证下载路径,例如 <a href="https://10.244.170.173/ca.crt">Cert Download</a> 


APP 下载路径格式,例如 <a href="itms-services://?action=download-manifest&url=https://10.244.170.173/app.plist">APP Download (HTTPS)<span class="Apple-converted-space"> </span></a>


3. 注意修改plist文件,保证正确指向ipa下载路径,例如:<string>https://10.244.170.173/app.ipa</string>
以及确保bundle-identifier正确且可用,例如:
<string>com.idsbg.it.app</string>


4.在IE中下载ca.crt ,将产生的ca.cer 文件拷贝到D:\Program Files\Apache Group\Apache2\htdocs 里,双击安装ca.cer到信任的根凭证授权,此时网不会有红色不安全的警告了。




*导致企业APP无法下载的原因:
1.服务器关机
2.apache httpd 进程被杀掉
3.apache 配置错误.(端口占用,相关参数配置文件#未打开或关闭)
4.服务器自签名证书过期
5.app 凭证过期
6.app 凭证被撤销
7.打包app时企业开发证书或app凭证选择错误.(plist,build setting(project,target))
8.服务器上html连接错误(凭证连接错误,plist路径错误)
9.服务器上pist 错误(appId错误,ipa路径错误)
10.服务器未走https下载
11.网络不通
12.未安装服务器凭证.
13.app不支持设备(设备类型ipad/iphone,设备os版本)
14.将 10.244.170.173 替换为你自己的server IP
15.common name 要输入IP 或服务器域名
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章