vagrant入门

Vagrant is a tool for creating and managing virtual environments that help many developers not have to care about the “works on my machine…” problem. Vagrant creates reusable development systems that can be used again and again, helping you keep your system clean of too many installations.

Vagrant是用于创建和管理虚拟环境的工具,可以帮助许多开发人员不必担心“我的机器上的工作……”问题。 Vagrant创建了可重复使用的开发系统 ,这些系统可以一次又一次地使用,从而帮助您避免过多的系统安装。

When you are focused on development and lack the skills of a sys admin, the best thing to do (if you are going to use Vagrant during development) is to try another way of setting up your Vagrant configuration.

当您专注于开发而又缺乏系统管理员的技能时,最好的办法(如果要在开发过程中使用Vagrant)是尝试另一种设置Vagrant配置的方法。

When it comes to PHP development, there are some online services that simplify the setup and configuration of these Vagrant virtual machines. Here is a list of some of these services.

在进行PHP开发时,有一些在线服务可以简化这些Vagrant虚拟机的设置和配置。 这是其中一些服务的列表。

1. PuPHPet (1. PuPHPet)

PuPHPet is probably the most “famous” of these services, and probably the most “specialized” one of them. It gives you the ability to host the VM on your local machine, on Digital Ocean, Rackspace or Amazon Web Services. You get to add forwarded ports with just a click of a button, and sharing source folders is as easy as that too. You can customize the firewall by setting rules and removing them as needed. As for web servers, you can choose between Apache and Nginx, choosing aliases and ports where to access the application.

PuPHPet可能是这些服务中最“著名”的,并且可能是其中最“专业化”的一种。 它使您能够在本地计算机,Digital Ocean,Rackspace或Amazon Web Services上托管VM。 只需单击一个按钮即可添加转发的端口,共享源文件夹也是如此。 您可以通过设置规则并根据需要删除它们来自定义防火墙。 对于Web服务器,您可以在Apache和Nginx之间进行选择,选择别名和访问应用程序的端口。

When it comes to programming languages, PuPHPet is not all about PHP. Besides PHP, you can choose to install Python, Ruby, NodeJS and HHVM. You can’t install both PHP and HHVM, since the service doesn’t allow this – use Homestead Improved for running both at the same time. When installing HHVM, you can also choose to install the nightly release, which gives you the possibility of testing Facebook’s Hack language.

当涉及到编程语言时,PuPHPet不仅仅涉及PHP。 除了PHP,您还可以选择安装Python,Ruby,NodeJS和HHVM 。 您不能同时安装PHP和HHVM,因为该服务不允许这样做–使用Homestead Enhanced可以同时运行两者。 在安装HHVM时,您还可以选择安装夜间版本,这使您可以测试Facebook的Hack语言。

As for databases, PuPHPet has the biggest repository of those, with 6 different databases available. You can choose between MySQL/MariaDB (can’t have both of them), PostgreSQL, Redis, SQLite and MongoDB. You can chose to install Adminer for DB management, but don’t install it onto the production server.

对于数据库,PuPHPet具有最大的存储库,并提供6种不同的数据库。 您可以在MySQL / MariaDB(不能同时拥有两者),PostgreSQL,Redis,SQLite和MongoDB之间进行选择。 您可以选择安装Adminer进行数据库管理,但不要将其安装到生产服务器上。

Before finishing, PuPHPet allows you to install tools like RabitMQ, Elasticsearch, etc.

在完成之前,PuPHPet允许您安装RabitMQ , Elasticsearch等工具。

All that PuPHPet wants from you is that you use a Vagrant version not lower than 1.6. Also, you need VirtualBox in order to use the configurations on your local machine. You can find the source code of PuPHPet on this GitHub repo and a more in-depth guide here.

PuPHPet希望您提供的是使用不低于1.6的Vagrant版本。 另外,您需要VirtualBox才能使用本地计算机上的配置。 您可以在此GitHub存储库中找到PuPHPet的源代码,并在此处 找到更深入的指南。

2. Protobox (2. Protobox)

Protobox is another online Vagrant service. There are many reasons to use Protobox. It actually started as a fork of PuPHPet, but turned out to be a complete other project, due to some issues related to Puppet (not PuPHPet). Protobox has grown into a great service that helps create Vagrant configurations for web application development.

Protobox是另一个在线Vagrant服务。 使用Protobox的原因很多。 它实际上是从PuPHPet的分支开始的,但由于与Puppet (不是PuPHPet)有关的一些问题,最终却是一个完整的其他项目。 Protobox已成长为一项出色的服务,可帮助为Web应用程序开发创建Vagrant配置。

When using Protobox, you can choose from a list of application types:

使用Protobox时,可以从应用程序类型列表中进行选择:

  • Drupal

    Drupal

  • Laravel (which also has its own Vagrant configuration – Homestead)

    Laravel (它也有自己的Vagrant配置– Homestead )

  • Lemonstand

    柠檬摊

  • PyroCMS

    热解CMS

  • Sylius

    西柳斯

  • Symfony

    Symfony

  • WordPress (which also has VVV – Varying Vagrant Vagrants)WordPress(也有VVV –不断变化的无业游民)

You can add more than one of these applications to the configuration. As for the web servers, both Apache and Nginx are available. You can choose only three languages: PHP, HipHop (with HHVM) and Ruby.

您可以将多个这些应用程序添加到配置中。 对于Web服务器,Apache和Nginx均可用。 您只能选择三种语言:PHP,HipHop(带有HHVM)和Ruby。

At the time of writing this, Protobox supports only MySQL and MariaDB, but other databases, such as PostgreSQL, MongoDB, Redis and Riak are coming soon. Tools such as Ngrok and NewRelic tools (PHP Agent and Node Agent) can be installed by ticking a checkbox.

在撰写本文时,Protobox仅支持MySQL和MariaDB,但即将推出其他数据库,如PostgreSQL,MongoDB,Redis和Riak。 可以选中一个复选框来安装Ngrok和NewRelic工具( PHP Agent和Node Agent )之类的工具。

You can find the source code for Protobox in their GitHub repo.

您可以在他们的GitHub存储库中找到Protobox的源代码。

3.宽容 (3. Phansible)

Phansible is another tool for creating Vagrant configurations based on Ansible, also inspired from PuPHPet.

Phansible是另一个基于Ansible创建Vagrant配置的工具,同样受PuPHPet的启发。

Phansible is somewhat simpler than the above services. It allows both Apache and Nginx, with HHVM only when you choose Nginx. You can’t choose any other language than PHP, but you can chose between versions of PHP. Also, you can’t choose any other database other than MySQL.

Phansible比上述服务更简单。 它仅在选择Nginx时才允许使用HHVM的Apache和Nginx。 除了PHP,您不能选择任何其他语言,但是可以在PHP版本之间进行选择。 另外,除了MySQL,您不能选择任何其他数据库。

When you’re predetermined to use only Apache/Nginx, PHP and MySQL, Phansible doens’t differ that much from the other services above. Otherwise, you would have to install other tools manually.

当您预定只使用Apache / Nginx,PHP和MySQL时,Phansible与上述其他服务没有太大区别。 否则,您将必须手动安装其他工具。

4.漫游 (4. Rove)

Rove is probably the simplest of them all. You can choose any of the typical configurations, Rails and LAMP, or you can create your configuration manually.

罗夫可能是所有这些中最简单的。 您可以选择任何典型配置,即Rails和LAMP,也可以手动创建配置。

Rove supports CouchDB, MongoDB, MySQL, PostgreSQL, Redis and SQLite as databases. You can select as many as you want of them. It also supports the same languages as PuPHPet, all except HHVM.

Rove支持CouchDB,MongoDB,MySQL,PostgreSQL,Redis和SQLite作为数据库。 您可以根据需要选择任意数量。 除了HHVM之外,它还支持与PuPHPet相同的语言。

5.定制配置 (5. Customized configurations)

There are also some other Vagrant configurations that are case-specific, i.e. for a single PHP framework.

还有一些其他的Vagrant配置是特定于大小写的, 针对单个PHP框架。

I would mention here Laravel’s Homestead, which makes Laravel development a piece of cake, both front and back end. It comes with PHP5.6, Nginx as the web server, both MySQL and PostgreSQL; and NodeJS, with Bower, Grunt and Gulp for the front-end development. There’s an improved version of Homestead here.

我在这里要提到Laravel的Homestead ,这使得Laravel的开发在前端和后端都是小菜一碟。 它带有PHP5.6,Nginx作为Web服务器,包括MySQL和PostgreSQL。 和NodeJS,以及Bower,Grunt和Gulp进行前端开发。 有宅基地的改进版本在这里 。

Phalcon also has a Vagrant configuration, which saves you the time of installing it and configuring it in an existent server, although you can follow this quick tip to install Phalcon on a Homestead Improved instance.

Phalcon还具有Vagrant配置 ,可以节省安装和在现有服务器中进行配置的时间,尽管您可以按照此快速提示在Homestead Improvementd实例上安装Phalcon。

WordPress has its own Vagrant configuration, VVV – Varying Vagrant Vagrants. There is a full tutorial on SitePoint which shows you how to use VVV.

WordPress有其自己的Vagrant配置,即VVV – Varying Vagrant Vagrants 。 在SitePoint上有完整的教程 ,向您展示了如何使用VVV。

最后的话 (Final words)

Vagrant may be difficult to use sometimes, but is worth pursuing as it can be exceptionally useful. If you are tired of configuring your machine for every project you have, then Vagrant is the right tool for you. If you face problems while configuring your machine, then using a prepackaged vagrant box is the best answer to your problems. Any alternatives to the services above we’ve missed? Let us know!

流浪者有时可能很难使用,但值得一去,因为它可能非常有用。 如果您厌倦了为自己拥有的每个项目配置机器,那么Vagrant是适合您的工具。 如果在配置计算机时遇到问题,则使用预包装的无用盒是解决问题的最佳方法。 我们错过了以上服务的替代方案吗? 让我们知道!

翻译自: https://www.sitepoint.com/5-easy-ways-getting-started-php-vagrant/

vagrant入门

vagrant入门_在Vagrant上使用PHP入门的5种简单方法相关推荐

  1. 简单轻松的将本地项目上传到Github的两种简单方法

    如何将本地项目上传到Github 将本地项目上传到Github(两种简单.方便的方法) 一.第一种方法: 二.第二种方法: Git命令 查看.添加.提交.删除.找回,重置修改文件 查看文件diff 查 ...

  2. GIT将本地项目上传到Github(两种简单、方便的方法)

    GIT将本地项目上传到Github(两种简单.方便的方法) 一.第一种方法: 首先你需要一个github账号,所有还没有的话先去注册吧! https://github.com/ 我们使用git需要先安 ...

  3. 在matlab中怎么录制音频_怎么录制淘宝页面中的视频?简单方法,轻松搞定

    原标题:怎么录制淘宝页面中的视频?简单方法,轻松搞定 怎么录制淘宝页面中的视频?当前足不出户,大家就可以在很多的电商平台购买到自己心仪的商品.这其中商机也就产生了,如果不太想上班,或者说想要自己当老板 ...

  4. git学习(10):Git的使用--如何将本地项目上传到Github(两种简单、方便的方法)

    将本地项目上传到Github(两种简单.方便的方法) 一.第一种方法: 首先你需要一个github账号,所有还没有的话先去注册吧! https://github.com/ 我们使用git需要先安装gi ...

  5. 在Mac上缩小PDF文件大小的3种简便方法

    从专业的学术报告到市场媒体工具包材料,或个人简历,PDF文件无处不在.为什么?主要是因为它保留了文档格式,因此可以在所有设备,屏幕或系统中完美显示内容.而且,我们可以轻松创建引人注目的数字文件,并且接 ...

  6. 市面上有哪几种门_目前市面上的成品木门有哪几种

    市面上比较常用的踢脚线有哪几种材质 按木,密度板,高分子,塑钢实木 2020-08-30 目前市面上鹦鹉地板的销量好吗 好 呢,自 " 双 反 "完胜 美 国 后 ,该 地板 销量 ...

  7. 苹果语音备忘录怎么改名字_语音备忘录误删除怎么恢复?安利你个简单方法

    语音备忘录误删除怎么恢复?在苹果手机里,我们可以通过语音备忘录录音,能够被保留在手机上的数据都是很重要的,如果不小心删除了语音备忘录该怎么办?很多人误删除数据以后会觉得不知所措,有些人甚至认为删除的数 ...

  8. 墙面有几种装修方法_家里的墙面不知道怎么装?6种装饰方法任你选

    如果说家中占据面积最大的部分,一定是墙面.但墙面又不像地面那样,如果 全部铺上瓷砖,反倒会显得俗气.那么家里的墙面到底怎么装才好看呢? 1.乳胶漆+挂饰 利用乳胶漆装修墙面应该是最常见的了,施工方便, ...

  9. 应用程序错误电脑黑屏_电脑运行程序出现APPCRASH错误的三种解决方法

    好多小伙伴说电脑在运行程序时出现appcrash错误,导致软件无法正常运行,其实电脑是很复杂的程序代码设计的,遇到一些奇怪的问题也不奇怪,系统运行程序出现APPCRASH错误,很多新手用户都不知道怎么 ...

  10. 数字电路实验怎么接线视频讲解_电工知识:三相电表怎么接线?2种接线方法一一讲解,实物对照...

    之前我们介绍单项电表接线方法,本期我们介绍三相电表接线方法,主要说两种,一种是直接式一种是带电流互感器的.这2种接线从测量原理和构成角度来说,没什么差别.只不过直接式的三相电表额定电流是根据负载的电流 ...

最新文章

  1. 电脑任务管理器_电脑任务管理器没有进程怎么办
  2. RSPN技术华为交换机(s2000hi)
  3. python读取二进制数据中的while循环_在Python中读取二进制文件并循环遍历每个字节...
  4. 2440 nand flash和nor flash上启动
  5. 焊接标注lisp文件下载_压力容器中焊缝的标注与对接,绝对专业
  6. AcWing1064.骑士(状压DP)题解
  7. 运行 Java、Python、Go 等 25 种代码后,发现性能最强的竟然是它!
  8. java录音程序_record类完成语音信号采集的任务_Android实现语音数据实时采集、播放...
  9. 常用算法案例之贪心法(C语言)
  10. STM8S单片机入门1(开发环境搭建)
  11. vs2013 格式化代码 快捷键
  12. Project组合项目案例分享
  13. EasyGUI-6:文件目录和异常
  14. 抖音上很火的苹果手机称重touchscale原理
  15. 如何在远程计算机上播放音乐,如何用iPhone远程遥控电脑播放音乐教程
  16. @Qualifier注解的使用
  17. 聊聊去年最火的前端库zx
  18. CMGAN: Conformer-based Metric GAN for Speech Enhancement
  19. Linux环境下串口号变化,自定义串口,修改串口号,绑定设备ID
  20. OpenResty搭建游戏服务器(一)开始

热门文章

  1. 元数据管理器中存在错误。 ID 为“DESKTOP-99BPLMI”的 server 中不存在 ID 为“T3DATA_ZYM”的 database,或用户没有访问该对象的权限。
  2. 女性三围的检测验证js-------格式 20,30,40
  3. Maven项目 cityFileFK02数据库连接(课外完成)
  4. 怎么把pdf文件转换成word方法分享
  5. 苹果双系统怎么切换_电脑双系统如何安装,使用小白一键重装系统
  6. 环境变量(PATH)的那些事
  7. DSP编程时 c_int00是什么内容
  8. markdown添加目录
  9. 全面正面解读:nmn的副作用和危害怎么样?nmn副作用及应对方法?
  10. USACO 2021-2022 December Contest Bronze 题解