一个流浪汉框创建虚拟主机 [英] creating virtual hosts on a vagrant box

查看:440
本文介绍了一个流浪汉框创建虚拟主机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我基于与流浪的供应厨师试图建立一个开发环境。我创建与Apache(用于厨师)的环境下,可以从我的主机访问的Web服务器端口转发。

I am trying to setup a development environment based on vagrant provisioned with Chef. I created an environment with Apache (used Chef) and can access web server from my host machine with port forwarding.

我想使我的无业游民框中包含多个虚拟主机和使用共享文件夹我将定义指出了同一个盒子和相关的虚拟主机不同的项目。

I'd like to make my vagrant box to contain several virtual hosts and with shared folders I will define different projects pointing out same box and related virtual host.

我需要学习什么是是否有厨师路下创建无业游民框或不为Apache虚拟主机(这也许其他Web服务器,如:nginx的)。或无业游民+厨师设置后,我应该手动配置虚拟主机通过SSH连接盒?如果两个选项都可用,哪一个更preferable申请?

What I need to learn is whether there is a Chef-way to create virtual hosts for apache (it maybe other web servers, eg. nginx) under vagrant box or not. Or after vagrant+chef setup should I configure virtual hosts manually with connecting box via ssh? If both options are available, which one is more preferable to apply?

推荐答案

答案是肯定的,你可以使用厨师做到这一点。你必须的选择是OPS code使用的Apache2的标准团体配方here和<一个href=\"http://serverfault.com/questions/286366/configuring-virtual-hosts-with-chef-best-practice\">here

The answer is YES, you can do this using Chef. The choices you have to is to use standard community recipe of Apache2 by Opscode or part of it. You might also want to check discussion here and here

好的做法是当然的使用配方/写自己创建虚拟主机和启用它们。一要实现与厨师的事情之一是,这样你就不必做手工自动执行此。在您的方案的复杂性,可能要求你做它不同于什么在下面的链接已经试过了。您可能需要DNS配置到位,当然,如果你计划部署这地方以外的其他本地机器上。

Good practice would be of course to use a recipe/write your own to create virtual hosts and enable them. One of things you want to achieve with Chef is to automate this so that you won't have to do it manually. The complexity of your scenario might demand you to do it differently than what has been tried in links below. You might have to DNS configurations in place of course if you are planning to deploy this places other than your local machine.

这篇关于一个流浪汉框创建虚拟主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆