Apache配置SSL(MAC),实现IPA自动安装
2016-01-22 12:14
525 查看
1、制作签名证书
1.1、生成私钥,命令: sudo openssl genrsa -des3 -out app.key 1024
1.2、生成签署申请,命令: sudo openssl req -new -key app.key -out app.csr
1.3、生成服务器的私钥,命令: sudo openssl rsa -in app.key -out server.key
1.4、-生成给网站服务器签署的证书,命令: sudo openssl req -new -x509 -days 3650 -key server.key -out server.crt
操作步骤中的Common Name请填写自己的服务器地址或者ip
2、配置Apache文件,开启ssl
2.1、解开一下几行注释掉的代码(/etc/apache2/httpd.conf)
2.2、修改以下文件(/etc/apache2/extra/httpd-ssl.conf)
2.3、修改以下文件(/etc/apache2/extra/httpd-vhosts.conf)
2.4、运行命令:sudo apachectl configtest 检查配置是否正确
2.5、重启apache: sudo apachectl restart
3、配置IPA下载HTML
3.1、代码如下
4、配置Plist文件
4.1、代码如下
1.1、生成私钥,命令: sudo openssl genrsa -des3 -out app.key 1024
1.2、生成签署申请,命令: sudo openssl req -new -key app.key -out app.csr
1.3、生成服务器的私钥,命令: sudo openssl rsa -in app.key -out server.key
1.4、-生成给网站服务器签署的证书,命令: sudo openssl req -new -x509 -days 3650 -key server.key -out server.crt
操作步骤中的Common Name请填写自己的服务器地址或者ip
2、配置Apache文件,开启ssl
2.1、解开一下几行注释掉的代码(/etc/apache2/httpd.conf)
LoadModule ssl_module libexec/apache2/mod_ssl.so /*(加载ssl模块)*/ Include /etc/apache2/extra/httpd-ssl.conf /*加载ssl配置文件*/ Include /etc/apache2/extra/httpd-vhosts.conf /*加载定向文件*/
2.2、修改以下文件(/etc/apache2/extra/httpd-ssl.conf)
SSLCertificateFile "/etc/apache2/ssl/server.crt" /*加载证书*/ SSLCertificateKeyFile "/etc/apache2/ssl/server.key" /*加载密钥*/
2.3、修改以下文件(/etc/apache2/extra/httpd-vhosts.conf)
<VirtualHost *:443> SSLEngine on SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL SSLCertificateFile /etc/apache2/server.crt SSLCertificateKeyFile /etc/apache2/server.key ServerName 10.191.38.169 DocumentRoot "/Library/WebServer/Documents" </VirtualHost> 如果出现80端口不能访问,修改此文件以下代码 <VirtualHost *:80> ServerAdmin webmaster@dummy-host.example.com DocumentRoot "/Library/WebServer/Documents" ServerName dummy-host.example.com ServerAlias www.dummy-host.example.com ErrorLog "/private/var/log/apache2/dummy-host.example.com-error_log" CustomLog "/private/var/log/apache2/dummy-host.example.com-access_log" common </VirtualHost>
2.4、运行命令:sudo apachectl configtest 检查配置是否正确
2.5、重启apache: sudo apachectl restart
3、配置IPA下载HTML
3.1、代码如下
<html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache"> <META HTTP-EQUIV="Expires" CONTENT="0"> </head> <body> <center> <h1>微信扫码后,选择屏幕右上角(在safari打开)</h1> <a href="https://10.191.38.169/server.crt"><font style='color:#ff00ff;font-size:40px'>点我吧,第一次得安装证书</h1></a> <a href="itms-services://?action=download-manifest&url=https://10.191.38.169/test180.plist"><font style='color:#ff0000;font-size:40px'>点此安装180测试包</h1></a> </center> </body> </html>
4、配置Plist文件
4.1、代码如下
<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://10.191.38.169/test180.ipa</string> </dict> <dict> <key>kind</key> <string>display-image</string> <key>needs-shine</key> <true/> <key>url</key> <string>https://10.191.38.169/57.png</string> </dict> <dict> <key>kind</key> <string>full-size-image</string> <key>needs-shine</key> <true/> <key>url</key> <string>https://10.191.38.169/512.png</string> </dict> </array> <key>metadata</key> <dict> <key>bundle-identifier</key> <string>com.open.tongxue</string> <key>bundle-version</key> <string>2.4.0</string> <key>kind</key> <string>software</string> <key>title</key> <string>同学+</string> </dict> </dict> </array> </dict> </plist>
相关文章推荐
- Apache优化:修改最大并发连接数
- 分布式文件存储FastDFS(四)配置fastdfs-apache-module
- apache traffic server6.0 安装
- linux安装apache过程中注意的问题
- HTML 基本用法及Apache搭建
- Cubieboard安装Apache2服务器
- Apache Prefork、Worker和Event三种MPM分析
- 找不到org.apache.spark.streaming.flume.sink.SparkFlumeProtocol$Callback
- APACHE实现负载均衡
- Apache开启Rewrite伪静态
- LAMP架构之构建php为apache的模块(CentOS 7)
- Apache开启Proxy代理,实现域名端口转发
- Apache的ProxyPass指令详解
- Ubuntu下安装和配置Apache2
- 整合apache和php
- Apache安装教程
- java变换json需要导入的jar包,org/apache/commons/lang/exception/NestableRuntimeException
- Apache性能测试工具ab
- 在 Web 项目中应用 Apache Shiro
- Apache 2.4 配置多个虚拟主机的问题