Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Rob Allen:
Simple Ansible file for Z-Ray preview
Sep 15, 2015 @ 15:12:07

For those wanting to check out the latest preview of the Zend Z-Ray stand-alone version, Rob Allen has posted a full Ansible script to help building the environment much easier.

Recently, Zend made available a Z-Ray Technology Preview which takes the Z-Ray feature of Zend Server and makes it stand-alone. This is very interesting as it means that I can run it with the PHP 5.6 on Ubuntu 14.04 LTS Vagrant set up that I prefer. I decided to create an Ansible playbook to install Z-Ray into my VM. The Z-Ray instructions are clear enough, so it was simply a case of converting them to a set of YAML steps as who wants to do manual installation nowadays?!

The configuration is set up to run on a Ubuntu machine with PHP 5.6 installed. It will download the Z-Ray plugin, extract it and copy over all necessary configuration files to get it up and running. This stand-alone version can help to make debugging your applications simpler with real-time information right in your browser.

tagged: zray preview standalone version ansible configuration ubuntu php56

Link: http://akrabat.com/simple-ansible-file-for-z-ray-preview/

DigitalOcean Community Blog:
How To Deploy a Basic PHP Application using Ansible, Part2
Jun 26, 2015 @ 14:53:33

Digital Ocean has continued their series about deploying "advanced PHP applications" on an Ubuntu instance via Ansible in part two of the series. If you missed the first part of the series, you can check it out here.

This tutorial is the second in a series about deploying PHP applications using Ansible on Ubuntu 14.04. The first tutorial covers the basic steps for deploying an application, and is a starting point for the steps outlined in this tutorial.

In this tutorial we will cover setting up SSH keys to support code deployment/publishing tools, configuring the system firewall, provisioning and configuring the database (including the password!), and setting up task schedulers (crons) and queue daemons. The goal at the end of this tutorial is for you to have a fully working PHP application server with the aforementioned advanced configuration.

You'll need to finish the first tutorial if you want to follow along here. They pick up where they left off to finish the whole process, starting with a switch to a more advanced example repository. They modify the Ansible configuration and run the playbook to update the host. From there they break things down into several more steps:

  • Setting up SSH Keys for Deployment
  • Configuring the Firewall
  • Installing the MySQL Packages
  • Setting up the MySQL Database
  • Configuring the PHP Application for the Database
  • Migrating the Database
  • Configuring cron Tasks
  • Configuring the Queue Daemon

While a good bit of these steps relate to something Laravel needs (what they use for the sample application), it's still a good overview of the wide range of things you can do with Ansible during deployment.

tagged: deploy ansible digitalocean setup tutorial configure laravel framework part2

Link: https://www.digitalocean.com/community/tutorials/how-to-deploy-an-advanced-php-application-using-ansible-on-ubuntu-14-04

DigitalOcean Community Blog:
How To Deploy a Basic PHP Application using Ansible on Ubuntu 14.04
May 13, 2015 @ 15:15:16

If you've ever been interested in learning Ansible and how to use it in deploying your PHP applications, you should check out this new tutorial from Stephen Rees-Carter on the DigitalOcean blog. He walks you through the full process for getting the server and application set up and configured just the way you need it (on a Ubuntu server).

This tutorial covers the process of provisioning a basic PHP application using Ansible. The goal at the end of this tutorial is to have your new web server serving a basic PHP application without a single SSH connection or manual command run on the target Droplet. We will be using the Laravel framework as an example PHP application, but these instructions can be easily modified to support other frameworks and applications if you already have your own.

He starts with a list of the things you'll already need installed and things to know including a basic understanding of Ansible and two servers (they use their own Droplets in the examples). From there, they walk you through a seven step process to get the automated deployment up and running:

  • Installing Ansible
  • Installing Required Packages
  • Modifying System Configuration Files
  • Cloning the Git Repository
  • Creating an Application with Composer
  • Updating Environment Variables
  • Configuring Nginx

Some of the steps here are Laravel-specific as mentioned but if you're familiar with the setup of your own application, it's pretty easy to adapt. Each step includes the configuration changes and commands you'll need to complete it.

tagged: deploy ansible digitalocean setup tutorial configure laravel framework

Link: https://www.digitalocean.com/community/tutorials/how-to-deploy-a-basic-php-application-using-ansible-on-ubuntu-14-04

Rob Allen:
Installing XHGui via Ansible
Apr 14, 2015 @ 15:50:47

Rob Allen has posted a guide to his site today showing how to install XHGui via Ansible. XHGui is a graphical interface to view the results of XHProf, a performance evaluation tool.

I'm still using Ansible to provision Vagrant VMs. This is how I added the XHGui profiler to my standard setup.

He walks you through the five steps his process follows to get the necessary software installed and configured to get up and running:

  • Install Composer
  • Install the uprofiler PHP extension
  • Install XHGui
  • Set up for profiling
  • Set up host for XHGui website

Each step includes the commands to execute or the lines to add/update to the configurations to get the system up and working.

tagged: tutorial install xhgui xhprof ansible build vagrant vm virtualmachine

Link: http://akrabat.com/installing-xhgui-via-ansible/

ServerGrove Blog:
Deployment of Symfony2 applications with Ansible
Apr 02, 2014 @ 15:41:54

The ServerGrove blog has a new post today showing you how to deploy Symfony2 applications using Ansible, an automation tool that uses "playbooks" to define steps.

Ansible is a powerful automation engine that simplifies deploying systems and apps. Its popularity has been rising rapidly as developers and system administrators look for simpler ways to manage servers and deploy applications. The selling points of Ansible are: simplicity, agentless and extensible.

ServerGrove, traditionally a Capistrano/Capifony user, decided to give Ansible a try. They include the steps to go through to get the correct environment set up and how to execute commands on the remote servers. There's also an example of a sample task that updates packages on the remote server, moves a config file into place and restarts Apache. With this foundation, they get into the actual Symfony2 deployment, sharing their custom role that sets up the directory, clones the Git repository, runs Composer and executes an Assetic dump.

tagged: ansible tutorial introduction automation symfony2 deploy

Link: http://blog.servergrove.com/2014/04/01/deployment-symfony2-applications-ansible

Alex Bilbie:
Using Vagrant and Ansible for distributing educational course virtual machines
Dec 20, 2013 @ 17:23:40

in his latest post Alex Bilbie shares a guide for the steps he follows to create virtual machines for an educational course using Vagrant and Ansible with a PHP+Apache environment set up and ready to go.

In "Cursory Thoughts on Virtual Machines in Distance Education Courses" Tony discuses using virtual machines in courses to help distribute software and operating systems to students who increasingly more and more are bringing in very different devices. [...] At the very end of the article Tony mentions using Vagrant which is a small piece of software to help "create and configure lightweight, reproducible, and portable development environments". [...] A better option [for managing VM deployment] would be to use another devops tool called Ansible which "is a powerful automation engine that makes systems and apps simple to deploy".

He includes both a sample Vagrantfile for configuring Vagrant and a YAML configuration for Ansible that sets up the VM, opens the needed ports and installs and configures the needed software.

Together the playbooks and the Vagrantfile can be distributed to the students and assuming they've installed Vagrant and Virtualbox for their OS they can be up and running with identical environments in just a few minutes.
tagged: vagrant virtualmachine vm ansible configuration example

Link: http://alexbilbie.com/2013/12/vagrant-ansible-courses/

Qandidate.com:
Setting up XHProf/XHGui profiling with Ansible
Nov 28, 2013 @ 23:56:51

On the Qandidate.com blog there's a new post showing how to set up the PHP profiling tool XHProf/XHGui using Ansible for setup and configuration. Ansible is a radically simple IT orchestration engine that makes your applications and systems easier to deploy.

Once in a while I think about profiling my web applications to see if I can get them to run faster. There are cool tools out there like XHProf and XHGUI to help you do exactly that. And then I remember it took me quite some time to get it all set up... But now that I've started using Ansible I decided to document the set up process and share it with you. Today I will walk you through my Ansible role for setting up everything you need for profiling your first PHP script.

He starts with a checklist of things to be sure you have installed first (including XHProf and XHGui) and links to his yml configuration to run a "profiling" command. An example of the result (the XHGui HTML output) is also included.

tagged: xhprof xhgui ansible install configure tutorial

Link: http://labs.qandidate.com/blog/2013/11/28/setting_up_xhprof_xhgui_profiling_with_ansible/

Reddit.com:
How do you manage many PHP projects? Lots of VMs?
Feb 22, 2013 @ 18:57:11

On Reddit.com there's a discussion that centers around the management of VMs and PHP projects in a multiple-checkout environments.

I have been using a Linux install for a couple years now and it has development checkouts (and matching databases + live data) for dozens of sites. Since I create a new virtual host for each site there hasn't been any problems piling more and more projects into this system. However, this computer won't last forever. [...] Should I setup a new VM + debian install for each project (seems like a lot of work). Should I just move everything to an external drive and point the MySQL data, MongoDB data, Nginx web folders to the attached drive? How do others handle this?

There's several suggestions made in the comments including things like:

  • Using Ansible for configuration management
  • Bundling the current linux install into one portable VM
  • Using Vagrant for VM management
  • Using source control that can be accessed from any device/VM

Have a VM management method you've found useful in your development? Share some about it here.

tagged: vm management opinion configuration vagrant ansible

Link:


Trending Topics: