首页 > 其他分享 >局域网搭建IOS应用在线安装环境

局域网搭建IOS应用在线安装环境

时间:2023-01-12 11:05:33浏览次数:61  
标签:httpd ssl ca IOS 局域网 etc conf server 搭建


前言

一般公司在开发IOS的APP,发布测试版本,这是一个很繁琐的过程,对于一般的公司基本上就是把测试机加入开发列表中,然后打包APP,发布到网盘,或者发到QQ上,供测试人员下载安装测试。这绝对是一个崩溃的过程。

解决方案

RT. 搭建IOS应用的在线安装环境,等环境搭建好,把发布位置告知APP开发人员,IOSAPP开发人员可以通过命令行打包APP,并且使用scp 命令 上传安装包。然后通知测试人员使用Safari浏览器打开地址,在线安装就可以了,很大程度的减少了无效工作量,并且非常方便。


好了,接下来开始:

环境: centos 7  httpd openssl https


1.安装httpd 和mod_ssl
yum install -y openssl    #使用openssl可手动创建证书
yum install -y httpd
yum install -y mod_ssl
#防火墙打开80、443端口,然后重启
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --zone=public --add-port=443/tcp --permanent
firewall-cmd --reload
#Apache开启
systemctl enable httpd
systemctl start httpd


2.开启HTTPS服务

因为iOS7.1以后,Apple不再支持HTTP方式的OTA,所以我们需要为Apache开启HTTPS。

OpenSSL自制证书

开启HTTPS的第一步,就是需要先生成ssl证书。

生成服务器的私钥
mkdir /etc/httpd/ssl cd /etc/httpd/ssl sudo openssl genrsa -out server.key 1024

生成签署申请(Common Name必须为服务器的ip或域名)
sudo openssl req -new -key server.key -out server.csr

生成CA私钥
sudo openssl genrsa -out ca.key 1024

用CA的私钥产生CA的自签署证书
sudo openssl req -new -x509 -days 36500 -key ca.key -out ca.crt

创建demoCA
demoCA里面创建文件index.txt和serial,serial内容为01,index.txt为空,以及文件夹newcerts
sudo openssl ca -in server.csr -out server.crt -cert ca.crt -keyfile ca.key

#这个地方的意思是在/etc/pki/CA 中创建这些文件和文件夹
这样在/etc/httpd/ssl中看到这些文件
[root@localhost ssl]# ls
ca.crt ca.key server.crt server.csr server.key


3.配置http.conf、ssl.conf和mime.types 配置文件
在改之前需要备份一下http.conf ssl.conf mime.types

sudo cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.origin
sudo cp /etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/ssl.conf.origin
sudo cp /etc/mime.types /etc/mime.types.origin

ssl.conf
DocumentRoot "/var/www/html"
ServerName 192.168.1.101

SSLCertificateFile /etc/httpd/ssl/server.crt
SSLCertificateKeyFile /etc/httpd/ssl/server.key

http.conf
DocumentRoot "/var/www/html"

#
# Relax access to content within /var/www.
#
<Directory "/var/www">
AllowOverride None
# Allow open access:
Require all granted
</Directory>

# Further relax access to the default document root:
<Directory "/var/www/html">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks MultiViews

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None

#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>

mime.type
text/xml xml xsd rng plist
application/octet-stream bin lha lzh exe class so dll img iso ipa


4.配置installIPA.plist和 index.html 
installIPA.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/
PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>items</key>
<array>
<dict>
<key>assets</key>
<array>
<dict>
<key>kind</key>
<string>software-package</string>
<key>url</key>
<string>https://192.168.1.101/test.ipa</string>
</dict>
</array>
<key>metadata</key>
<dict>
<key>bundle-identifier</key>
<string>com.jeiao.test</string>
<key>bundle-version</key>
<string>1.0</string>
<key>kind</key>
<string>software</string>
<key>releaseNotes</key>
<string>v1</string>
<key>title</key>
<string>testapp</string>
</dict>
</dict>
</array>
</dict>
</plist>

[root@localhost html]# more index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.or
g/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>应用名字</title>
</head>
<body>
<h1 style="font-size:40pt">iOS应用OTA安装<h1/>
<h1 style="font-size:40pt">
<a title="iPhone" href="itms-services://?action=download-manifest&url=https://192.168.1.101/installIPA.plist">Iphone Download</a>
<h1/>
<a title="iPhone" href="http://192.168.1.101/ca.crt">ssl 证书安装</a>
<h1/>
</body>
</html>


5.然后ca.crt  index.html  installIPA.plist  test.ipa 都放在发布目录

这样访问<span style="color:#ff6666;">https://192.168.1.101:443</span>就可以看到了



这样小伙伴们就可以愉快的玩耍了。


参考:

​http://www.jianshu.com/p/35ca63ec0d8e​

​http://www.bkjia.com/xtzh/1004181.html?qqdrsign=03cf6​







标签:httpd,ssl,ca,IOS,局域网,etc,conf,server,搭建
From: https://blog.51cto.com/u_15939105/6003854

相关文章