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 或服務器域名
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章