1

Has anyone managed to get Pressflow built into a Vagrant box? I'm new to vagrant and am completely failing at this. Have looked into both Puppet and Chef to configure it (either would be fine) and can't seem to find a recipe that does the trick.

This example.make file seems to describe a way to do this with Puppet, but then I have the added complexity of putting Drush on the vagrant box and I'm not really even sure what to do with the ".make" file.

Any pointers are appreciated - thanks!

EDIT:

Here's the state of my Vagrantfile:

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant::Config.run do |config|

 # Every Vagrant virtual environment requires a box to build off of.
 config.vm.box = "quetzal64"

 # Boot with a GUI so you can see the screen. (Default is headless)
 # config.vm.boot_mode = :gui

 # Forward a port from the guest to the host, which allows for outside
 # computers to access the VM, whereas host only networking does not.
 config.vm.forward_port 80, 8080
 config.vm.forward_port 3036, 3037

 # somehow specify to use drush, puppet, and the example.make file?

end

and example.make:

; Core version
; ------------
core = 6.x

; API version
; ------------
api = 2

; Core project
; ------------
; Use Pressflow instead of Drupal core:
projects[pressflow][type] = "core"
projects[pressflow][download][type] = "file"
projects[pressflow][download][url] = "http://launchpad.net/pressflow/6.x/6.15.73/+download/pressflow-6.15.73.tar.gz"

1 Answer 1

0

After trying quite a few things, we ended up putting together a shell script to do the provisioning. Most of it is specific to our application, but here are the relevant excerpts for anyone who might want to try this:

(there is probably some configuration necessary that this script omits)

#!/bin/sh

cd ~

echo "Beginning fresh install..."
sudo apt-get update

echo "Installing base utilities..."
sudo apt-get -qq -y install zip unzip

# Install LAMP stack
echo "Installing LAMP stack..."
sudo apt-get -qq -y install tasksel && sudo tasksel install lamp-server
sudo apt-get -qq -y install php5-gd php-pear php5-xdebug php5-dev php5-curl
sudo a2enmod rewrite # Enable apache rewrite module

# Install pressflow if necessary
echo "Downloading and installing pressflow..."
wget -qNO /tmp/pressflow.tar.gz https://github.com/pressflow/6/archive/pressflow-6.26.109.tar.gz
sudo rm -rf /tmp/pressflow && mkdir /tmp/pressflow
tar -xzf /tmp/pressflow.tar.gz -C /tmp/pressflow
sudo rm -rf /tmp/pressflow/6-pressflow-6.26.109/sites/all
rsync -a /tmp/pressflow/6-pressflow-6.26.109/* ~/yoursitepath # !! Your Drupal directory here.
sudo rm -rf /tmp/pressflow /tmp/pressflow.tar.gz

# Update php.ini
echo "Updating PHP config options..."
PHPINILOC="/etc/php5/apache2/php.ini"
sudo sed -i 's/memory_limit = 128M/memory_limit = 1024M/g' $PHPINILOC
sudo sed -i '/error_reporting = E_ALL.*/c\error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT' $PHPINILOC

# Create database schemas
echo "Creating databases..."
mysql -uroot -e"CREATE DATABASE IF NOT EXISTS ourfa5_drupal; CREATE DATABASE IF NOT EXISTS stats;"

# Here, you'll probably need to download any default tables needed by your
#   application, update /etc/hosts, etc.. This portion of the script is
#   specific to our application so I've left it out.

# Restart apache for good measure
sudo service apache2 restart

sudo apt-get upgrade

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.