vagrant入门

Last year, I had a somewhat negative experience with installing eZ Publish on a Vagrant box. Since then, they’ve significantly improved both the software and the VM-friendliness by, well, flat out removing the legacy stack. The VM setup we’ll be using in this tutorial comes from the labs of NetGen and the mind of @vranac, and is followed by the installation procedure on our very own Homestead Improved modified by yours truly.

去年,我在无业游民的盒子上安装eZ Publish时遇到了一些负面的经历 。 从那时起,他们通过消除旧堆栈的方式大大改善了软件和VM的友好性。 我们将使用本教程中的虚拟机的设置来源于实验室NetGen和心灵@vranac ,并随后在我们自己的安装过程宅基改进通过你的修改确实。

Note: the new eZ system, now called eZ Platform, is still in deep alpha mode and doesn’t really contain all the features of the old one yet. In fact, if you want to do any kind of serious content management and modification, you need to add the legacy stack into the mix, the process of which is described here.

注意:新的eZ系统(现在称为eZ平台)仍处于深度Alpha模式,并且还没有真正包含旧系统的所有功能。 实际上,如果您想进行任何认真的内容管理和修改,则需要将旧堆栈添加到混合中, 此处介绍了其过程。

Vranac设置 (Vranac setup)

Vranac defined an Ansible recipe for provisioning a raw Ubuntu/Trusty box with all the prerequisites for eZ Platform. This means that, while it keeps your raw box highly reusable for other projects (thus saving on disk space), the provisioning procedure can be very long (upwards of 40 minutes). Likewise, to use this approach, you need Ansible on the host machine unlike with Homestead Improved. It’s up to you to choose which setup you like more – both work just fine. The instructions for Homestead Improved are in the next section, but first, let’s look at Vranac’s approach.

Vranac定义了一个Ansible配方,用于配置eZ平台的所有必备组件的原始Ubuntu / Trusty盒。 这意味着,虽然它可以使您的原始设备箱在其他项目中具有很高的可重用性(从而节省了磁盘空间),但配置过程却可能很长(长达40分钟)。 同样,要使用这种方法,您需要在主机上使用Anstead而不是Homestead Improvement 。 您可以根据自己的喜好选择更喜欢的设置-两者都可以正常工作。 下一节将介绍“ Homestead改进版”的说明,但首先,让我们看一下Vranac的方法。

要求 (Requirements)

Your host machine should have:

您的主机应具有:

  • Vagrant

    流浪汉

  • Ansible

    Ansible

  • VirtualBox

    虚拟盒子

Note that if you’re on Windows, Ansible is not available. However, the configuration will make sure it downloads and installs Ansible inside the guest VM, and executes it from within, so no worries.

请注意,如果您使用的是Windows,则Ansible不可用。 但是,该配置将确保它在来宾VM中下载并安装Ansible,并从内部执行它,因此无需担心。

克隆并向上 (Clone and Up)

To set up an environment, we’ll clone @vranac’s Vagrantfile setup and vagrant up it.

要建立一个环境,我们将克隆@vranac的Vagrantfile设置和vagrant up它。

git clone https://github.com/netgen/vagrant-ansible-ezpublish.git
cd vagrant-ansible-ezpublish
vagrant up

The up procedure should take care of all provisioning automatically, including folder sharing. It might take a while, depending on the speed of your machine and of your internet connection. It might also ask you for your admin password (or get the UAC dialog on Windows) on the host machine, due to using NFS for file sharing.

up过程应自动处理所有配置,包括文件夹共享。 可能需要一段时间,具体取决于您的计算机和Internet连接的速度。 由于使用NFS进行文件共享,它可能还会要求您在主机上输入管理员密码(或在Windows上获取UAC对话框)。

By default, the folder you’re in (vagrant-ansible-ezpublish) will be linked to var/www/ezpublish inside the VM. A database called ezpublish will also be automatically created with the username ez and the password ez.

默认情况下,您所在的文件夹( vagrant-ansible-ezpublish )将链接到VM内部的var/www/ezpublish 。 还将使用用户名ez和密码ez自动创建一个名为ezpublish的数据库。

最后步骤 (Final steps)

Now, there are a couple of caveats to keep in mind.

现在,需要牢记一些警告。

Due to some Apache 2.4 shenanigans the team couldn’t get around, the folder in the VM that gets shared with the host machine is var/www/ezpublish rather than the traditional var/www. Thus, to power an eZ Platform instance on this VM, you need to do the following once you’re inside the machine with vagrant ssh

由于团队无法解决Apache 2.4的一些var/www/ezpublish ,与主机共享的VM中的文件夹是var/www/ezpublish而不是传统的var/www 。 因此,要在此VM上为eZ Platform实例提供电源,一旦您进入了带有vagrant ssh的计算机,则需要执行以下操作

cd /var/www/ezpublish
composer create-project ezsystems/ezplatform
mv ezplatform/* .

We need to do this because the create project command creates an eZ project in the ezplatform folder, and Apache’s vhost is linked into ezpublish.

我们需要这样做,因为create project命令在ezplatform文件夹中创建了一个eZ项目,并且Apache的虚拟主机链接到ezpublish

Then, install the demo bundle and clear cache with:

然后,安装演示包并使用以下命令清除缓存:

php ezpublish/console ezplatform:install --env prod demo
php ezpublish/console cache:clear --env prod

To visit the front end, go to 172.21.12.10, and to visit the back end, go to 172.21.12.10/shell:

要访问前端,请转到172.21.12.10 ,要访问后端,请转到172.21.12.10/shell

The login credentials are admin / publish.

登录凭据为admin / publish

Important note: Due to this setup, if something goes wrong, you shouldn’t rm -rf the contents of the ezpublish folder and assume everything will be fine if you create a new project. If you delete the folder or its contents, you’re effectively removing the contents of the folder on the host, which includes provisioning scripts and the Vagrantfile. To avoid these problems, you can either:

重要说明 :由于此设置,如果出现问题,则不要rm -rf ezpublish文件夹的内容,并假设如果创建新项目,一切都会好的。 如果删除文件夹或其内容,则实际上是在主机上删除该文件夹的内容,其中包括配置脚本和Vagrantfile。 为避免这些问题,您可以:

  • create sub-projects inside /var/www/ezpublish like so /var/www/ezpublish/project1 and configure new Apache virtual hosts to accommodate this

    /var/www/ezpublish内部创建子项目,就像/var/www/ezpublish/project1并配置新的Apache虚拟主机以适应此需求

or follow the instructions below, applied to Homestead Improved but easily applicable to all other systems and virtual machine environments as well.

或遵循以下说明,适用于Homestead Improvement,但也容易适用于所有其他系统和虚拟机环境。

在Homestead上配置eZ的改进 (Configuring eZ on Homestead Improved)

The setup above favors Apache instead of Nginx, and is a bit clumsy in terms of multi-project setups. Let’s set it up on an environment we’re familiar with now, and with which we can be up and running in under 10 minutes: Homestead Improved. Follow the tutorial and set it up. Then, vagrant halt it into shutdown mode and set up a new site:

上面的设置支持Apache而不是Nginx,并且在多项目设置方面有些笨拙。 让我们将其设置在我们现在熟悉的环境中,并且可以在不到10分钟的时间内启动并运行: Homestead Improvementd 。 按照教程并进行设置。 然后, vagrant halt到关机模式并建立一个新站点:

- map: ez.app
to: /home/vagrant/Code/ezplatform/web

Re-provision with vagrant provision.

重新配置,并提供vagrant provision

Now that our new Nginx host is set up, let’s enter the VM and create a new MySQL database:

现在我们的新Nginx主机已经设置好了,让我们进入虚拟机并创建一个新MySQL数据库:

mysql -u homestead -psecret -e "create database ezpublish";

Note that the username and password are homestead / secret, as per default Homestead configuration.

请注意,根据默认的Homestead配置,用户名和密码为homestead / secret

We also need some PHP extensions installed:

我们还需要安装一些PHP扩展:

sudo apt-get update
sudo apt-get install php5-intl php5-xsl

Now, let’s go into the Code folder while inside the VM and create the project.

现在,让我们进入VM内的Code文件夹并创建项目。

cd ~/Code
composer create-project ezsystems/ezplatform

This might take a while so grab a cup and relax. When it finishes, wrap up the installation by installing the demo bundle and clearing the cache.

这可能需要一段时间,所以请抢一杯杯然后放松。 完成后,通过安装演示包并清除缓存来结束安装。

cd ezplatform
php ezpublish/console ezplatform:install --env prod demo
php ezpublish/console cache:clear --env prod

Don’t forget to add ez.app (or whichever site name you chose) to your /etc/hosts file on the host machine, as per instructions in the Homestead Improved quickstart.

请不要忘记按照Homestead Enhanced快速入门中的说明,将ez.app (或您选择的任何站点名称)添加到/etc/hosts上的/etc/hosts文件中。

Now, visit the URL http://ez.app/ (the trailing slash is important, as it forces your browser to look for the site directly, rather than use Google to search for it if DNS servers don’t resolve it) and enjoy!

现在,访问URL http://ez.app/ (斜杠很重要,因为它会迫使您的浏览器直接查找该站点,而不是在DNS服务器无法解析的情况下使用Google搜索该站点),并且请享用!

在PHPSummerCamp进入EZPublish和Symfony (Diving into EZPublish and Symfony at PHPSummerCamp)

With the installation done, we can finally dive in and build wonderfully complex systems that even the most demanding websites can’t out-demand. It’s important to be patient with the system – being in alpha mode, it’s still incredibly unstable and very slow, but getting there. Keep testing and help the team out with suggestions – let’s make sure it gets released soon by providing as much feedback as possible. Use it with the dev tools open and review the errors, discuss on the forums, tweet at them, or let us know in the comments below.

安装完成后,我们终于可以深入研究并构建出色的复杂系统,即使是最苛刻的网站也无法满足需求。 对系统保持耐心很重要–处于alpha模式,它仍然非常不稳定且非常缓慢,但是到了那里。 保持测试并向团队提出建议-让我们通过提供尽可能多的反馈来确保其尽快发布。 将其与开发工具一起使用,以打开并查看错误,在论坛上进行讨论 , 在其上进行 鸣叫或在以下评论中告知我们。

To dive in an learn about the platform, you could go and read the documentation, or you could come and join us as PHPSummerCamp – the same event we attended last year. This time around, some even more high profile speakers are flying in, including but not limited to:

要深入了解该平台,您可以阅读文档 ,也可以以我们去年参加的PHPSummerCamp的身份加入我们。 这次,一些更引人注目的扬声器在飞来飞去,包括但不限于:

  • Ryan Weaver of KNPLabs,

    KNPLabs的Ryan Weaver ,

  • Bernhard Schussek, creator of Puli

    伯恩哈德Schussek ,创作者埔里

  • David Buchman of Liip fame

    Liip名望的David Buchman

  • Pawel Jedrzejewski from Sylius

    帕维尔Jedrzejewski从Sylius

  • Nicolas Grekas from SensioLabs

    来自SensioLabs的 Nicolas Grekas

…and many more, with topics like:

…还有更多类似的主题,包括:

  • Deep insights into object-oriented programming with Symfony使用Symfony深入了解面向对象的编程
  • Managing assets with Puli 通过埔里管理资产
  • HTTP caching with Varnish使用Varnish进行HTTP缓存
  • Rapid API development with LionframeLionframe快速开发API
  • Modeling by example通过示例建模
  • Profiling PHP applications (Blackfire)对PHP应用程序进行性能分析(Blackfire)
  • Migrating to Symfony 3.0迁移到Symfony 3.0

With not only three full days of hands-on workshops (rather than the traditional theoretical bombardment you usually get at conferences) but also boat trips, lunches, and the experience of the Croatian coastline (something you shouldn’t miss – trust me), it’s a no-brainer.

不仅有整整三天的动手研讨会(而不是通常在会议上进行的传统理论轰炸),而且还包括乘船旅行,午餐和克罗地亚海岸线的体验(您不应该错过的-相信我),这很容易。

The event has just had its super-early-bird prices announced and tickets made available for purchase, so make sure you check out the announcement post.

该活动刚刚宣布了其超早鸟价格,并提供了可购买的门票,因此请确保您查看公告栏 。

Too expensive? Just convince your boss! Make sure they know that your education and training will benefit the company much more in the long term than you staying at work for those three extra days.

太贵了吗 只是说服你的老板 ! 确保他们知道,从长远来看,您的教育和培训将比您多工作三天能给公司带来更大的收益。

结论 (Conclusion)

As you can see, the installation has gone a long way since last year. The system has been upgraded to a great extent, Symfony’s DX program helped with the multi-platform aspect and the symlink problems, and the excellent work of NetGen and @vranac has improved the flow immeasurably. Go ahead and install eZ now, play with it, tell us what you think. Use it to boot up a CMS that needs more than a blog and let us know how you feel about it. If you do something interesting with it, get in touch, I’d love more eZ tutorials!

如您所见,自去年以来安装已经走了很长一段路。 该系统已得到很大程度的升级,Symfony的DX程序解决了多平台方面的问题和symlink问题, NetGen和@vranac的出色工作极大地改善了流程。 继续并立即安装eZ,试用它,告诉我们您的想法。 使用它来启动需要比博客更多的CMS,并告诉我们您的感受。 如果您对此做一些有趣的事情,请联系我们,我希望有更多的eZ教程!

Feedback? Comments? Leave them below or tell me live at PHP Summer Camp!

反馈? 注释? 让他们留在下面,或者告诉我住在PHP夏令营 !

翻译自: https://www.sitepoint.com/getting-started-ez-platform-vagrant/

vagrant入门

vagrant入门_eZ Platform在Vagrant上的入门相关推荐

  1. vagrant系列教程(二):vagrant的配置文件vagrantfile详解(转)

    原文:http://blog.csdn.net/hel12he/article/details/51089774 上一篇文章完整的讲叙了如何安装一个vagrant的环境.这里主要说一说vagrant的 ...

  2. Vagrant系列(一)----win10搭建Vagrant+VirtualBox环境

    一.Vagrant是什么?     vagrant是一个操作虚拟机的工具.是一个基于Ruby的工具,用于创建和部署虚拟化开发环境.    通过命令和配置文件来管理虚拟机,很快就能完成一套开发环境的部署 ...

  3. 3分钟入门python_3分钟学完Python,直接从入门到精通「史上最强干货库」

    作为帅气小编,我已经把python一些模块的甩在这儿了qwq,只要你拿到这些干货,包你玩转python,直接冲向"大佬"的段位,如果已经学了C或者C++或者说如果你需要你的一段关键 ...

  4. Windows7下按装使用vagrant踩坑总结及Vagrant常见镜像简单配置

    软件版本一定不要太高: vagrant_1.8.0 VirtualBox-5.0.40-115130-Win 通过测试 要在PATH系统变量中加入一堆路径: powershell:C:\Windows ...

  5. 超详细Redis入门教程——Redis命令(上)

    前言 本文小新为大家带来 超详细Redis入门教程--Redis命令(上) 相关知识,具体内容包括Redis 基本命令,Key 操作命令,String 型 Value 操作命令,Hash 型 Valu ...

  6. 菜鸟教程php 文件上传,php入门学习知识点三 PHP上传

    if(is_uploaded_file($_FILES["Imgs"]["tmp_name"])){ $phpupfile=$_FILES["Imgs ...

  7. OpenCV Java入门二 在Windows10系统上安装OpenCV

    准备好痛苦了没有? 痛苦之后是欢乐.因为必竟大多人还是用的WINDOWS来开发的居多.因此如果OpenCV无法在Win10下安装,一样不能起到普及作用. 而Windows下的编译安装OpenCV也是最 ...

  8. SLAM导航机器人零基础实战系列:(二)ROS入门——10.在实际机器人上运行ROS高级功能预览...

    SLAM导航机器人零基础实战系列:(二)ROS入门--10.在实际机器人上运行ROS高级功能预览 摘要 ROS机器人操作系统在机器人应用领域很流行,依托代码开源和模块间协作等特性,给机器人开发者带来了 ...

  9. iPhone开发入门(10)— 设备上运行程序

    博主:易飞扬 原文链接 : http://www.yifeiyang.net/introduction-to-iphone-development-10-devices-running-the-pro ...

最新文章

  1. python3 获取当前目录和上级目录
  2. 一个不错的权限管理模块设计案例
  3. A*寻径算法新手入门(转载)
  4. [转载]内容首页设计经验
  5. Beaglebone Back学习三(开发环境搭建)
  6. C语言 十进制和二进制相互转换 - C语言零基础入门教程
  7. C#操作DOS命令,并获取处理返回值
  8. linux 删除和安装java
  9. python制作词云图设置停用词,Python生成词云图
  10. redis中集群的故障恢复
  11. apollo代码学习1
  12. Spring源码下载并导入Idea
  13. 火狐浏览器扩展程序源代码的查看
  14. 工具开发——端口开放扫描
  15. 基于STM32单片机的FM调频TEA5767功放收音机方案原理图设计
  16. SQL Server 替换
  17. springboot 相同类名但不同包,报错non-compatible bean definition of same name and class
  18. mysql移植海思_live555 交叉编译移植到海思开发板
  19. 计算机课堂教学的评价,课堂教学评价表
  20. 梦想实现_实现梦想的软件工程工作需要什么

热门文章

  1. 全球失明的主要原因之一是什么?
  2. SpringBoot2.1.1集成FineReport
  3. 简述Veeam备份原理和组件功能
  4. 微信网页下载无效 微信无法打开分享的链接的解决方案
  5. CDOJ 1321柱爷的恋爱 (区间dp)
  6. 最全最详细的APP运营推广策划方案
  7. linux分配活动分区,活动分区与最后分区确定的批处理(DOS/omnifs版)
  8. 【死磕JVM】什么是JVM调优?
  9. 一步步实现Android MQTT详细步骤,附工程文件
  10. python 可以根据元素值删除的是_python中删除某个元素的方法解析