Vagrant 在PUPHPET生成的Wheezy VM上向Apache添加新的虚拟主机
我过去常常很快设置一个喘息虚拟机。虚拟机工作得很好,但我很乐意为Apache添加另一个虚拟主机 根据PUPPET文件: 我已经完全重写了PuPHPet,以利用内置的 木偶的配置工具称为Hiera只需查看您的 下载文件夹并打开puppet/hieradata/common.yaml。这是 控制一切的神奇文件 但是,我的下载不包括Vagrant 在PUPHPET生成的Wheezy VM上向Apache添加新的虚拟主机,vagrant,puppet,puphpet,Vagrant,Puppet,Puphpet,我过去常常很快设置一个喘息虚拟机。虚拟机工作得很好,但我很乐意为Apache添加另一个虚拟主机 根据PUPPET文件: 我已经完全重写了PuPHPet,以利用内置的 木偶的配置工具称为Hiera只需查看您的 下载文件夹并打开puppet/hieradata/common.yaml。这是 控制一切的神奇文件 但是,我的下载不包括puppet/hieradata文件夹和common.yaml文件 我尝试创建上面的文件夹和文件,但在执行vagrant reload时,它们没有得到确认,PuPHPet
puppet/hieradata
文件夹和common.yaml
文件
我尝试创建上面的文件夹和文件,但在执行
vagrant reload
时,它们没有得到确认,PuPHPet dosent的文档部分看起来非常清晰。清单生成以下文件puphpet.zip。在该文件中,第一个文件夹由一些奇怪的字符组成,其中包含必要的清单文件或HieraData配置文件:
puphpet.zip\ux2Jk1\puphpet--配置yaml
puphpet.zip\ux2Jk1\puphpet\puppet
--hiera.yaml
--manifest.pp
--木偶文件
据我所知,HieraData是指前面提到的文件集合,位于puphpet.zip文件的puppet文件夹内。如果要添加另一个虚拟主机,可以通过修改config.yaml文件的vhosts部分手动添加,然后调整vagrant文件以反映此更改。这种类型的更改可能会弄乱(非常糟糕)配置。因此,我建议您通过以下方式进行操作。如果您在puphpet.zip中找不到清单文件,可能另一个服务(如防病毒)正在替换它们,但这只是我的猜测。我需要花一两天的时间来浏览和更新我过时的文档 yaml文件现在位于puphpet/config.yaml中 搜索vhost密钥,复制/粘贴任何现有密钥并更改密钥
然后运行
$vagrant provision
,您将一切就绪 您可以通过两种不同的方式来实现:
编辑您的puphpet/config.yaml并添加另一个vhost
puphpet/config.yaml:
asxnyytgdo1d: (remember to change this key)
servername: temp.krzysiek
docroot: /var/www/temp
port: '80'
custom_fragment: ''
directories:
6ecw5mx7fg1d: (change this aswell)
provider: directory
path: /var/www/temp
options:
- Indexes
- FollowSymlinks
- MultiViews
allow_override:
- All
require:
- 'all granted'
custom_fragment: ''
ssl_cert: ''
ssl_key: ''
ssl_chain: ''
ssl_certs_dir: ''
configValues = YAML.load_file("#{dir}/puphpet/config.yaml")
或
转到并拖放您的puphpet/config.yaml文件,添加vhost,然后重新下载
然后
运行流浪者重新装载-供应
您不直接修改Vagrantfile,但Vagrantfile读取puphpet/config.yaml
流浪汉档案:
asxnyytgdo1d: (remember to change this key)
servername: temp.krzysiek
docroot: /var/www/temp
port: '80'
custom_fragment: ''
directories:
6ecw5mx7fg1d: (change this aswell)
provider: directory
path: /var/www/temp
options:
- Indexes
- FollowSymlinks
- MultiViews
allow_override:
- All
require:
- 'all granted'
custom_fragment: ''
ssl_cert: ''
ssl_key: ''
ssl_chain: ''
ssl_certs_dir: ''
configValues = YAML.load_file("#{dir}/puphpet/config.yaml")
在您看到更改后。不要忘记将vhost添加到hosts文件中。是否有方法自动将vhost添加到/etc/hosts文件中?