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

前言

一般公司在开发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.
#

    AllowOverride None
    # Allow open access:
    Require all granted


# Further relax access to the default document root:

    #
    # 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


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




    items
    
        
            assets
            
                
                    kind
                    software-package
                    url
                    https://192.168.1.101/test.ipa
                
            
            metadata
            
                bundle-identifier
                com.jeiao.test
                bundle-version
                1.0
                kind
                software
                releaseNotes
                v1
                title
                testapp
            
        
    



[root@localhost html]# more index.html 




应用名字


iOS应用OTA安装

Iphone Download

ssl 证书安装


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

这样访问https://192.168.1.101:443就可以看到了


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


参考:

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

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







你可能感兴趣的:(服务器)