ssl - 在购买的域名上托管 Chef Server 12

标签 ssl nginx amazon-ec2 chef-infra

我已经在 AWS EC2 上的 Ubuntu 14.04 上安装了 chef server 并为其附加了一个 Elastic IP。然后我将该 IP 映射到我购买的 DNS 主机。

如果我使用 https://mydnsname.com 访问站点, 我得到 Chef 服务器页面并能够创建组织和所有。

我将 chef-starter 包下载到我的本地系统。

当我执行 $ knife ssl fetch 时,我收到以下错误消息:

Connecting to host mydnsname.com:443
ERROR: The SSL cert is signed by a trusted authority but is not valid for the given hostname
ERROR: You are attempting to connect to: 'mydnsname.com'
ERROR: The server's certificate belongs to 'ip-172-31-45-242.ec2.internal'*

$ knife ssl fetch

WARNING: Certificates from mydnsname.com will be fetched and placed in your trusted_cert directory (~/chef/chef-repo/.chef/trusted_certs).
Knife has no means to verify these are the correct certificates. You should verify the authenticity of these certificates after downloading. Adding certificate for ip-172-31-45-242.ec2.internal in ~/chef/chef-repo/.chef/trusted_certs/ip-172-31-45-242_ec2_internal.crt
I have generated self signed certificate for my domain name mydnsname.com and placed it on /var/opt/opscode/nginx/ca/ directory*

我已经为我的域名 mydnsname.com 生成了自签名证书,并将其放在 /var/opt/opscode/nginx/ca/ 目录中

但我仍然没有取得成功。

我在服务器上的/etc/hosts 文件看起来像

127.0.0.1 mydnsname.com 大厨 127.0.0.1 本地主机 54.173.215.55 mydnsname.com Chef

如何在本地计算机上使用域名和 knife 配置 AWS EC2 上的 Chef 服务器?

最佳答案

为此需要做一些事情。 第一个是定义您在 chef-server.rb 中使用的名称 api_fqdn 属性,因为它驱动 nginx 配置。

一些文档 here关于 chef-server.rb

的选项

文档并不详尽,但您可以检查 chef-server-ctl reconfigure 使用的 chef-server cookbook 中所需的属性。默认值在 /opt/chef-server/embedded/cookbooks/chef-server/attributes/default.rb 中(或可见 here 只是去掉 chef-server 中的第一级属性。 rb 文件并使用下一个键作为对象)。

即:

default['private_chef']['nginx']['server_name'] = node['fqdn'] 将在 chef-server.rb 中被 nginx['server_name '] = "mydnsname.com"

最后,在使用 chef-server-ctl show-config 重新配置之前,您可以确保所有属性都正常,这将打印从默认值更改或为您的服务器计算的值。

关于ssl - 在购买的域名上托管 Chef Server 12,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29368291/

相关文章:

ruby-on-rails - 巨大的多嵌套表单因 "An unhandled lowlevel error occurred. The application logs may have details."而失败

node.js - 在亚马逊AWS Elastic beanstalk上安装解析仪表板(或本地?)

amazon-web-services - AWS Systems Manager 如何在自动化步骤之间添加延迟

python - 为 Python 2.6 添加 SSL 支持

php - 您是否需要包含完整的 https 文件名才能在 html/php 表单上使用 SSL?

mysql - 使用 Nginx 代理 TCP 流(MySQL 和 Redis)

linux - 如何从 EC2 上的根卷创建 XFS 卷?

java - 从 websphere-liberty 16 迁移到版本 17 后出现 SSLHandshakeException

android - 在 android 中的 ssl 握手期间无法附加客户端证书

PhpStorm 和 Remote XDebug 不工作