├── .gitattributes ├── .gitignore ├── CHANGELOG.md ├── README.md ├── Vagrantfile ├── config ├── apache-config │ ├── apache2.conf │ ├── php5-fpm.conf │ └── sites │ │ ├── local-apache-example.conf-sample │ │ └── wordpress-default.conf ├── apt-source-append.list ├── bash_aliases ├── bash_profile ├── homebin │ ├── makepot │ ├── xdebug_off │ └── xdebug_on ├── init │ └── vvv-start.conf ├── memcached-config │ └── memcached.conf ├── mysql-config │ ├── my.cnf │ └── root-my.cnf ├── php5-fpm-config │ ├── apc.ini │ ├── php-custom.ini │ ├── www.conf │ └── xdebug.ini ├── phpmyadmin-config │ └── config.inc.php ├── phpunit-composer.json ├── subversion-servers ├── vimrc └── wordpress-config │ ├── mu-plugins │ └── jf-cron-filter.php │ └── wp-tests-config.php ├── database ├── backups │ └── readme.txt ├── data │ └── readme.txt ├── import-sql.sh ├── init-custom.sql.sample └── init.sql ├── provision └── provision.sh └── www ├── .gitshow ├── default ├── index.php └── phpinfo │ └── index.php └── vvv-hosts /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | 3 | # Force provisioning script to use LF, even on Windows 4 | *.sh eol=lf -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Stuff that pops up locally for me - @jeremyfelt 2 | *.sublime* 3 | .DS_Store 4 | .idea 5 | 6 | # Because this really is a working directory, ignore vagrant's files 7 | /.vagrant 8 | 9 | # This is a file intended for hooking in a custom Vagrant configuration on up 10 | /Customfile 11 | 12 | # Allow for custom provisioning scripts that are not included with the repo 13 | /provision/provision-custom.sh 14 | /provision/provision-pre.sh 15 | /provision/provision-post.sh 16 | 17 | # No need to share individual site configs with each other 18 | /config/apache-config/sites/*.conf 19 | 20 | # Ignore anything in the 'custom' directory in config 21 | /config/custom/* 22 | 23 | # No need to share our mysql data with each other 24 | /database/data/* 25 | 26 | # No need to share our individual sites with each other 27 | /www/* 28 | 29 | # And no need to share individual SQL files with each other 30 | *.sql 31 | *.sql.gz 32 | 33 | # BUT.... 34 | 35 | # We do have some default site configs that should be included 36 | !/config/apache-config/sites/wordpress-default.conf 37 | 38 | # And we do have a default SQL file that should be included 39 | !/database/init.sql 40 | 41 | # And we provide our default host names in a dat file. 42 | !/www/vvv-hosts 43 | 44 | # And a few of our web directories are important to share. 45 | /www/default/* 46 | !/www/default/index.php -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Varying Vagrant Vagrants Changelog 2 | 3 | ## 1.0.1 4 | * Enable Apache's mod_rewrite. @props Dustin Filippini 5 | 6 | ## 1.0 7 | * **Introduce** [Auto Site Setup](https://github.com/10up/varying-vagrant-vagrants/wiki/Auto-site-Setup) during provisioning to allow for easy new project configuration. 8 | * **Happy Fix** `vagrant up` after halt meets expectations and no longer requires provisioning to be reapplied. 9 | * Begin implementing best practices from Google's [shell style guide](http://google-styleguide.googlecode.com/svn/trunk/shell.xml) in our provisioning scripts. 10 | * Databases can now be dropped in phpMyAdmin. Pro-tip, `drop database wordpress_develop` in phpMyAdmin followed by `vagrant provision` clears your src.wordpress-develop.dev for reinstall. 11 | * Copy config files instead of linking them. This allows for a nicer `vagrant up` after a `vagrant halt` and treats provisioning more like it should be treated. See [1fbf329](https://github.com/10up/varying-vagrant-vagrants/commit/1fbf32926e69b852d912047da1bfa7c302693b82) for a more detailed commit message. 12 | * Allow for `dashboard-custom.php` to override the default dashboard provided by VVV 13 | * Reduce size of the included `my.cnf` file to exclude unrequired changes. Increase `max_allowed_packet` setting. 14 | 15 | ## 0.9 16 | * **Possible Annoying:** Use `precise32` for the Vagrant box name for better cross project box caching. 17 | * **Note:** This will probably cause a new Vagrant box to download. Use `vagrant box remove std-precise32` after a `vagrant destroy` to remove the old one and start with this. 18 | * **Possible Breaking:** Change VM hostname to `vvv.dev` 19 | * **Note:** If you had anything setup to rely on the hostname of precise32-dev, this may break. 20 | * **Possible Breaking:** Change MySQL root password to `root` 21 | * **Note:** If anything is setup to rely on the previous password of `blank`, this may break. 22 | * You can also now access `mysql -u root` without a password. 23 | * **Introduce** support for the WordPress develop.svn 24 | * This was added pretty much the day it was available. Such a pleasure to work with! 25 | * Allowed us to remove the old `wordpress-unit-tests` in favor of the new `wordpress-develop/tests` 26 | * **Introduce** support for the Vagrant hostsupdater plugin 27 | * Use `vagrant plugin install vagrant-hostsupdater` to install. 28 | * Very, very much recommended for an easier and happier life. 29 | * **Introduce** Postfix with a default config. Mail works! (But check your spam) 30 | * **Introduce** the WordPress i18n Tools, including `config/homebin/makepot` 31 | * **Introduce** PHP_CodeSniffer, WordPress-Coding-Standards, and Webgrind 32 | * **Remove** entire well intended but not so useful flags system 33 | * Rather than include PHPMemcachedadmin in the VVV repository, download it on initial provision 34 | * Verify support for Vagrant 1.3.5 (as well as 1.2.x) and VirtualBox 4.3 (as well as 4.2.x) 35 | * Move `xdebug_on` and `xdebug_off` controls to executable files in `config/homebin` 36 | * Generate `vagrant_dir` in `Vagrantfile` for accessing relative file locations 37 | * Add a basic network connectivity check by pinging Google DNS servers 38 | * Update stable version of WordPress automatically on provision 39 | * General cleanup to screen output during provisioning 40 | * Many updates to the default nginx configuration 41 | * Remove poor, unused implementation of Watchr 42 | * Provide default certs for SSL in Nginx 43 | 44 | ## 0.8 45 | * Enable SSH agent forwarding 46 | * Wrap update/installation procedures with a network status check 47 | * Enable WP_DEBUG by default 48 | * Update wp-cli during provisioning 49 | * Better handling of package status checks 50 | * Better handling of custom apt sources 51 | * Add PHPMemcachedAdmin 1.2.2 to repository for memcached stats viewing. 52 | * Add phpMyAdmin 4.0.3 to repository for database management 53 | 54 | ## 0.7 55 | 56 | **BREAKING CHANGES**: Breaking changes are made in this release due to the reorganization of config files for PHP that will require a full `vagrant destroy` and `vagrant up` to resolve. 57 | 58 | * Refactor of package provisioning allows for better (and incremental) `vagrant provision` uses by checking individual package installs before attempting to install them again. 59 | * Remove several flags used to disable portions of provisioning. This favors the scaffold approach provided by VVV. 60 | * Improved nginx configuration and documentation 61 | * Use --asume-yes vs --force-yes with apt 62 | * Update Composer based on a specific revision rather than always checking for an update. 63 | * Update Mockery based on a specific version rather than using the dev channel. 64 | * Update [ack-grep](http://beyondgrep.com) to 2.04 65 | * Add php5-imap package 66 | * Update to Nginx 1.4 sources 67 | * Update to PHP 5.4 sources 68 | * Update to Git 1.8 sources 69 | * Updated xdebug configuration parameters, fixes 60s timeout issue 70 | * Better method to enable/disable xdebug configuration 71 | * Refactor handling of custom PHP, APC, and xdebug configurations 72 | * Bump default memcached memory allocation to 128M 73 | * Introduce custom `apc.ini` file, bump `apc.shm_size` to 128M 74 | * Provide a phpinfo URL at `http://192.168.50.4/phpinfo/` 75 | * Set WP_DEBUG to true by default for included installations of WordPress 76 | 77 | ## 0.6 78 | * Add [WordPress Unit Tests](http://unit-tests.svn.wordpress.org/trunk/) 79 | * Option for custom shell provisioning file 80 | * Pre/Post provisioning hooks via additional shell scripts 81 | * Flags system to disable portions of default provisioning 82 | * Grab stable WordPress from latest.tar.gz vs SVN 83 | * Append custom apt sources list to default 84 | * Update to SVN 1.7.9, addresses specific Windows permissions issue 85 | * Move [wp-cli](https://github.com/wp-cli/wp-cli) to /srv/www/ for easier contributions 86 | 87 | ## 0.5 88 | * Repository moved under [10up organization](http://github.com/10up/varying-vagrant-vagrants) 89 | * Wrap provisioning in an initial run flag, speed up subsequent boots 90 | * Add support for a Customfile to pull in desired local modifications 91 | 92 | ## 0.4 93 | * Add default .vimrc file with some helpful tricks 94 | * Clarify sample SQL commands 95 | * Add WordPress trunk installation to default setup 96 | * Use composer to install phpunit, mockery and xdebug - faster than PEAR 97 | * Filename modifications for config files 98 | * General documentation improvements 99 | 100 | ## 0.3 101 | * Add Mockery 102 | * Vagrant version requirement changes 103 | * Add wp-cli 104 | * Use wp-cli to setup default WordPress installation 105 | * Add subversion 106 | 107 | ## 0.2.1 108 | * Bug fix on importing SQL files 109 | 110 | ## 0.2 111 | * Add ack-grep 112 | * Move to Vagrant 1.1 style Vagrantfile 113 | * Better DB handling all around 114 | * Link mysql data directories for persistence 115 | * Add PHPUnit 116 | * Add XDebug 117 | 118 | ## 0.1 119 | * Initial version, lots of junk from untracked versions. :) 120 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Varying Vagrant Vagrants - Apache Edition 2 | 3 | **This project is not actively maintained and exists on GitHub only for archival purposes!** 4 | 5 | Varying Vagrant Vagrants is an evolving [Vagrant](http://vagrantup.com) configuration focused on [WordPress](http://wordpress.org) development. 6 | 7 | * **Version**: 1.0 8 | * **Contributors**: [@jeremyfelt](http://github.com/jeremyfelt), [@carldanley](http://github.com/carldanley), [@ericmann](http://github.com/ericmann), [@lkwdwrd](http://github.com/lkwdwrd), [@TheLastCicada](http://github.com/TheLastCicada), [@tddewey](http://github.com/tddewey), [@johnpbloch](http://github.com/johnpbloch), [@kadamwhite](http://github.com/kadamwhite), [@scribu](http://github.com/scribu), [@danielbachhuber](http://github.com/danielbachhuber), [@tollmanz](http://github.com/tollmanz), [@mbijon](http://github.com/mbijon), [@markjaquith](http://github.com/markjaquith), [@curtismchale](http://github.com/curtismchale), [@Mamaduka](http://github.com/mamaduka), [@lgedeon](http://github.com/lgedeon), [@pmgarman](http://github.com/pmgarman), [@westonruter](http://github.com/westonruter), [@petemall](http://github.com/petemall), [@cmmarslender](http://github.com/cmmarslender), [@mintindeed](http://github.com/mintindeed), [@mboynes](http://github.com/mboynes), [@aaronjorbin](http://github.com/aaronjorbin), [@tobiasbg](http://github.com/tobiasbg), [@simonwheatley](http://github.com/simonwheatley), [@ocean90](http://github.com/ocean90), [@lvnilesh](http://github.com/lvnilesh), [@alexw23](http://github.com/alexw23), [@zamoose](https://github.com/zamoose), [@leewillis77](https://github.com/leewillis77), [@imichaeli](https://github.com/imichaeli), [@andrezrv](https://github.com/andrezrv), [@cadwell](https://github.com/cadwell), [@cfoellmann](https://github.com/cfoellmann), [@westi](https://github.com/westi), [@ryanduff](https://github.com/ryanduff) 9 | * **Contributing**: Contributions are more than welcome. Please submit pull requests against the [master branch](https://github.com/10up/varying-vagrant-vagrants). Thanks! 10 | 11 | ## Overview 12 | 13 | ### The Purpose of Varying Vagrant Vagrants 14 | 15 | The primary goal of Varying Vagrant Vagrants (VVV) is to provide an approachable way for developers to begin working in a development environment that matches a production environment as closely as possible. 16 | 17 | The default server configuration provisioned by VVV is intended to match a common configuration for working with high traffic WordPress sites. 18 | 19 | The default WordPress configurations provided by VVV are intended to create an environment ideal for developing themes and plugins as well as for contributing to WordPress core. 20 | 21 | ### How to Use Varying Vagrant Vagrants 22 | 23 | #### VVV as a MAMP/XAMPP Replacement 24 | 25 | VVV is ready to use as is. Download or clone VVV and then type `vagrant up` to automatically build a sandboxed Ubuntu server on your computer containing everything needed to contribute to WordPress core or develop a WordPress theme or plugin. 26 | 27 | Multiple projects can be developed at once in the same environment. 28 | 29 | * Use the `wordpress-develop` directory to participate in [WordPress core](http://core.trac.wordpress.org) development. 30 | * Use `wp-content/themes` in either the `wordpress-default` or `wordpress-trunk` directories to develop multiple themes. 31 | * Use `wp-content/plugins` in either the `wordpress-default` or `wordpress-trunk` directories to develop plugins. 32 | * Take advantage of VVV's [auto site configuration](https://github.com/10up/varying-vagrant-vagrants/wiki/Auto-site-Setup) to provision additional instances of WordPress in `/srv/www/`. 33 | 34 | #### VVV as a Scaffold 35 | 36 | Entirely different server configurations can be created by modifying the files included with VVV and through the use of additional [Auto Site Setup](https://github.com/10up/varying-vagrant-vagrants/wiki/Auto-site-Setup) provisioning scripts. 37 | 38 | It is not necessary to track the changes made to the main repository. Feel free to check this project out and then change everything to make it your own. 39 | 40 | ### The Future of Varying Vagrant Vagrants 41 | 42 | Immediate goals for VVV include: 43 | 44 | * Continue to work towards a stable state of software and configuration included in the default provisioning. 45 | * Provide excellent and clear documentation throughout VVV to aid in both learning and scaffolding. 46 | 47 | ## Getting Started 48 | 49 | ### What is Vagrant? 50 | 51 | [Vagrant](http://www.vagrantup.com) is a "tool for building and distributing development environments". It works with [virtualization](http://en.wikipedia.org/wiki/X86_virtualization) software such as [VirtualBox](https://www.virtualbox.org/) to provide a virtual machine that is sandboxed away from your local environment. 52 | 53 | ### The First Vagrant Up 54 | 55 | 1. Start with any operating system. 56 | 1. Install [VirtualBox 4.2.x](https://www.virtualbox.org/wiki/Download_Old_Builds_4_2) or [VirtualBox 4.3.4](https://www.virtualbox.org/wiki/Downloads) 57 | * Major portions of VirtualBox were rewritten for 4.3, and it's possible that there are still bugs to be shaken out. VVV is completely compatible with earlier versions of VirtualBox, so 4.2.18 or earlier would be just fine. Do note that Vagrant had specific issues with 4.2.16. Going as far back as 4.2.10 will likely be of no issue. 58 | * VVV itself leans in the 4.3.x direction in the master branch to stay ahead of the curve. 59 | 1. Install [Vagrant 1.4.0](http://www.vagrantup.com/downloads.html) 60 | * `vagrant` will now be available as a command in your terminal, try it out. 61 | * ***Note:*** If Vagrant is already installed, use `vagrant -v` to check the version. You may want to consider upgrading if a much older version is in use. 62 | * ***Note:*** If VirtualBox 4.3.x is installed, Vagrant 1.3.5 or later is required. 63 | 1. Install the [vagrant-hostsupdater](https://github.com/cogitatio/vagrant-hostsupdater) plugin with `vagrant plugin install vagrant-hostsupdater` 64 | * Note: This step is not a requirement, though it does make the process of starting up a virtual machine nicer by automating the entries needed in your local machine's `hosts` file to access the provisioned VVV domains in your browser. 65 | * If you choose not to install this plugin, a manual entry should be added to your local `hosts` file that looks like this: `192.168.50.4 vvv.dev local.wordpress.dev local.wordpress-trunk.dev src.wordpress-develop.dev build.wordpress-develop.dev` 66 | 1. Clone or extract the Varying Vagrant Vagrants project into a local directory 67 | * `git clone git://github.com/ericmann/vvv-apache.git vagrant-local` 68 | * OR download and extract the repository master [zip file](https://github.com/ericmann/vvv-apache/archive/master.zip) 69 | * OR grab a [stable release](https://github.com/ericmann/vvv-apache/releases) if you'd like some extra comfort. 70 | 1. Change into the new directory with `cd vagrant-local` 71 | 1. Start the Vagrant environment with `vagrant up` 72 | * Be patient as the magic happens. This could take a while on the first run as your local machine downloads the required files. 73 | * Watch as the script ends, as an administrator or `su` ***password may be required*** to properly modify the hosts file on your local machine. 74 | 1. Visit any of the following default sites in your browser: 75 | * [http://local.wordpress.dev/](http://local.wordpress.dev/) for WordPress stable 76 | * [http://local.wordpress-trunk.dev/](http://local.wordpress-trunk.dev/) for WordPress trunk 77 | * [http://src.wordpress-develop.dev/](http://src.wordpress-develop.dev/) for trunk WordPress development files 78 | * [http://build.wordpress-develop.dev/](http://build.wordpress-develop.dev/) for the version of those development files built with Grunt 79 | * [http://vvv.dev/](http://vvv.dev/) for a default dashboard containing several useful tools 80 | 81 | Fancy, yeah? 82 | 83 | ### What Did That Do? 84 | 85 | The first time you run `vagrant up`, a packaged box containing a basic virtual machine is downloaded to your local machine and cached for future use. The file used by Varying Vagrant Vagrants contains an installation of Ubuntu 12.04 and is about 280MB. 86 | 87 | After this box is downloaded, it begins to boot as a sandboxed virtual machine using VirtualBox. Once booted, it runs the provisioning script included with VVV. This initiates the download and installation of around 100MB of packages on the new virtual machine. 88 | 89 | The time for all of this to happen depends a lot on the speed of your Internet connection. If you are on a fast cable connection, it will likely only take several minutes. 90 | 91 | On future runs of `vagrant up`, the packaged box will be cached on your local machine and Vagrant will only need to apply the requested provisioning. 92 | 93 | * ***Preferred:*** If the virtual machine has been powered off with `vagrant halt`, `vagrant up` will quickly power on the machine without provisioning. 94 | * ***Rare:*** If you would like to reapply the provisioning scripts with `vagrant up --provision` or `vagrant provision`, some time will be taken to check for updates and packages that have not been installed. 95 | * ***Very Rare:*** If the virtual machine has been destroyed with `vagrant destroy`, it will need to download the full 100MB of package data on the next `vagrant up`. 96 | 97 | ### Now What? 98 | 99 | Now that you're up and running, start poking around and modifying things. 100 | 101 | 1. Access the server via the command line with `vagrant ssh` from your `vagrant-local` directory. You can do almost anything you would do with a standard Ubuntu installation on a full server. 102 | * **MS Windows users:** An SSH client is generally not distributed with Windows PCs by default. However, a terminal emulator such as [PuTTY](http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html) will provide access immediately. For detailed instructions on connecting with PuTTY, consult the [VVV Wiki](https://github.com/10up/varying-vagrant-vagrants/wiki/Connect-to-Your-Vagrant-Virtual-Machine-with-PuTTY). 103 | 1. Power off the box with `vagrant halt` and turn it back on with `vagrant up`. 104 | 1. Suspend the box's state in memory with `vagrant suspend` and bring it right back with `vagrant resume`. 105 | 1. Reapply provisioning to a running box with `vagrant provision`. 106 | 1. Destroy the box with `vagrant destroy`. Files added in the `www` directory will persist on the next `vagrant up`. 107 | 1. Start modifying and adding local files to fit your needs. Take a look at [Auto Site Setup](https://github.com/10up/varying-vagrant-vagrants/wiki/Auto-site-Setup) for tips on adding new projects. 108 | 109 | #### Caveats 110 | 111 | The network configuration picks an IP of 192.168.50.4. This works if you are *not* on the 192.168.50.x sub domain, it could cause conflicts on your existing network if you *are* on a 192.168.50.x sub domain already. You can configure any IP address in the `Vagrantfile` and it will be used on the next `vagrant up` 112 | 113 | ### Credentials and Such 114 | 115 | All database usernames and passwords for WordPress installations included by default are `wp` and `wp`. 116 | 117 | All WordPress admin usernames and passwords for WordPress installations included by default are `admin` and `password`. 118 | 119 | #### WordPress Stable 120 | * URL: `http://local.wordpress.dev` 121 | * DB Name: `wordpress_default` 122 | 123 | #### WordPress Trunk 124 | * URL: `http://local.wordpress-trunk.dev` 125 | * DB Name: `wordpress_trunk` 126 | 127 | #### WordPress Develop 128 | * /src URL: `http://src.wordpress-develop.dev` 129 | * /build URL: `http://build.wordpress-develop.dev` 130 | * DB Name: `wordpress_develop` 131 | * DB Name: `wordpress_unit_tests` 132 | 133 | #### MySQL Root 134 | * User: `root` 135 | * Pass: `root` 136 | * See: [Connecting to MySQL](https://github.com/10up/varying-vagrant-vagrants/wiki/Connecting-to-MySQL) from your local machine 137 | 138 | ### What do you get? 139 | 140 | A bunch of stuff! 141 | 142 | 1. [Ubuntu](http://www.ubuntu.com/) 12.04 LTS (Precise Pangolin) 143 | 1. [WordPress Develop](http://develop.svn.wordpress.org/trunk/) 144 | 1. [WordPress Stable](http://wordpress.org/) 145 | 1. [WordPress Trunk](http://core.svn.wordpress.org/trunk/) 146 | 1. [WP-CLI](http://wp-cli.org/) 147 | 1. [Apache](http://httpd.apache.org/) 2.4.x 148 | 1. [mysql](http://www.mysql.com/) 5.5.x 149 | 1. [php-fpm](http://php-fpm.org/) 5.4.x 150 | 1. [memcached](http://memcached.org/) 1.4.13 151 | 1. PHP [memcache extension](http://pecl.php.net/package/memcache/3.0.8/) 3.0.8 152 | 1. PHP [xdebug extension](http://pecl.php.net/package/xdebug/2.2.3/) 2.2.3 153 | 1. PHP [imagick extension](http://pecl.php.net/package/imagick/3.1.0RC2/) 3.1.0RC2 154 | 1. [xdebug](http://xdebug.org/) 2.2.3 155 | 1. [PHPUnit](http://pear.phpunit.de/) 3.7.24 156 | 1. [ack-grep](http://beyondgrep.com/) 2.04 157 | 1. [git](http://git-scm.com/) 1.8.5 158 | 1. [subversion](http://subversion.apache.org/) 1.7.9 159 | 1. [ngrep](http://ngrep.sourceforge.net/usage.html) 160 | 1. [dos2unix](http://dos2unix.sourceforge.net/) 161 | 1. [Composer](https://github.com/composer/composer) 162 | 1. [phpMemcachedAdmin](https://code.google.com/p/phpmemcacheadmin/) 1.2.2 BETA 163 | 1. [phpMyAdmin](http://www.phpmyadmin.net/) 4.0.10 (multi-language) 164 | 1. [Webgrind](https://github.com/jokkedk/webgrind) 165 | 1. [NodeJs](http://nodejs.org/) Current Stable Version 166 | 1. [grunt-cli](https://github.com/gruntjs/grunt-cli) Current Stable Version 167 | 168 | ### Need Help? 169 | 170 | * Let us have it! Don't hesitate to open a new issue on GitHub if you run into trouble or have any tips that we need to know. 171 | * There is a [Mailing list](https://groups.google.com/forum/#!forum/wordpress-and-vagrant) for any topic related to WordPress and Vagrant that is a great place to get started. 172 | * The [VVV Wiki](https://github.com/10up/varying-vagrant-vagrants/wiki) also contains documentation that may help. 173 | 174 | ### More Context 175 | 176 | * [Varying Vagrant Vagrants](http://jeremyfelt.com/code/2012/12/11/varying-vagrant-vagrants/), where it all started. 177 | * [Hi WordPress, Meet Vagrant](http://jeremyfelt.com/code/2013/04/08/hi-wordpress-meet-vagrant/), the blog post. 178 | * [Hi WordPress, Meet Vagrant](http://wordpress.tv/2013/10/19/jeremy-felt-hi-wordpress-meet-vagrant/), the talk at WordCamp Vancouver. 179 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | dir = Dir.pwd 5 | vagrant_dir = File.expand_path(File.dirname(__FILE__)) 6 | 7 | Vagrant.configure("2") do |config| 8 | 9 | # Store the current version of Vagrant for use in conditionals when dealing 10 | # with possible backward compatible issues. 11 | vagrant_version = Vagrant::VERSION.sub(/^v/, '') 12 | 13 | # Configurations from 1.0.x can be placed in Vagrant 1.1.x specs like the following. 14 | config.vm.provider :virtualbox do |v| 15 | v.customize ["modifyvm", :id, "--memory", 512] 16 | end 17 | 18 | # Forward Agent 19 | # 20 | # Enable agent forwarding on vagrant ssh commands. This allows you to use identities 21 | # established on the host machine inside the guest. See the manual for ssh-add 22 | config.ssh.forward_agent = true 23 | 24 | # Default Ubuntu Box 25 | # 26 | # This box is provided by Vagrant at vagrantup.com and is a nicely sized (290MB) 27 | # box containing the Ubuntu 12.0.4 Precise 32 bit release. Once this box is downloaded 28 | # to your host computer, it is cached for future use under the specified box name. 29 | config.vm.box = "precise32" 30 | config.vm.box_url = "http://files.vagrantup.com/precise32.box" 31 | 32 | config.vm.hostname = "vvv" 33 | 34 | # Local Machine Hosts 35 | # 36 | # If the Vagrant plugin hostsupdater (https://github.com/cogitatio/vagrant-hostsupdater) is 37 | # installed, the following will automatically configure your local machine's hosts file to 38 | # be aware of the domains specified below. Watch the provisioning script as you may be 39 | # required to enter a password for Vagrant to access your hosts file. 40 | # 41 | # By default, we'll include the domains setup by VVV through the vvv-hosts file 42 | # located in the www/ directory. 43 | # 44 | # Other domains can be automatically added by including a vvv-hosts file containing 45 | # individual domains separated by whitespace in subdirectories of www/. 46 | if defined? VagrantPlugins::HostsUpdater 47 | 48 | # Capture the paths to all vvv-hosts files under the www/ directory. 49 | paths = [] 50 | Dir.glob(vagrant_dir + '/www/**/vvv-hosts').each do |path| 51 | paths << path 52 | end 53 | 54 | # Parse through the vvv-hosts files in each of the found paths and put the hosts 55 | # that are found into a single array. 56 | hosts = [] 57 | paths.each do |path| 58 | new_hosts = [] 59 | file_hosts = IO.read(path).split( "\n" ) 60 | file_hosts.each do |line| 61 | if line[0..0] != "#" 62 | new_hosts << line 63 | end 64 | end 65 | hosts.concat new_hosts 66 | end 67 | 68 | # Pass the final hosts array to the hostsupdate plugin so it can perform magic. 69 | config.hostsupdater.aliases = hosts 70 | 71 | end 72 | 73 | # Default Box IP Address 74 | # 75 | # This is the IP address that your host will communicate to the guest through. In the 76 | # case of the default `192.168.50.4` that we've provided, VirtualBox will setup another 77 | # network adapter on your host machine with the IP `192.168.50.1` as a gateway. 78 | # 79 | # If you are already on a network using the 192.168.50.x subnet, this should be changed. 80 | # If you are running more than one VM through VirtualBox, different subnets should be used 81 | # for those as well. This includes other Vagrant boxes. 82 | config.vm.network :private_network, ip: "192.168.50.4" 83 | 84 | # Drive mapping 85 | # 86 | # The following config.vm.synced_folder settings will map directories in your Vagrant 87 | # virtual machine to directories on your local machine. Once these are mapped, any 88 | # changes made to the files in these directories will affect both the local and virtual 89 | # machine versions. Think of it as two different ways to access the same file. When the 90 | # virtual machine is destroyed with `vagrant destroy`, your files will remain in your local 91 | # environment. 92 | 93 | # /srv/database/ 94 | # 95 | # If a database directory exists in the same directory as your Vagrantfile, 96 | # a mapped directory inside the VM will be created that contains these files. 97 | # This directory is used to maintain default database scripts as well as backed 98 | # up mysql dumps (SQL files) that are to be imported automatically on vagrant up 99 | config.vm.synced_folder "database/", "/srv/database" 100 | if vagrant_version >= "1.3.0" 101 | config.vm.synced_folder "database/data/", "/var/lib/mysql", :mount_options => [ "dmode=777", "fmode=777" ] 102 | else 103 | config.vm.synced_folder "database/data/", "/var/lib/mysql", :extra => 'dmode=777,fmode=777' 104 | end 105 | 106 | # /srv/config/ 107 | # 108 | # If a server-conf directory exists in the same directory as your Vagrantfile, 109 | # a mapped directory inside the VM will be created that contains these files. 110 | # This directory is currently used to maintain various config files for php and 111 | # Apache as well as any pre-existing database files. 112 | config.vm.synced_folder "config/", "/srv/config" 113 | 114 | # /srv/www/ 115 | # 116 | # If a www directory exists in the same directory as your Vagrantfile, a mapped directory 117 | # inside the VM will be created that acts as the default location for Apache sites. Put all 118 | # of your project files here that you want to access through the web server 119 | if vagrant_version >= "1.3.0" 120 | config.vm.synced_folder "www/", "/srv/www/", :owner => "www-data", :mount_options => [ "dmode=775", "fmode=774" ] 121 | else 122 | config.vm.synced_folder "www/", "/srv/www/", :owner => "www-data", :extra => 'dmode=775,fmode=774' 123 | end 124 | 125 | # Customfile - POSSIBLY UNSTABLE 126 | # 127 | # Use this to insert your own (and possibly rewrite) Vagrant config lines. Helpful 128 | # for mapping additional drives. If a file 'Customfile' exists in the same directory 129 | # as this Vagrantfile, it will be evaluated as ruby inline as it loads. 130 | # 131 | # Note that if you find yourself using a Customfile for anything crazy or specifying 132 | # different provisioning, then you may want to consider a new Vagrantfile entirely. 133 | if File.exists?(File.join(vagrant_dir,'Customfile')) then 134 | eval(IO.read(File.join(vagrant_dir,'Customfile')), binding) 135 | end 136 | 137 | # Provisioning 138 | # 139 | # Process one or more provisioning scripts depending on the existence of custom files. 140 | # 141 | # provison-pre.sh acts as a pre-hook to our default provisioning script. Anything that 142 | # should run before the shell commands laid out in provision.sh (or your provision-custom.sh 143 | # file) should go in this script. If it does not exist, no extra provisioning will run. 144 | if File.exists?(File.join(vagrant_dir,'provision','provision-pre.sh')) then 145 | config.vm.provision :shell, :path => File.join( "provision", "provision-pre.sh" ) 146 | end 147 | 148 | # provision.sh or provision-custom.sh 149 | # 150 | # By default, Vagrantfile is set to use the provision.sh bash script located in the 151 | # provision directory. If it is detected that a provision-custom.sh script has been 152 | # created, that is run as a replacement. This is an opportunity to replace the entirety 153 | # of the provisioning provided by default. 154 | if File.exists?(File.join(vagrant_dir,'provision','provision-custom.sh')) then 155 | config.vm.provision :shell, :path => File.join( "provision", "provision-custom.sh" ) 156 | else 157 | config.vm.provision :shell, :path => File.join( "provision", "provision.sh" ) 158 | end 159 | 160 | # provision-post.sh acts as a post-hook to the default provisioning. Anything that should 161 | # run after the shell commands laid out in provision.sh or provision-custom.sh should be 162 | # put into this file. This provides a good opportunity to install additional packages 163 | # without having to replace the entire default provisioning script. 164 | if File.exists?(File.join(vagrant_dir,'provision','provision-post.sh')) then 165 | config.vm.provision :shell, :path => File.join( "provision", "provision-post.sh" ) 166 | end 167 | end 168 | -------------------------------------------------------------------------------- /config/apache-config/apache2.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Based upon the NCSA server configuration files originally by Rob McCool. 3 | # 4 | # This is the main Apache server configuration file. It contains the 5 | # configuration directives that give the server its instructions. 6 | # See http://httpd.apache.org/docs/2.2/ for detailed information about 7 | # the directives. 8 | # 9 | # Do NOT simply read the instructions in here without understanding 10 | # what they do. They're here only as hints or reminders. If you are unsure 11 | # consult the online docs. You have been warned. 12 | # 13 | # The configuration directives are grouped into three basic sections: 14 | # 1. Directives that control the operation of the Apache server process as a 15 | # whole (the 'global environment'). 16 | # 2. Directives that define the parameters of the 'main' or 'default' server, 17 | # which responds to requests that aren't handled by a virtual host. 18 | # These directives also provide default values for the settings 19 | # of all virtual hosts. 20 | # 3. Settings for virtual hosts, which allow Web requests to be sent to 21 | # different IP addresses or hostnames and have them handled by the 22 | # same Apache server process. 23 | # 24 | # Configuration and logfile names: If the filenames you specify for many 25 | # of the server's control files begin with "/" (or "drive:/" for Win32), the 26 | # server will use that explicit path. If the filenames do *not* begin 27 | # with "/", the value of ServerRoot is prepended -- so "foo.log" 28 | # with ServerRoot set to "/etc/apache2" will be interpreted by the 29 | # server as "/etc/apache2/foo.log". 30 | # 31 | 32 | ### Section 1: Global Environment 33 | # 34 | # The directives in this section affect the overall operation of Apache, 35 | # such as the number of concurrent requests it can handle or where it 36 | # can find its configuration files. 37 | # 38 | 39 | # 40 | # ServerRoot: The top of the directory tree under which the server's 41 | # configuration, error, and log files are kept. 42 | # 43 | # NOTE! If you intend to place this on an NFS (or otherwise network) 44 | # mounted filesystem then please read the LockFile documentation (available 45 | # at ); 46 | # you will save yourself a lot of trouble. 47 | # 48 | # Do NOT add a slash at the end of the directory path. 49 | # 50 | #ServerRoot "/etc/apache2" 51 | ServerName localhost 52 | 53 | # 54 | # The accept serialization lock file MUST BE STORED ON A LOCAL DISK. 55 | # 56 | LockFile ${APACHE_LOCK_DIR}/accept.lock 57 | 58 | # 59 | # PidFile: The file in which the server should record its process 60 | # identification number when it starts. 61 | # This needs to be set in /etc/apache2/envvars 62 | # 63 | PidFile ${APACHE_PID_FILE} 64 | 65 | # 66 | # Timeout: The number of seconds before receives and sends time out. 67 | # 68 | Timeout 300 69 | 70 | # 71 | # KeepAlive: Whether or not to allow persistent connections (more than 72 | # one request per connection). Set to "Off" to deactivate. 73 | # 74 | KeepAlive On 75 | 76 | # 77 | # MaxKeepAliveRequests: The maximum number of requests to allow 78 | # during a persistent connection. Set to 0 to allow an unlimited amount. 79 | # We recommend you leave this number high, for maximum performance. 80 | # 81 | MaxKeepAliveRequests 100 82 | 83 | # 84 | # KeepAliveTimeout: Number of seconds to wait for the next request from the 85 | # same client on the same connection. 86 | # 87 | KeepAliveTimeout 5 88 | 89 | ## 90 | ## Server-Pool Size Regulation (MPM specific) 91 | ## 92 | 93 | # prefork MPM 94 | # StartServers: number of server processes to start 95 | # MinSpareServers: minimum number of server processes which are kept spare 96 | # MaxSpareServers: maximum number of server processes which are kept spare 97 | # MaxClients: maximum number of server processes allowed to start 98 | # MaxRequestsPerChild: maximum number of requests a server process serves 99 | 100 | StartServers 5 101 | MinSpareServers 5 102 | MaxSpareServers 10 103 | MaxClients 150 104 | MaxRequestsPerChild 0 105 | 106 | 107 | # worker MPM 108 | # StartServers: initial number of server processes to start 109 | # MinSpareThreads: minimum number of worker threads which are kept spare 110 | # MaxSpareThreads: maximum number of worker threads which are kept spare 111 | # ThreadLimit: ThreadsPerChild can be changed to this maximum value during a 112 | # graceful restart. ThreadLimit can only be changed by stopping 113 | # and starting Apache. 114 | # ThreadsPerChild: constant number of worker threads in each server process 115 | # MaxClients: maximum number of simultaneous client connections 116 | # MaxRequestsPerChild: maximum number of requests a server process serves 117 | 118 | StartServers 2 119 | MinSpareThreads 25 120 | MaxSpareThreads 75 121 | ThreadLimit 64 122 | ThreadsPerChild 25 123 | MaxClients 150 124 | MaxRequestsPerChild 0 125 | 126 | 127 | # event MPM 128 | # StartServers: initial number of server processes to start 129 | # MinSpareThreads: minimum number of worker threads which are kept spare 130 | # MaxSpareThreads: maximum number of worker threads which are kept spare 131 | # ThreadsPerChild: constant number of worker threads in each server process 132 | # MaxClients: maximum number of simultaneous client connections 133 | # MaxRequestsPerChild: maximum number of requests a server process serves 134 | 135 | StartServers 2 136 | MinSpareThreads 25 137 | MaxSpareThreads 75 138 | ThreadLimit 64 139 | ThreadsPerChild 25 140 | MaxClients 150 141 | MaxRequestsPerChild 0 142 | 143 | 144 | # These need to be set in /etc/apache2/envvars 145 | User ${APACHE_RUN_USER} 146 | Group ${APACHE_RUN_GROUP} 147 | 148 | # 149 | # AccessFileName: The name of the file to look for in each directory 150 | # for additional configuration directives. See also the AllowOverride 151 | # directive. 152 | # 153 | 154 | AccessFileName .htaccess 155 | 156 | # 157 | # The following lines prevent .htaccess and .htpasswd files from being 158 | # viewed by Web clients. 159 | # 160 | 161 | Order allow,deny 162 | Deny from all 163 | Satisfy all 164 | 165 | 166 | # 167 | # DefaultType is the default MIME type the server will use for a document 168 | # if it cannot otherwise determine one, such as from filename extensions. 169 | # If your server contains mostly text or HTML documents, "text/plain" is 170 | # a good value. If most of your content is binary, such as applications 171 | # or images, you may want to use "application/octet-stream" instead to 172 | # keep browsers from trying to display binary files as though they are 173 | # text. 174 | # 175 | # It is also possible to omit any default MIME type and let the 176 | # client's browser guess an appropriate action instead. Typically the 177 | # browser will decide based on the file's extension then. In cases 178 | # where no good assumption can be made, letting the default MIME type 179 | # unset is suggested instead of forcing the browser to accept 180 | # incorrect metadata. 181 | # 182 | DefaultType None 183 | 184 | 185 | # 186 | # HostnameLookups: Log the names of clients or just their IP addresses 187 | # e.g., www.apache.org (on) or 204.62.129.132 (off). 188 | # The default is off because it'd be overall better for the net if people 189 | # had to knowingly turn this feature on, since enabling it means that 190 | # each client request will result in AT LEAST one lookup request to the 191 | # nameserver. 192 | # 193 | HostnameLookups Off 194 | 195 | # ErrorLog: The location of the error log file. 196 | # If you do not specify an ErrorLog directive within a 197 | # container, error messages relating to that virtual host will be 198 | # logged here. If you *do* define an error logfile for a 199 | # container, that host's errors will be logged there and not here. 200 | # 201 | ErrorLog ${APACHE_LOG_DIR}/error.log 202 | 203 | # 204 | # LogLevel: Control the number of messages logged to the error_log. 205 | # Possible values include: debug, info, notice, warn, error, crit, 206 | # alert, emerg. 207 | # 208 | LogLevel warn 209 | 210 | # Include module configuration: 211 | Include mods-enabled/*.load 212 | Include mods-enabled/*.conf 213 | 214 | # Include all the user configurations: 215 | Include httpd.conf 216 | 217 | # Include ports listing 218 | Include ports.conf 219 | 220 | # 221 | # The following directives define some format nicknames for use with 222 | # a CustomLog directive (see below). 223 | # If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i 224 | # 225 | LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined 226 | LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined 227 | LogFormat "%h %l %u %t \"%r\" %>s %O" common 228 | LogFormat "%{Referer}i -> %U" referer 229 | LogFormat "%{User-agent}i" agent 230 | 231 | # Include of directories ignores editors' and dpkg's backup files, 232 | # see README.Debian for details. 233 | 234 | # Include generic snippets of statements 235 | Include conf.d/ 236 | 237 | # Include the virtual host configurations: 238 | Include sites-enabled/ 239 | Include custom-sites/*.conf -------------------------------------------------------------------------------- /config/apache-config/php5-fpm.conf: -------------------------------------------------------------------------------- 1 | 2 | AddHandler php5-fcgi .php 3 | Action php5-fcgi /php5-fcgi 4 | Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi 5 | FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -socket /var/run/php5-fpm.sock -pass-header Authorization 6 | -------------------------------------------------------------------------------- /config/apache-config/sites/local-apache-example.conf-sample: -------------------------------------------------------------------------------- 1 | 2 | # Tells apache which directory the files for this domain are located 3 | DocumentRoot /srv/www/wordpress-local 4 | 5 | # Tells apache what domain name should trigger this configuration. 6 | # See https://httpd.apache.org/docs/2.2/vhosts/name-based.html 7 | ServerName testserver.com 8 | 9 | # Lists additional domains that should trigger this configuration. 10 | # Multiple domains can be space delimited here. Uncomment ServerAlias 11 | # to use. See https://httpd.apache.org/docs/2.2/vhosts/name-based.html 12 | # ServerAlias *.testserver.com testserver2.com 13 | -------------------------------------------------------------------------------- /config/apache-config/sites/wordpress-default.conf: -------------------------------------------------------------------------------- 1 | # Default local Apache (web server) configurations 2 | # 3 | # Configurations are provided for 3 default sites in this file: 4 | # 5 | # http://{vvv_ipaddress} 6 | # - Standard handling for php files, no WordPress 7 | # - Files available locally in this repository's www/default 8 | # - Files available on guest (vagrant ssh) in /srv/www/default 9 | # http://local.wordpress.dev 10 | # - Latest stable version of WordPress 11 | # - Files available locally in this repository's www/wordpress-default 12 | # - Files available on guest (vagrant ssh) in /srv/www/wordpress-default 13 | # http://local.wordpress-trunk.dev 14 | # - SVN repository of WordPress trunk 15 | # - Files available locally in this repository's www/wordpress-trunk 16 | # - Files available on guest (vagrant ssh) in /srv/www/wordpress-trunk 17 | # 18 | 19 | ################################################################ 20 | # Default Apache catch-all server 21 | # 22 | # This server configuration provides a catch all for any domains that point to 23 | # this IP address but are not specified through a server configuration. Files 24 | # placed in the /srv/www/default directory are accessible through this IP. It is 25 | # not intended to run WordPress through this directory. 26 | 27 | DocumentRoot /srv/www/default 28 | ServerName vvv.dev 29 | 30 | 31 | ################################################################ 32 | # WordPress stable Apache configuration 33 | # 34 | # http://local.wordpress.dev - this server configuration is 35 | # setup to listen on port 80 for any requests coming in to 36 | # local.wordpress.dev and use the /srv/www/wordpress-default directory 37 | # to serve them. 38 | 39 | DocumentRoot /srv/www/wordpress-default 40 | ServerName local.wordpress.dev 41 | 42 | 43 | ################################################################ 44 | # WordPress trunk Apache configuration 45 | # 46 | # http://local.wordpress-trunk.dev - this server configuration is 47 | # setup to listen on port 80 for any requests coming in to 48 | # local.wordpress-trunk.dev and use the /srv/www/wordpress-trunk 49 | # directory to serve them. 50 | 51 | DocumentRoot /srv/www/wordpress-trunk 52 | ServerName local.wordpress-trunk.dev 53 | 54 | 55 | ################################################################ 56 | # WordPress develop src Apache configuration 57 | # 58 | # http://src.wordpress-develop.dev - this server configuration is 59 | # setup to listen on port 80 for any requests coming in to 60 | # src.wordpress-develop.dev and use the /srv/www/wordpress-develop/src 61 | # directory to serve them. 62 | 63 | DocumentRoot /srv/www/wordpress-develop/src 64 | ServerName src.wordpress-develop.dev 65 | 66 | 67 | ################################################################ 68 | # WordPress develop build Apache configuration 69 | # 70 | # http://build.wordpress-develop.dev - this server configuration is 71 | # setup to listen on port 80 for any requests coming in to 72 | # build.wordpress-develop.dev and use the /srv/www/wordpress-develop/build 73 | # directory to serve them. 74 | 75 | DocumentRoot /srv/www/wordpress-develop/build 76 | ServerName build.wordpress-develop.dev 77 | -------------------------------------------------------------------------------- /config/apt-source-append.list: -------------------------------------------------------------------------------- 1 | # Additional sources will be added here to help control the 2 | # versions of various packages that are installed 3 | 4 | # Provides SVN 1.7.9 5 | deb http://ppa.launchpad.net/svn/ppa/ubuntu precise main 6 | deb-src http://ppa.launchpad.net/svn/ppa/ubuntu precise main 7 | 8 | # Provides PHP 5.4 9 | deb http://ppa.launchpad.net/ondrej/php5-oldstable/ubuntu precise main 10 | deb-src http://ppa.launchpad.net/ondrej/php5-oldstable/ubuntu precise main 11 | 12 | # Provides Git 1.8 13 | deb http://ppa.launchpad.net/git-core/ppa/ubuntu precise main 14 | deb-src http://ppa.launchpad.net/git-core/ppa/ubuntu precise main 15 | 16 | # Provides Node.js 17 | deb http://ppa.launchpad.net/chris-lea/node.js/ubuntu precise main 18 | deb-src http://ppa.launchpad.net/chris-lea/node.js/ubuntu precise main 19 | -------------------------------------------------------------------------------- /config/bash_aliases: -------------------------------------------------------------------------------- 1 | # bash_aliases 2 | # 3 | # This file is copied into the home directory of the vagrant user on the virtual 4 | # machine during provisioning and is included in the .bashrc automatically as 5 | # provisioning is finished. This allows for various scripts and configurations to 6 | # be available to us. 7 | # 8 | -------------------------------------------------------------------------------- /config/bash_profile: -------------------------------------------------------------------------------- 1 | # bash_profile 2 | # 3 | # Symlinked to the vagrant user's home directory. This loads 4 | # the default .bashrc provided by the virtual machine, which in 5 | # turn loads the .bash_aliases file that we provide. Use this 6 | # bash_profile to set environment variables and such. 7 | 8 | # if running bash 9 | if [ -n "$BASH_VERSION" ]; then 10 | # include .bashrc if it exists 11 | if [ -f "$HOME/.bashrc" ]; then 12 | . "$HOME/.bashrc" 13 | fi 14 | fi 15 | 16 | # set PATH so it includes user's private bin if it exists 17 | if [ -d "$HOME/bin" ] ; then 18 | PATH="$HOME/bin:$PATH" 19 | fi 20 | 21 | # Set the WP_TESTS_DIR path directory so that we can use phpunit inside 22 | # plugins almost immediately. 23 | export WP_TESTS_DIR=/srv/www/wordpress-develop/tests/phpunit/ 24 | 25 | # add autocomplete for grunt 26 | eval "$(grunt --completion=bash)" 27 | -------------------------------------------------------------------------------- /config/homebin/makepot: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Convenience script to run makepot.php 3 | 4 | php /srv/www/wordpress-develop/tools/i18n/makepot.php $1 $2 $3 $4 5 | -------------------------------------------------------------------------------- /config/homebin/xdebug_off: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo php5dismod xdebug 3 | sudo service php5-fpm restart 4 | 5 | -------------------------------------------------------------------------------- /config/homebin/xdebug_on: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo php5enmod xdebug 3 | sudo service php5-fpm restart 4 | 5 | -------------------------------------------------------------------------------- /config/init/vvv-start.conf: -------------------------------------------------------------------------------- 1 | # varying-vagrant-vagrants - necessary services at start 2 | 3 | description "necessary services for Varying Vagrant Vagrants" 4 | 5 | start on runlevel [2345] 6 | 7 | script 8 | service apache2 start 9 | service php5-fpm start 10 | service memcached start 11 | # Hack becuz we need to wait for MySQL dir to be mounted https://github.com/mitchellh/vagrant/issues/1776#issuecomment-25181024 12 | COUNTER=0 13 | while [ $COUNTER -lt 900 ]; do 14 | sleep 5 15 | COUNTER=$(($COUNTER+1)) 16 | if [ "$(ls -A /var/lib/mysql)" ]; then 17 | service mysql start 18 | COUNTER=1000 19 | fi 20 | done 21 | end script -------------------------------------------------------------------------------- /config/memcached-config/memcached.conf: -------------------------------------------------------------------------------- 1 | # memcached.conf 2 | # 3 | # Varying Vagrant Vagrant's modification of the default memcached config 4 | # 5 | # Original config - 2003 - Jay Bonci 6 | # This configuration file is read by the start-memcached script provided as 7 | # part of the Debian GNU/Linux distribution. 8 | 9 | # Run memcached as a daemon. This command is implied, and is not needed for the 10 | # daemon to run. See the README.Debian that comes with this package for more 11 | # information. 12 | -d 13 | 14 | # Log memcached's output to /var/log/memcached 15 | logfile /var/log/memcached.log 16 | 17 | # Be verbose 18 | # -v 19 | 20 | # Be even more verbose (print client commands as well) 21 | # -vv 22 | 23 | # Memcached starts with a 64M cap by default. We replace with 128M to aid in testing 24 | # large sites that like the space. 25 | -m 128 26 | 27 | # Default connection port is 11211 28 | -p 11211 29 | 30 | # Run the daemon as root. The start-memcached will default to running as root if no 31 | # -u command is present in this config file 32 | -u memcache 33 | 34 | # Specify which IP address to listen on. The default is to listen on all IP addresses 35 | # This parameter is one of the only security measures that memcached has, so make sure 36 | # it's listening on a firewalled interface. 37 | -l 127.0.0.1 38 | 39 | # Limit the number of simultaneous incoming connections. The daemon default is 1024 40 | # -c 1024 41 | 42 | # Lock down all paged memory. Consult with the README and homepage before you do this 43 | # -k 44 | 45 | # Return error when memory is exhausted (rather than removing items) 46 | # -M 47 | 48 | # Maximize core file limit 49 | # -r 50 | -------------------------------------------------------------------------------- /config/mysql-config/my.cnf: -------------------------------------------------------------------------------- 1 | # 2 | # The MySQL database server configuration file. 3 | # 4 | # You can copy this to one of: 5 | # - "/etc/mysql/my.cnf" to set global options, 6 | # - "~/.my.cnf" to set user-specific options. 7 | # 8 | # One can use all long options that the program supports. 9 | # Run program with --help to get a list of available options and with 10 | # --print-defaults to see which it would actually understand and use. 11 | # 12 | # For explanations see 13 | # http://dev.mysql.com/doc/mysql/en/server-system-variables.html 14 | 15 | # This will be passed to all mysql clients 16 | # It has been reported that passwords should be enclosed with ticks/quotes 17 | # escpecially if they contain "#" chars... 18 | # Remember to edit /etc/mysql/debian.cnf when changing the socket location. 19 | [client] 20 | port = 3306 21 | socket = /var/run/mysqld/mysqld.sock 22 | 23 | # Here is entries for some specific programs 24 | # The following values assume you have at least 32M ram 25 | 26 | # This was formally known as [safe_mysqld]. Both versions are currently parsed. 27 | [mysqld_safe] 28 | socket = /var/run/mysqld/mysqld.sock 29 | nice = 0 30 | 31 | [mysqld] 32 | # 33 | # * Basic Settings 34 | # 35 | user = mysql 36 | pid-file = /var/run/mysqld/mysqld.pid 37 | socket = /var/run/mysqld/mysqld.sock 38 | port = 3306 39 | basedir = /usr 40 | datadir = /var/lib/mysql 41 | tmpdir = /tmp 42 | lc-messages-dir = /usr/share/mysql 43 | skip-external-locking 44 | # 45 | # Instead of skip-networking the default is now to listen only on 46 | # localhost which is more compatible and is not less secure. 47 | bind-address = 0.0.0.0 48 | # 49 | # * Fine Tuning 50 | # 51 | max_allowed_packet = 128M 52 | # 53 | # * Logging and Replication 54 | # 55 | # Both location gets rotated by the cronjob. 56 | # Be aware that this log type is a performance killer. 57 | # As of 5.1 you can enable the log at runtime! 58 | #general_log_file = /var/log/mysql/mysql.log 59 | #general_log = 1 60 | # 61 | # Error log - should be very few entries. 62 | # 63 | log_error = /var/log/mysql/error.log 64 | # 65 | # Here you can see queries with especially long duration 66 | #log_slow_queries = /var/log/mysql/mysql-slow.log 67 | #long_query_time = 2 68 | #log-queries-not-using-indexes 69 | 70 | [mysqldump] 71 | quick 72 | quote-names 73 | max_allowed_packet = 128M 74 | 75 | [mysql] 76 | #no-auto-rehash # faster start of mysql but no tab completition 77 | 78 | [isamchk] 79 | 80 | 81 | # 82 | # * IMPORTANT: Additional settings that can override those from this file! 83 | # The files must end with '.cnf', otherwise they'll be ignored. 84 | # 85 | !includedir /etc/mysql/conf.d/ 86 | -------------------------------------------------------------------------------- /config/mysql-config/root-my.cnf: -------------------------------------------------------------------------------- 1 | # Custom MySQL configuration to save the root user's password for both client 2 | # and mysqladmin access. This allows us to use `mysql -u root` to access 3 | # MySQL rather than having to use a password. 4 | [client] 5 | user = root 6 | password = root 7 | 8 | [mysqladmin] 9 | user = root 10 | password = root -------------------------------------------------------------------------------- /config/php5-fpm-config/apc.ini: -------------------------------------------------------------------------------- 1 | ; apc.ini 2 | ; 3 | ; Allows us to control specific settings for APC when used with 4 | ; PHP FPM. See a full list of available settings and defaults 5 | ; here - http://www.php.net/manual/en/apc.configuration.php 6 | 7 | ; Configure away... 8 | [apc] 9 | apc.shm_size = 128M -------------------------------------------------------------------------------- /config/php5-fpm-config/php-custom.ini: -------------------------------------------------------------------------------- 1 | [PHP] 2 | 3 | ; Recommended that short tags - - are not used. 4 | ; Default Value: On 5 | ; Development Value: Off 6 | ; Production Value: Off 7 | ; http://php.net/short-open-tag 8 | short_open_tag = Off 9 | 10 | ; If you pass a value by reference at function call time... 11 | ; Default Value: On (Suppress warnings) 12 | ; Development Value: Off (Issue warnings) 13 | ; Production Value: Off (Issue warnings) 14 | ; http://php.net/allow-call-time-pass-reference 15 | allow_call_time_pass_reference = Off 16 | 17 | ; Maximum execution time of each script, in seconds 18 | ; http://php.net/max-execution-time 19 | ; Note: This directive is hardcoded to 0 for the CLI SAPI 20 | max_execution_time = 30 21 | 22 | ; Maximum amount of memory a script may consume (128MB) 23 | ; http://php.net/memory-limit 24 | memory_limit = 128M 25 | 26 | ; Common Values: 27 | ; E_ALL & ~E_NOTICE (Show all errors, except for notices and coding standards warnings.) 28 | ; E_ALL & ~E_NOTICE | E_STRICT (Show all errors, except for notices) 29 | ; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors) 30 | ; E_ALL | E_STRICT (Show all errors, warnings and notices including coding standards.) 31 | ; Default Value: E_ALL & ~E_NOTICE 32 | ; Development Value: E_ALL | E_STRICT 33 | ; Production Value: E_ALL & ~E_DEPRECATED 34 | ; http://php.net/error-reporting 35 | error_reporting = E_ALL | E_STRICT 36 | 37 | ; Should PHP output errors. If so, where? 38 | ; Possible Values: 39 | ; Off = Do not display any errors 40 | ; stderr = Display errors to STDERR (affects only CGI/CLI binaries!) 41 | ; On or stdout = Display errors to STDOUT 42 | ; Default Value: On 43 | ; Development Value: On 44 | ; Production Value: Off 45 | ; http://php.net/display-errors 46 | display_errors = On 47 | 48 | ; Besides displaying errors, PHP can also log errors to locations such as a 49 | ; server-specific log, STDERR, or a location specified by the error_log 50 | ; directive found below. While errors should not be displayed on productions 51 | ; servers they should still be monitored and logging is a great way to do that. 52 | ; Default Value: Off 53 | ; Development Value: On 54 | ; Production Value: On 55 | ; http://php.net/log-errors 56 | log_errors = On 57 | 58 | ; Set maximum length of log_errors. In error_log information about the source is 59 | ; added. The default is 1024 and 0 allows to not apply any maximum length at all. 60 | ; http://php.net/log-errors-max-len 61 | log_errors_max_len = 1024 62 | 63 | ; Do not log repeated messages. Repeated errors must occur in same file on same 64 | ; line unless ignore_repeated_source is set true. 65 | ; http://php.net/ignore-repeated-errors 66 | ignore_repeated_errors = Off 67 | 68 | ; Ignore source of message when ignoring repeated messages. When this setting 69 | ; is On you will not log errors with repeated messages from different files or 70 | ; source lines. 71 | ; http://php.net/ignore-repeated-source 72 | ignore_repeated_source = Off 73 | 74 | ; Store the last error/warning message in $php_errormsg (boolean). Setting this value 75 | ; to On can assist in debugging and is appropriate for development servers. It should 76 | ; however be disabled on production servers. 77 | ; Default Value: Off 78 | ; Development Value: On 79 | ; Production Value: Off 80 | ; http://php.net/track-errors 81 | track_errors = Off 82 | 83 | ; Display HTML links to docs related to the error? 84 | ; Default Value: On 85 | ; Development Value: On 86 | ; Production value: Off 87 | ; http://php.net/html-errors 88 | html_errors = 1 89 | 90 | ; String to output before an error message. PHP's default behavior is to leave 91 | ; this setting blank. 92 | ; http://php.net/error-prepend-string 93 | ; Example: 94 | ;error_prepend_string = "" 95 | 96 | ; String to output after an error message. PHP's default behavior is to leave 97 | ; this setting blank. 98 | ; http://php.net/error-append-string 99 | ; Example: 100 | ;error_append_string = "" 101 | 102 | ; Log errors to specified file. PHP's default behavior is to leave this value 103 | ; empty. 104 | ; http://php.net/error-log 105 | ; Example: 106 | error_log = /tmp/php_errors.log 107 | 108 | ; Maximum size of POST data that PHP will accept. 109 | ; http://php.net/post-max-size 110 | post_max_size = 50M 111 | 112 | ; Maximum allowed size for uploaded files. 113 | ; http://php.net/upload-max-filesize 114 | upload_max_filesize = 50M 115 | 116 | ; Maximum number of files that can be uploaded via a single request 117 | max_file_uploads = 20 118 | 119 | ; Default timeout for socket based streams (seconds) 120 | ; http://php.net/default-socket-timeout 121 | default_socket_timeout = 60 122 | -------------------------------------------------------------------------------- /config/php5-fpm-config/www.conf: -------------------------------------------------------------------------------- 1 | ; Start a new pool named 'www'. 2 | ; the variable $pool can we used in any directive and will be replaced by the 3 | ; pool name ('www' here) 4 | [www] 5 | 6 | ; Per pool prefix 7 | ; It only applies on the following directives: 8 | ; - 'slowlog' 9 | ; - 'listen' (unixsocket) 10 | ; - 'chroot' 11 | ; - 'chdir' 12 | ; - 'php_values' 13 | ; - 'php_admin_values' 14 | ; When not set, the global prefix (or /usr) applies instead. 15 | ; Note: This directive can also be relative to the global prefix. 16 | ; Default Value: none 17 | ;prefix = /path/to/pools/$pool 18 | 19 | ; Unix user/group of processes 20 | ; Note: The user is mandatory. If the group is not set, the default user's group 21 | ; will be used. 22 | user = www-data 23 | group = www-data 24 | 25 | ; The address on which to accept FastCGI requests. 26 | ; Valid syntaxes are: 27 | ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on 28 | ; a specific port; 29 | ; 'port' - to listen on a TCP socket to all addresses on a 30 | ; specific port; 31 | ; '/path/to/unix/socket' - to listen on a unix socket. 32 | ; Note: This value is mandatory. 33 | listen = /var/run/php5-fpm.sock 34 | 35 | ; Set listen(2) backlog. A value of '-1' means unlimited. 36 | ; Default Value: 128 (-1 on FreeBSD and OpenBSD) 37 | ;listen.backlog = -1 38 | 39 | ; Set permissions for unix socket, if one is used. In Linux, read/write 40 | ; permissions must be set in order to allow connections from a web server. Many 41 | ; BSD-derived systems allow connections regardless of permissions. 42 | ; Default Values: user and group are set as the running user 43 | ; mode is set to 0666 44 | listen.owner = www-data 45 | listen.group = www-data 46 | listen.mode = 0666 47 | 48 | ; List of ipv4 addresses of FastCGI clients which are allowed to connect. 49 | ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original 50 | ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address 51 | ; must be separated by a comma. If this value is left blank, connections will be 52 | ; accepted from any ip address. 53 | ; Default Value: any 54 | ;listen.allowed_clients = 127.0.0.1 55 | 56 | ; Choose how the process manager will control the number of child processes. 57 | ; Possible Values: 58 | ; static - a fixed number (pm.max_children) of child processes; 59 | ; dynamic - the number of child processes are set dynamically based on the 60 | ; following directives. With this process management, there will be 61 | ; always at least 1 children. 62 | ; pm.max_children - the maximum number of children that can 63 | ; be alive at the same time. 64 | ; pm.start_servers - the number of children created on startup. 65 | ; pm.min_spare_servers - the minimum number of children in 'idle' 66 | ; state (waiting to process). If the number 67 | ; of 'idle' processes is less than this 68 | ; number then some children will be created. 69 | ; pm.max_spare_servers - the maximum number of children in 'idle' 70 | ; state (waiting to process). If the number 71 | ; of 'idle' processes is greater than this 72 | ; number then some children will be killed. 73 | ; ondemand - no children are created at startup. Children will be forked when 74 | ; new requests will connect. The following parameter are used: 75 | ; pm.max_children - the maximum number of children that 76 | ; can be alive at the same time. 77 | ; pm.process_idle_timeout - The number of seconds after which 78 | ; an idle process will be killed. 79 | ; Note: This value is mandatory. 80 | pm = dynamic 81 | 82 | ; The number of child processes to be created when pm is set to 'static' and the 83 | ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. 84 | ; This value sets the limit on the number of simultaneous requests that will be 85 | ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. 86 | ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP 87 | ; CGI. The below defaults are based on a server without much resources. Don't 88 | ; forget to tweak pm.* to fit your needs. 89 | ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' 90 | ; Note: This value is mandatory. 91 | pm.max_children = 5 92 | 93 | ; The number of child processes created on startup. 94 | ; Note: Used only when pm is set to 'dynamic' 95 | ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 96 | pm.start_servers = 2 97 | 98 | ; The desired minimum number of idle server processes. 99 | ; Note: Used only when pm is set to 'dynamic' 100 | ; Note: Mandatory when pm is set to 'dynamic' 101 | pm.min_spare_servers = 1 102 | 103 | ; The desired maximum number of idle server processes. 104 | ; Note: Used only when pm is set to 'dynamic' 105 | ; Note: Mandatory when pm is set to 'dynamic' 106 | pm.max_spare_servers = 3 107 | 108 | ; The number of seconds after which an idle process will be killed. 109 | ; Note: Used only when pm is set to 'ondemand' 110 | ; Default Value: 10s 111 | ;pm.process_idle_timeout = 10s; 112 | 113 | ; The number of requests each child process should execute before respawning. 114 | ; This can be useful to work around memory leaks in 3rd party libraries. For 115 | ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. 116 | ; Default Value: 0 117 | pm.max_requests = 100 118 | 119 | ; The URI to view the FPM status page. If this value is not set, no URI will be 120 | ; recognized as a status page. It shows the following informations: 121 | ; pool - the name of the pool; 122 | ; process manager - static, dynamic or ondemand; 123 | ; start time - the date and time FPM has started; 124 | ; start since - number of seconds since FPM has started; 125 | ; accepted conn - the number of request accepted by the pool; 126 | ; listen queue - the number of request in the queue of pending 127 | ; connections (see backlog in listen(2)); 128 | ; max listen queue - the maximum number of requests in the queue 129 | ; of pending connections since FPM has started; 130 | ; listen queue len - the size of the socket queue of pending connections; 131 | ; idle processes - the number of idle processes; 132 | ; active processes - the number of active processes; 133 | ; total processes - the number of idle + active processes; 134 | ; max active processes - the maximum number of active processes since FPM 135 | ; has started; 136 | ; max children reached - number of times, the process limit has been reached, 137 | ; when pm tries to start more children (works only for 138 | ; pm 'dynamic' and 'ondemand'); 139 | ; Value are updated in real time. 140 | ; Example output: 141 | ; pool: www 142 | ; process manager: static 143 | ; start time: 01/Jul/2011:17:53:49 +0200 144 | ; start since: 62636 145 | ; accepted conn: 190460 146 | ; listen queue: 0 147 | ; max listen queue: 1 148 | ; listen queue len: 42 149 | ; idle processes: 4 150 | ; active processes: 11 151 | ; total processes: 15 152 | ; max active processes: 12 153 | ; max children reached: 0 154 | ; 155 | ; By default the status page output is formatted as text/plain. Passing either 156 | ; 'html', 'xml' or 'json' in the query string will return the corresponding 157 | ; output syntax. Example: 158 | ; http://www.foo.bar/status 159 | ; http://www.foo.bar/status?json 160 | ; http://www.foo.bar/status?html 161 | ; http://www.foo.bar/status?xml 162 | ; 163 | ; By default the status page only outputs short status. Passing 'full' in the 164 | ; query string will also return status for each pool process. 165 | ; Example: 166 | ; http://www.foo.bar/status?full 167 | ; http://www.foo.bar/status?json&full 168 | ; http://www.foo.bar/status?html&full 169 | ; http://www.foo.bar/status?xml&full 170 | ; The Full status returns for each process: 171 | ; pid - the PID of the process; 172 | ; state - the state of the process (Idle, Running, ...); 173 | ; start time - the date and time the process has started; 174 | ; start since - the number of seconds since the process has started; 175 | ; requests - the number of requests the process has served; 176 | ; request duration - the duration in µs of the requests; 177 | ; request method - the request method (GET, POST, ...); 178 | ; request URI - the request URI with the query string; 179 | ; content length - the content length of the request (only with POST); 180 | ; user - the user (PHP_AUTH_USER) (or '-' if not set); 181 | ; script - the main script called (or '-' if not set); 182 | ; last request cpu - the %cpu the last request consumed 183 | ; it's always 0 if the process is not in Idle state 184 | ; because CPU calculation is done when the request 185 | ; processing has terminated; 186 | ; last request memory - the max amount of memory the last request consumed 187 | ; it's always 0 if the process is not in Idle state 188 | ; because memory calculation is done when the request 189 | ; processing has terminated; 190 | ; If the process is in Idle state, then informations are related to the 191 | ; last request the process has served. Otherwise informations are related to 192 | ; the current request being served. 193 | ; Example output: 194 | ; ************************ 195 | ; pid: 31330 196 | ; state: Running 197 | ; start time: 01/Jul/2011:17:53:49 +0200 198 | ; start since: 63087 199 | ; requests: 12808 200 | ; request duration: 1250261 201 | ; request method: GET 202 | ; request URI: /test_mem.php?N=10000 203 | ; content length: 0 204 | ; user: - 205 | ; script: /home/fat/web/docs/php/test_mem.php 206 | ; last request cpu: 0.00 207 | ; last request memory: 0 208 | ; 209 | ; Note: There is a real-time FPM status monitoring sample web page available 210 | ; It's available in: ${prefix}/share/fpm/status.html 211 | ; 212 | ; Note: The value must start with a leading slash (/). The value can be 213 | ; anything, but it may not be a good idea to use the .php extension or it 214 | ; may conflict with a real PHP file. 215 | ; Default Value: not set 216 | ;pm.status_path = /status 217 | 218 | ; The ping URI to call the monitoring page of FPM. If this value is not set, no 219 | ; URI will be recognized as a ping page. This could be used to test from outside 220 | ; that FPM is alive and responding, or to 221 | ; - create a graph of FPM availability (rrd or such); 222 | ; - remove a server from a group if it is not responding (load balancing); 223 | ; - trigger alerts for the operating team (24/7). 224 | ; Note: The value must start with a leading slash (/). The value can be 225 | ; anything, but it may not be a good idea to use the .php extension or it 226 | ; may conflict with a real PHP file. 227 | ; Default Value: not set 228 | ;ping.path = /ping 229 | 230 | ; This directive may be used to customize the response of a ping request. The 231 | ; response is formatted as text/plain with a 200 response code. 232 | ; Default Value: pong 233 | ;ping.response = pong 234 | 235 | ; The access log file 236 | ; Default: not set 237 | ;access.log = log/$pool.access.log 238 | 239 | ; The access log format. 240 | ; The following syntax is allowed 241 | ; %%: the '%' character 242 | ; %C: %CPU used by the request 243 | ; it can accept the following format: 244 | ; - %{user}C for user CPU only 245 | ; - %{system}C for system CPU only 246 | ; - %{total}C for user + system CPU (default) 247 | ; %d: time taken to serve the request 248 | ; it can accept the following format: 249 | ; - %{seconds}d (default) 250 | ; - %{miliseconds}d 251 | ; - %{mili}d 252 | ; - %{microseconds}d 253 | ; - %{micro}d 254 | ; %e: an environment variable (same as $_ENV or $_SERVER) 255 | ; it must be associated with embraces to specify the name of the env 256 | ; variable. Some exemples: 257 | ; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e 258 | ; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e 259 | ; %f: script filename 260 | ; %l: content-length of the request (for POST request only) 261 | ; %m: request method 262 | ; %M: peak of memory allocated by PHP 263 | ; it can accept the following format: 264 | ; - %{bytes}M (default) 265 | ; - %{kilobytes}M 266 | ; - %{kilo}M 267 | ; - %{megabytes}M 268 | ; - %{mega}M 269 | ; %n: pool name 270 | ; %o: ouput header 271 | ; it must be associated with embraces to specify the name of the header: 272 | ; - %{Content-Type}o 273 | ; - %{X-Powered-By}o 274 | ; - %{Transfert-Encoding}o 275 | ; - .... 276 | ; %p: PID of the child that serviced the request 277 | ; %P: PID of the parent of the child that serviced the request 278 | ; %q: the query string 279 | ; %Q: the '?' character if query string exists 280 | ; %r: the request URI (without the query string, see %q and %Q) 281 | ; %R: remote IP address 282 | ; %s: status (response code) 283 | ; %t: server time the request was received 284 | ; it can accept a strftime(3) format: 285 | ; %d/%b/%Y:%H:%M:%S %z (default) 286 | ; %T: time the log has been written (the request has finished) 287 | ; it can accept a strftime(3) format: 288 | ; %d/%b/%Y:%H:%M:%S %z (default) 289 | ; %u: remote user 290 | ; 291 | ; Default: "%R - %u %t \"%m %r\" %s" 292 | ;access.format = %R - %u %t "%m %r%Q%q" %s %f %{mili}d %{kilo}M %C%% 293 | 294 | ; The log file for slow requests 295 | ; Default Value: not set 296 | ; Note: slowlog is mandatory if request_slowlog_timeout is set 297 | ;slowlog = log/$pool.log.slow 298 | 299 | ; The timeout for serving a single request after which a PHP backtrace will be 300 | ; dumped to the 'slowlog' file. A value of '0s' means 'off'. 301 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 302 | ; Default Value: 0 303 | ;request_slowlog_timeout = 0 304 | 305 | ; The timeout for serving a single request after which the worker process will 306 | ; be killed. This option should be used when the 'max_execution_time' ini option 307 | ; does not stop script execution for some reason. A value of '0' means 'off'. 308 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 309 | ; Default Value: 0 310 | ;request_terminate_timeout = 0 311 | 312 | ; Set open file descriptor rlimit. 313 | ; Default Value: system defined value 314 | ;rlimit_files = 1024 315 | 316 | ; Set max core size rlimit. 317 | ; Possible Values: 'unlimited' or an integer greater or equal to 0 318 | ; Default Value: system defined value 319 | ;rlimit_core = 0 320 | 321 | ; Chroot to this directory at the start. This value must be defined as an 322 | ; absolute path. When this value is not set, chroot is not used. 323 | ; Note: you can prefix with '$prefix' to chroot to the pool prefix or one 324 | ; of its subdirectories. If the pool prefix is not set, the global prefix 325 | ; will be used instead. 326 | ; Note: chrooting is a great security feature and should be used whenever 327 | ; possible. However, all PHP paths will be relative to the chroot 328 | ; (error_log, sessions.save_path, ...). 329 | ; Default Value: not set 330 | ;chroot = 331 | 332 | ; Chdir to this directory at the start. 333 | ; Note: relative path can be used. 334 | ; Default Value: current directory or / when chroot 335 | chdir = / 336 | 337 | ; Redirect worker stdout and stderr into main error log. If not set, stdout and 338 | ; stderr will be redirected to /dev/null according to FastCGI specs. 339 | ; Note: on highloaded environement, this can cause some delay in the page 340 | ; process time (several ms). 341 | ; Default Value: no 342 | catch_workers_output = yes 343 | 344 | ; Limits the extensions of the main script FPM will allow to parse. This can 345 | ; prevent configuration mistakes on the web server side. You should only limit 346 | ; FPM to .php extensions to prevent malicious users to use other extensions to 347 | ; exectute php code. 348 | ; Note: set an empty value to allow all extensions. 349 | ; Default Value: .php 350 | ;security.limit_extensions = .php .php3 .php4 .php5 351 | 352 | ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from 353 | ; the current environment. 354 | ; Default Value: clean env 355 | ;env[HOSTNAME] = $HOSTNAME 356 | ;env[PATH] = /usr/local/bin:/usr/bin:/bin 357 | ;env[TMP] = /tmp 358 | ;env[TMPDIR] = /tmp 359 | ;env[TEMP] = /tmp 360 | 361 | ; Additional php.ini defines, specific to this pool of workers. These settings 362 | ; overwrite the values previously defined in the php.ini. The directives are the 363 | ; same as the PHP SAPI: 364 | ; php_value/php_flag - you can set classic ini defines which can 365 | ; be overwritten from PHP call 'ini_set'. 366 | ; php_admin_value/php_admin_flag - these directives won't be overwritten by 367 | ; PHP call 'ini_set' 368 | ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. 369 | 370 | ; Defining 'extension' will load the corresponding shared extension from 371 | ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not 372 | ; overwrite previously defined php.ini values, but will append the new value 373 | ; instead. 374 | 375 | ; Note: path INI options can be relative and will be expanded with the prefix 376 | ; (pool, global or /usr) 377 | 378 | ; Default Value: nothing is defined by default except the values in php.ini and 379 | ; specified at startup with the -d argument 380 | ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com 381 | ;php_flag[display_errors] = off 382 | ;php_admin_value[error_log] = /var/log/fpm-php.www.log 383 | ;php_admin_flag[log_errors] = on 384 | ;php_admin_value[memory_limit] = 32M 385 | -------------------------------------------------------------------------------- /config/php5-fpm-config/xdebug.ini: -------------------------------------------------------------------------------- 1 | [XDebug] 2 | 3 | ; xdebug.auto_trace 4 | ; Type: boolean, Default value: 0 5 | ; When this setting is set to on, the tracing of function calls will be enabled just before the 6 | ; script is run. This makes it possible to trace code in the auto_prepend_file. 7 | ;xdebug.auto_trace = 1 8 | 9 | ; xdebug.collect_includes 10 | ; Type: boolean, Default value: 1 11 | ; This setting, defaulting to On, controls whether Xdebug should write the filename used in include 12 | ; (), include_once(), require() or require_once() to the trace files. 13 | xdebug.collect_includes = 1 14 | 15 | ; xdebug.collect_params 16 | ; Type: integer, Default value: 0 17 | ; 18 | ; This setting, defaulting to 0, controls whether Xdebug should collect the parameters passed to 19 | ; functions when a function call is recorded in either the function trace or the stack trace. 20 | xdebug.collect_params = 1 21 | 22 | ; xdebug.collect_return 23 | ; Type: boolean, Default value: 0 24 | ; This setting, defaulting to Off, controls whether Xdebug should write the return value of function 25 | ; calls to the trace files. 26 | ;xdebug.collect_return = 0 27 | 28 | ; xdebug.collect_vars 29 | ; Type: boolean, Default value: Off 30 | ; This setting tells Xdebug to gather information about which variables are used in a certain scope. 31 | ; This analysis can be quite slow as Xdebug has to reverse engineer PHP's opcode arrays. This setting 32 | ; will not record which values the different variables have, for that use xdebug.collect_params. This 33 | ; setting needs to be enabled only if you wish to use xdebug_get_declared_vars(). 34 | ;xdebug.collect_vars = "Off" 35 | 36 | ; xdebug.default_enable 37 | ; Type: boolean, Default value: On 38 | ; If this setting is On then stacktraces will be shown by default on an error event. You can disable 39 | ; showing stacktraces from your code with xdebug_disable(). As this is one of the basic functions of 40 | ; Xdebug, it is advisable to leave this setting set to 'On'. 41 | ;xdebug.default_enable = "On" 42 | 43 | ; xdebug.dump.* 44 | ; Type: string, Default value: Empty 45 | ; * = COOKIE, FILES, GET, POST, REQUEST, SERVER, SESSION. These seven settings control which data 46 | ; from the superglobals is shown when an error situation occurs. Each php.ini setting can consist of 47 | ; a comma seperated list of variables from this superglobal to dump, but make sure you do not add 48 | ; spaces in this setting. In order to dump the REMOTE_ADDR and the REQUEST_METHOD when an error 49 | ; occurs, add this setting: 50 | ; 51 | ; xdebug.dump.SERVER = REMOTE_ADDR,REQUEST_METHOD 52 | ; xdebug.dump.SERVER = REMOTE_ADDR,REQUEST_METHOD 53 | ;xdebug.dump.COOKIE = "" 54 | ;xdebug.dump.FILES = "" 55 | ;xdebug.dump.GET = "" 56 | ;xdebug.dump.POST = "" 57 | ;xdebug.dump.REQUEST = "" 58 | ;xdebug.dump.SERVER = "" 59 | ;xdebug.dump.SESSION = "" 60 | 61 | ; xdebug.dump_globals 62 | ; Type: boolean, Default value: 1 63 | ; Controls whether the values of the superglobals as defined by the xdebug.dump.* settings whould be 64 | ; shown or not. 65 | xdebug.dump_globals = 1 66 | 67 | ; xdebug.dump_once 68 | ; Type: boolean, Default value: 1 69 | ; Controls whether the values of the superglobals should be dumped on all error situations (set to 70 | ; Off) or only on the first (set to On). 71 | ;xdebug.dump_once = 1 72 | 73 | ; xdebug.dump_undefined 74 | ; Type: boolean, Default value: 0 75 | ; If you want to dump undefined values from the superglobals you should set this setting to On, 76 | ; otherwise leave it set to Off. 77 | ;xdebug.dump_undefined = 0 78 | 79 | ; xdebug.extended_info 80 | ; Type: integer, Default value: 1 81 | ; Controls whether Xdebug should enforce 'extended_info' mode for the PHP parser; this allows Xdebug 82 | ; to do file/line breakpoints with the remote debugger. When tracing or profiling scripts you 83 | ; generally want to turn off this option as PHP's generated oparrays will increase with about a third 84 | ; of the size slowing down your scripts. This setting can not be set in your scripts with ini_set(), 85 | ; but only in php.ini. 86 | ;xdebug.extended_info = 1 87 | 88 | ; xdebug.file_link_format 89 | ; Type: string, Default value: *empty string* , Introduced in Xdebug 2.1 90 | ; 91 | ; This setting determines the format of the links that are made in the display of stack traces where 92 | ; file names are used. This allows IDEs to set up a link-protocol that makes it possible to go 93 | ; directly to a line and file by clicking on the filenames that Xdebug shows in stack traces. 94 | ;xdebug.file_link_format = "" 95 | 96 | ; xdebug.idekey 97 | ; Type: string, Default value: *complex* 98 | ; Controls which IDE Key Xdebug should pass on to the DBGp debugger handler. The default is based on 99 | ; environment settings. First the environment setting DBGP_IDEKEY is consulted, then USER and as last 100 | ; USERNAME. The default is set to the first environment variable that is found. If none could be 101 | ; found the setting has as default ''. 102 | xdebug.idekey = "VVVDEBUG" 103 | 104 | ; xdebug.manual_url 105 | ; Type: string, Default value: http://www.php.net 106 | ; This is the base url for the links from the function traces and error message to the manual pages 107 | ; of the function from the message. It is advisable to set this setting to use the closest mirror. 108 | ;xdebug.manual_url = "http://www.php.net" 109 | 110 | ; xdebug.max_nesting_level 111 | ; Type: integer, Default value: 100 112 | ; Controls the protection mechanism for infinite recursion protection. The value of this setting is 113 | ; the maximum level of nested functions that are allowed before the script will be aborted. 114 | ;xdebug.max_nesting_level = 100 115 | 116 | ; xdebug.overload_var_dump 117 | ; Type: boolean, Default value: 1 , Introduced in Xdebug 2.1 118 | ; By default Xdebug overloads var_dump() with its own improved version for displaying variables when 119 | ; the html_errors php.ini setting is set to 1. In case you do not want that, you can set this setting 120 | ; to 0, but check first if it's not smarter to turn off html_errors. 121 | ;xdebug.overload_var_dump = 1 122 | 123 | ; xdebug.profiler_append 124 | ; Type: integer, Default value: 0 125 | ; When this setting is set to 1, profiler files will not be overwritten when a new request would map 126 | ; to the same file (depnding on the xdebug.profiler_output_name setting. Instead the file will be 127 | ; appended to with the new profile. 128 | ;xdebug.profiler_append = 0 129 | 130 | ; xdebug.profiler_enable 131 | ; Type: integer, Default value: 0 132 | ; Enables Xdebug's profiler which creates files in the profile output directory. Those files can be 133 | ; read by KCacheGrind to visualize your data. This setting can not be set in your script with ini_set 134 | ; (). 135 | ;xdebug.profiler_enable = 0 136 | 137 | ; xdebug.profiler_enable_trigger 138 | ; Type: integer, Default value: 0 139 | ; When this setting is set to 1, you can trigger the generation of profiler files by using the 140 | ; XDEBUG_PROFILE GET/POST parameter. This will then write the profiler data to defined directory. 141 | xdebug.profiler_enable_trigger = 1 142 | 143 | ; xdebug.profiler_output_dir 144 | ; Type: string, Default value: /tmp 145 | ; The directory where the profiler output will be written to, make sure that the user who the PHP 146 | ; will be running as has write permissions to that directory. This setting can not be set in your 147 | ; script with ini_set(). 148 | ;xdebug.profiler_output_dir = "C:\xampp\tmp" 149 | 150 | ; xdebug.profiler_output_name 151 | ; Type: string, Default value: cachegrind.out.%p 152 | ; 153 | ; This setting determines the name of the file that is used to dump traces into. The setting 154 | ; specifies the format with format specifiers, very similar to sprintf() and strftime(). There are 155 | ; several format specifiers that can be used to format the file name. 156 | ; 157 | ; See the xdebug.trace_output_name documentation for the supported specifiers. 158 | ;xdebug.profiler_output_name = "xdebug_profile.%R::%u" 159 | xdebug.profiler_output_name = "cachegrind.out.%t-%s" 160 | 161 | ; xdebug.remote_autostart 162 | ; Type: boolean, Default value: 0, VVV Default value: 1 163 | ; Normally you need to use a specific HTTP GET/POST variable to start remote debugging (see Remote 164 | ; Debugging). When this setting is set to 'On' Xdebug will always attempt to start a remote debugging 165 | ; session and try to connect to a client, even if the GET/POST/COOKIE variable was not present. 166 | xdebug.remote_autostart = 1 167 | 168 | ; xdebug.remote_enable 169 | ; Type: boolean, Default value: 0 170 | ; This switch controls whether Xdebug should try to contact a debug client which is listening on the 171 | ; host and port as set with the settings xdebug.remote_host and xdebug.remote_port. If a connection 172 | ; can not be established the script will just continue as if this setting was Off. 173 | xdebug.remote_enable = 1 174 | 175 | ; xdebug.remote_handler 176 | ; Type: string, Default value: dbgp 177 | ; Can be either 'php3' which selects the old PHP 3 style debugger output, 'gdb' which enables the GDB 178 | ; like debugger interface or 'dbgp' - the brand new debugger protocol. The DBGp protocol is more 179 | ; widely supported by clients. See more information in the introduction for Remote Debugging. 180 | ;xdebug.remote_handler = "dbgp" 181 | 182 | ; xdebug.remote_host 183 | ; Type: string, Default value: localhost 184 | ; Selects the host where the debug client is running, you can either use a host name or an IP 185 | ; address. 186 | xdebug.remote_host = "192.168.50.1" 187 | 188 | ; xdebug.remote_log 189 | ; Type: string, Default value: none 190 | ; If set to a value, it is used as filename to a file to which all remote debugger communications are 191 | ; logged. The file is always opened in append-mode, and will therefore not be overwritten by default. 192 | ; There is no concurrency protection available. 193 | xdebug.remote_log = /tmp/xdebug-remote.log 194 | 195 | ; xdebug.remote_mode 196 | ; Type: string, Default value: req 197 | ; 198 | ; Selects when a debug connection is initiated. This setting can have two different values: 199 | ; 200 | ; req 201 | ; Xdebug will try to connect to the debug client as soon as the script starts. 202 | ; jit 203 | ; Xdebug will only try to connect to the debug client as soon as an error condition occurs. 204 | ;xdebug.remote_mode = "req" 205 | 206 | ; xdebug.remote_port 207 | ; Type: integer, Default value: 9000 208 | ; The port to which Xdebug tries to connect on the remote host. Port 9000 is the default for both the 209 | ; client and the bundled debugclient. As many clients use this port number, it is best to leave this 210 | ; setting unchanged. 211 | xdebug.remote_port = 9000 212 | 213 | ; xdebug.show_exception_trace 214 | ; Type: integer, Default value: 0 215 | ; When this setting is set to 1, Xdebug will show a stack trace whenever an exception is raised - 216 | ; even if this exception is actually caught. 217 | ;xdebug.show_exception_trace = 0 218 | 219 | ; xdebug.show_local_vars 220 | ; Type: integer, Default value: 0 221 | ; When this setting is set to something != 0 Xdebug's generated stack dumps in error situations will 222 | ; also show all variables in the top-most scope. Beware that this might generate a lot of 223 | ; information, and is therefore turned off by default. 224 | ;xdebug.show_local_vars = 0 225 | 226 | ; xdebug.show_mem_delta 227 | ; Type: integer, Default value: 0 228 | ; When this setting is set to something != 0 Xdebug's human-readable generated trace files will show 229 | ; the difference in memory usage between function calls. If Xdebug is configured to generate 230 | ; computer-readable trace files then they will always show this information. 231 | ;xdebug.show_mem_delta = 0 232 | 233 | ; xdebug.trace_format 234 | ; Type: integer, Default value: 0 235 | ; The format of the trace file. 236 | ; 237 | ; See the introduction of Function Traces for a few examples. 238 | ;xdebug.trace_format = 0 239 | 240 | ; xdebug.trace_options 241 | ; Type: integer, Default value: 0 242 | ; When set to '1' the trace files will be appended to, instead of being overwritten in subsequent 243 | ; requests. 244 | ;xdebug.trace_options = 0 245 | 246 | ; xdebug.trace_output_dir 247 | ; Type: string, Default value: /tmp 248 | ; The directory where the tracing files will be written to, make sure that the user who the PHP will 249 | ; be running as has write permissions to that directory. 250 | ; xdebug.trace_output_name 251 | ;xdebug.trace_output_dir = "C:\xampp\tmp" 252 | 253 | ; Type: string, Default value: trace.%c 254 | ; 255 | ; This setting determines the name of the file that is used to dump traces into. The setting 256 | ; specifies the format with format specifiers, very similar to sprintf() and strftime(). There are 257 | ; several format specifiers that can be used to format the file name. The '.xt' extension is always 258 | ; added automatically. 259 | ;xdebug.trace_output_name = "trace.%c" 260 | 261 | ; xdebug.var_display_max_children 262 | ; Type: integer, Default value: 128 263 | ; Controls the amount of array children and object's properties are shown when variables are 264 | ; displayed with either xdebug_var_dump(), xdebug.show_local_vars or through Function Traces. This 265 | ; setting does not have any influence on the number of children that is send to the client through 266 | ; the Remote Debugging feature. 267 | xdebug.var_display_max_children = -1 268 | 269 | ; xdebug.var_display_max_data 270 | ; Type: integer, Default value: 512 271 | ; Controls the maximum string length that is shown when variables are displayed with either 272 | ; xdebug_var_dump(), xdebug.show_local_vars or through Function Traces. This setting does not have 273 | ; any influence on the amount of data that is send to the client through the Remote Debugging 274 | ; feature. 275 | xdebug.var_display_max_data = -1 276 | 277 | ; xdebug.var_display_max_depth 278 | ; Type: integer, Default value: 3 279 | ; Controls how many nested levels of array elements and object properties are when variables are 280 | ; displayed with either xdebug_var_dump(), xdebug.show_local_vars or through Function Traces. This 281 | ; setting does not have any influence on the depth of children that is send to the client through the 282 | ; Remote Debugging feature. 283 | xdebug.var_display_max_depth = -1 284 | -------------------------------------------------------------------------------- /config/phpmyadmin-config/config.inc.php: -------------------------------------------------------------------------------- 1 | . 9 | * 10 | * @package PhpMyAdmin 11 | */ 12 | 13 | /* 14 | * This is needed for cookie based authentication to encrypt password in 15 | * cookie 16 | */ 17 | $cfg['blowfish_secret'] = 'a8b7c6d'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */ 18 | 19 | /* 20 | * Servers configuration 21 | */ 22 | $i = 0; 23 | 24 | /* 25 | * First server 26 | */ 27 | $i++; 28 | /* Authentication type */ 29 | $cfg['Servers'][$i]['auth_type'] = 'cookie'; 30 | /* Server parameters */ 31 | $cfg['Servers'][$i]['host'] = 'localhost'; 32 | $cfg['Servers'][$i]['connect_type'] = 'tcp'; 33 | $cfg['Servers'][$i]['compress'] = false; 34 | /* Select mysql if your server does not have mysqli */ 35 | $cfg['Servers'][$i]['extension'] = 'mysqli'; 36 | $cfg['Servers'][$i]['AllowNoPassword'] = false; 37 | 38 | /* 39 | * phpMyAdmin configuration storage settings. 40 | */ 41 | 42 | /* User used to manipulate with storage */ 43 | // $cfg['Servers'][$i]['controlhost'] = ''; 44 | // $cfg['Servers'][$i]['controluser'] = 'pma'; 45 | // $cfg['Servers'][$i]['controlpass'] = 'pmapass'; 46 | 47 | /* Storage database and tables */ 48 | // $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; 49 | // $cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark'; 50 | // $cfg['Servers'][$i]['relation'] = 'pma__relation'; 51 | // $cfg['Servers'][$i]['table_info'] = 'pma__table_info'; 52 | // $cfg['Servers'][$i]['table_coords'] = 'pma__table_coords'; 53 | // $cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages'; 54 | // $cfg['Servers'][$i]['column_info'] = 'pma__column_info'; 55 | // $cfg['Servers'][$i]['history'] = 'pma__history'; 56 | // $cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs'; 57 | // $cfg['Servers'][$i]['tracking'] = 'pma__tracking'; 58 | // $cfg['Servers'][$i]['designer_coords'] = 'pma__designer_coords'; 59 | // $cfg['Servers'][$i]['userconfig'] = 'pma__userconfig'; 60 | // $cfg['Servers'][$i]['recent'] = 'pma__recent'; 61 | /* Contrib / Swekey authentication */ 62 | // $cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey-pma.conf'; 63 | 64 | /* 65 | * End of servers configuration 66 | */ 67 | 68 | /* 69 | * Directories for saving/loading files from server 70 | */ 71 | $cfg['UploadDir'] = ''; 72 | $cfg['SaveDir'] = ''; 73 | 74 | /** 75 | * Defines whether a user should be displayed a "show all (records)" 76 | * button in browse mode or not. 77 | * default = false 78 | */ 79 | //$cfg['ShowAll'] = true; 80 | 81 | /** 82 | * Number of rows displayed when browsing a result set. If the result 83 | * set contains more rows, "Previous" and "Next". 84 | * default = 30 85 | */ 86 | //$cfg['MaxRows'] = 50; 87 | 88 | /** 89 | * disallow editing of binary fields 90 | * valid values are: 91 | * false allow editing 92 | * 'blob' allow editing except for BLOB fields 93 | * 'noblob' disallow editing except for BLOB fields 94 | * 'all' disallow editing 95 | * default = blob 96 | */ 97 | //$cfg['ProtectBinary'] = 'false'; 98 | 99 | /** 100 | * Default language to use, if not browser-defined or user-defined 101 | * (you find all languages in the locale folder) 102 | * uncomment the desired line: 103 | * default = 'en' 104 | */ 105 | //$cfg['DefaultLang'] = 'en'; 106 | //$cfg['DefaultLang'] = 'de'; 107 | 108 | /** 109 | * default display direction (horizontal|vertical|horizontalflipped) 110 | */ 111 | //$cfg['DefaultDisplay'] = 'vertical'; 112 | 113 | 114 | /** 115 | * How many columns should be used for table display of a database? 116 | * (a value larger than 1 results in some information being hidden) 117 | * default = 1 118 | */ 119 | //$cfg['PropertiesNumColumns'] = 2; 120 | 121 | /** 122 | * Set to true if you want DB-based query history.If false, this utilizes 123 | * JS-routines to display query history (lost by window close) 124 | * 125 | * This requires configuration storage enabled, see above. 126 | * default = false 127 | */ 128 | //$cfg['QueryHistoryDB'] = true; 129 | 130 | /** 131 | * When using DB-based query history, how many entries should be kept? 132 | * 133 | * default = 25 134 | */ 135 | //$cfg['QueryHistoryMax'] = 100; 136 | 137 | /* 138 | * You can find more configuration options in the documentation 139 | * in the doc/ folder or at . 140 | */ 141 | 142 | $cfg['AllowUserDropDatabase'] = true; 143 | -------------------------------------------------------------------------------- /config/phpunit-composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vvv-phpunit", 3 | "description": "VVV Global Composer packages", 4 | "require": { 5 | "phpunit/phpunit": "3.7.*", 6 | "mockery/mockery": "0.8.0", 7 | "hamcrest/hamcrest": "1.1.0" 8 | }, 9 | "config": { 10 | "bin-dir": "/usr/local/bin/" 11 | }, 12 | "repositories": [ 13 | { 14 | "type": "package", 15 | "package": { 16 | "name": "hamcrest/hamcrest", 17 | "version": "1.1.0", 18 | "dist": { 19 | "type": "zip", 20 | "url": "https://hamcrest.googlecode.com/files/hamcrest-php-1.1.0.zip" 21 | }, 22 | "include-path": ["Hamcrest-1.1.0/"], 23 | "autoload": { 24 | "psr-0": { "Hamcrest_": "Hamcrest-1.1.0/" }, 25 | "files": ["Hamcrest-1.1.0/Hamcrest/Hamcrest.php"] 26 | } 27 | } 28 | } 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /config/subversion-servers: -------------------------------------------------------------------------------- 1 | ### This file specifies server-specific parameters, 2 | ### including HTTP proxy information, HTTP timeout settings, 3 | ### and authentication settings. 4 | ### 5 | ### The currently defined server options are: 6 | ### http-proxy-host Proxy host for HTTP connection 7 | ### http-proxy-port Port number of proxy host service 8 | ### http-proxy-username Username for auth to proxy service 9 | ### http-proxy-password Password for auth to proxy service 10 | ### http-proxy-exceptions List of sites that do not use proxy 11 | ### http-timeout Timeout for HTTP requests in seconds 12 | ### http-compression Whether to compress HTTP requests 13 | ### neon-debug-mask Debug mask for Neon HTTP library 14 | ### http-auth-types Auth types to use for HTTP library 15 | ### ssl-authority-files List of files, each of a trusted CA 16 | ### ssl-trust-default-ca Trust the system 'default' CAs 17 | ### ssl-client-cert-file PKCS#12 format client certificate file 18 | ### ssl-client-cert-password Client Key password, if needed. 19 | ### ssl-pkcs11-provider Name of PKCS#11 provider to use. 20 | ### http-library Which library to use for http/https 21 | ### connections (neon or serf) 22 | ### store-passwords Specifies whether passwords used 23 | ### to authenticate against a 24 | ### Subversion server may be cached 25 | ### to disk in any way. 26 | ### store-plaintext-passwords Specifies whether passwords may 27 | ### be cached on disk unencrypted. 28 | ### store-ssl-client-cert-pp Specifies whether passphrase used 29 | ### to authenticate against a client 30 | ### certificate may be cached to disk 31 | ### in any way 32 | ### store-ssl-client-cert-pp-plaintext 33 | ### Specifies whether client cert 34 | ### passphrases may be cached on disk 35 | ### unencrypted (i.e., as plaintext). 36 | ### store-auth-creds Specifies whether any auth info 37 | ### (passwords as well as server certs) 38 | ### may be cached to disk. 39 | ### username Specifies the default username. 40 | ### 41 | ### Set store-passwords to 'no' to avoid storing passwords on disk 42 | ### in any way, including in password stores. It defaults to 'yes', 43 | ### but Subversion will never save your password to disk in plaintext 44 | ### unless you tell it to. 45 | ### Note that this option only prevents saving of *new* passwords; 46 | ### it doesn't invalidate existing passwords. (To do that, remove 47 | ### the cache files by hand as described in the Subversion book.) 48 | ### 49 | ### Set store-plaintext-passwords to 'no' to avoid storing 50 | ### passwords in unencrypted form in the auth/ area of your config 51 | ### directory. Set it to 'yes' to allow Subversion to store 52 | ### unencrypted passwords in the auth/ area. The default is 53 | ### 'ask', which means that Subversion will ask you before 54 | ### saving a password to disk in unencrypted form. Note that 55 | ### this option has no effect if either 'store-passwords' or 56 | ### 'store-auth-creds' is set to 'no'. 57 | ### 58 | ### Set store-ssl-client-cert-pp to 'no' to avoid storing ssl 59 | ### client certificate passphrases in the auth/ area of your 60 | ### config directory. It defaults to 'yes', but Subversion will 61 | ### never save your passphrase to disk in plaintext unless you tell 62 | ### it to via 'store-ssl-client-cert-pp-plaintext' (see below). 63 | ### 64 | ### Note store-ssl-client-cert-pp only prevents the saving of *new* 65 | ### passphrases; it doesn't invalidate existing passphrases. To do 66 | ### that, remove the cache files by hand as described in the 67 | ### Subversion book at http://svnbook.red-bean.com/nightly/en/\ 68 | ### svn.serverconfig.netmodel.html\ 69 | ### #svn.serverconfig.netmodel.credcache 70 | ### 71 | ### Set store-ssl-client-cert-pp-plaintext to 'no' to avoid storing 72 | ### passphrases in unencrypted form in the auth/ area of your 73 | ### config directory. Set it to 'yes' to allow Subversion to 74 | ### store unencrypted passphrases in the auth/ area. The default 75 | ### is 'ask', which means that Subversion will prompt before 76 | ### saving a passphrase to disk in unencrypted form. Note that 77 | ### this option has no effect if either 'store-auth-creds' or 78 | ### 'store-ssl-client-cert-pp' is set to 'no'. 79 | ### 80 | ### Set store-auth-creds to 'no' to avoid storing any Subversion 81 | ### credentials in the auth/ area of your config directory. 82 | ### Note that this includes SSL server certificates. 83 | ### It defaults to 'yes'. Note that this option only prevents 84 | ### saving of *new* credentials; it doesn't invalidate existing 85 | ### caches. (To do that, remove the cache files by hand.) 86 | ### 87 | ### HTTP timeouts, if given, are specified in seconds. A timeout 88 | ### of 0, i.e. zero, causes a builtin default to be used. 89 | ### 90 | ### The commented-out examples below are intended only to 91 | ### demonstrate how to use this file; any resemblance to actual 92 | ### servers, living or dead, is entirely coincidental. 93 | 94 | ### In the 'groups' section, the URL of the repository you're 95 | ### trying to access is matched against the patterns on the right. 96 | ### If a match is found, the server options are taken from the 97 | ### section with the corresponding name on the left. 98 | 99 | [groups] 100 | # group1 = *.collab.net 101 | # othergroup = repository.blarggitywhoomph.com 102 | # thirdgroup = *.example.com 103 | 104 | ### Information for the first group: 105 | # [group1] 106 | # http-proxy-host = proxy1.some-domain-name.com 107 | # http-proxy-port = 80 108 | # http-proxy-username = blah 109 | # http-proxy-password = doubleblah 110 | # http-timeout = 60 111 | # http-auth-types = basic;digest;negotiate 112 | # neon-debug-mask = 130 113 | # store-plaintext-passwords = no 114 | # username = harry 115 | 116 | ### Information for the second group: 117 | # [othergroup] 118 | # http-proxy-host = proxy2.some-domain-name.com 119 | # http-proxy-port = 9000 120 | # No username and password for the proxy, so use the defaults below. 121 | 122 | ### You can set default parameters in the 'global' section. 123 | ### These parameters apply if no corresponding parameter is set in 124 | ### a specifically matched group as shown above. Thus, if you go 125 | ### through the same proxy server to reach every site on the 126 | ### Internet, you probably just want to put that server's 127 | ### information in the 'global' section and not bother with 128 | ### 'groups' or any other sections. 129 | ### 130 | ### Most people might want to configure password caching 131 | ### parameters here, but you can also configure them per server 132 | ### group (per-group settings override global settings). 133 | ### 134 | ### If you go through a proxy for all but a few sites, you can 135 | ### list those exceptions under 'http-proxy-exceptions'. This only 136 | ### overrides defaults, not explicitly matched server names. 137 | ### 138 | ### 'ssl-authority-files' is a semicolon-delimited list of files, 139 | ### each pointing to a PEM-encoded Certificate Authority (CA) 140 | ### SSL certificate. See details above for overriding security 141 | ### due to SSL. 142 | [global] 143 | # http-proxy-exceptions = *.exception.com, www.internal-site.org 144 | # http-proxy-host = defaultproxy.whatever.com 145 | # http-proxy-port = 7000 146 | # http-proxy-username = defaultusername 147 | # http-proxy-password = defaultpassword 148 | # http-compression = no 149 | # http-auth-types = basic;digest;negotiate 150 | # No http-timeout, so just use the builtin default. 151 | # No neon-debug-mask, so neon debugging is disabled. 152 | # ssl-authority-files = /path/to/CAcert.pem;/path/to/CAcert2.pem 153 | # 154 | # Password / passphrase caching parameters: 155 | # store-passwords = no 156 | store-plaintext-passwords = no 157 | # store-ssl-client-cert-pp = no 158 | # store-ssl-client-cert-pp-plaintext = no 159 | -------------------------------------------------------------------------------- /config/vimrc: -------------------------------------------------------------------------------- 1 | " The .vimrc file lets you customize your vim environment. Some of the most annoying 2 | " vim behaviors have been remedied by the included configs. Feel free to modify on 3 | " your own - check out brandwaffle's .vimrc file for some good ideas. 4 | " https://github.com/brandwaffle/dotfiles/blob/master/.vimrc 5 | 6 | " For when you forget to sudo.. Really Write the file. 7 | cmap w!! w !sudo tee % >/dev/null 8 | 9 | " Stupid shift key fixes 10 | if !exists('g:spf13_no_keyfixes') 11 | if has("user_commands") 12 | command! -bang -nargs=* -complete=file E e 13 | command! -bang -nargs=* -complete=file W w 14 | command! -bang -nargs=* -complete=file Wq wq 15 | command! -bang -nargs=* -complete=file WQ wq 16 | command! -bang Wa wa 17 | command! -bang WA wa 18 | command! -bang Q q 19 | command! -bang QA qa 20 | command! -bang Qa qa 21 | endif 22 | 23 | cmap Tabe tabe 24 | endif 25 | -------------------------------------------------------------------------------- /config/wordpress-config/mu-plugins/jf-cron-filter.php: -------------------------------------------------------------------------------- 1 | /dev/null | wc -l` 28 | if [ $sql_count != 0 ] 29 | then 30 | for file in $( ls *.sql ) 31 | do 32 | pre_dot=${file%%.*} 33 | mysql_cmd='SHOW TABLES FROM `'$pre_dot'`' # Required to support hypens in database names 34 | db_exist=`mysql -u root -proot --skip-column-names -e "$mysql_cmd"` 35 | if [ "$?" != "0" ] 36 | then 37 | printf " * Error - Create $pre_dot database via init-custom.sql before attempting import\n\n" 38 | else 39 | if [ "" == "$db_exist" ] 40 | then 41 | printf "mysql -u root -proot $pre_dot < $pre_dot.sql\n" 42 | mysql -u root -proot $pre_dot < $pre_dot.sql 43 | printf " * Import of $pre_dot successful\n" 44 | else 45 | printf " * Skipped import of $pre_dot - tables exist\n" 46 | fi 47 | fi 48 | done 49 | printf "Databases imported\n" 50 | else 51 | printf "No custom databases to import\n" 52 | fi 53 | -------------------------------------------------------------------------------- /database/init-custom.sql.sample: -------------------------------------------------------------------------------- 1 | # Any SQL files included in the database/backups directory will be 2 | # imported as Vagrant boots up. To best manage expectations, these 3 | # databases should be created in advance with proper user permissions 4 | # so that any code bases configured to work with them will start 5 | # without trouble. 6 | # 7 | # Create a copy of this file as "init-custom.sql" in the database directory 8 | # and add any additional SQL commands that should run on startup. Most likely 9 | # these will be similar to the following - with CREATE DATABASE and GRANT ALL, 10 | # but it can be any command. 11 | # 12 | CREATE DATABASE IF NOT EXISTS `my_database_name`; 13 | GRANT ALL PRIVILEGES ON `my_database_name`.* TO 'thisuser'@'localhost' IDENTIFIED BY 'thatpass'; 14 | -------------------------------------------------------------------------------- /database/init.sql: -------------------------------------------------------------------------------- 1 | # We include default installations of WordPress with this Vagrant setup. 2 | # In order for that to respond properly, default databases should be 3 | # available for use. 4 | CREATE DATABASE IF NOT EXISTS `wordpress_default`; 5 | GRANT ALL PRIVILEGES ON `wordpress_default`.* TO 'wp'@'localhost' IDENTIFIED BY 'wp'; 6 | CREATE DATABASE IF NOT EXISTS `wordpress_trunk`; 7 | GRANT ALL PRIVILEGES ON `wordpress_trunk`.* TO 'wp'@'localhost' IDENTIFIED BY 'wp'; 8 | CREATE DATABASE IF NOT EXISTS `wordpress_develop`; 9 | GRANT ALL PRIVILEGES ON `wordpress_develop`.* TO 'wp'@'localhost' IDENTIFIED BY 'wp'; 10 | CREATE DATABASE IF NOT EXISTS `wordpress_unit_tests`; 11 | GRANT ALL PRIVILEGES ON `wordpress_unit_tests`.* TO 'wp'@'localhost' IDENTIFIED BY 'wp'; 12 | 13 | # Create an external user with privileges on all databases in mysql so 14 | # that a connection can be made from the local machine without an SSH tunnel 15 | GRANT ALL PRIVILEGES ON *.* TO 'external'@'%' IDENTIFIED BY 'external'; 16 | -------------------------------------------------------------------------------- /provision/provision.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # provision.sh 4 | # 5 | # This file is specified in Vagrantfile and is loaded by Vagrant as the primary 6 | # provisioning script whenever the commands `vagrant up`, `vagrant provision`, 7 | # or `vagrant reload` are used. It provides all of the default packages and 8 | # configurations included with Varying Vagrant Vagrants. 9 | 10 | # By storing the date now, we can calculate the duration of provisioning at the 11 | # end of this script. 12 | start_seconds="$(date +%s)" 13 | 14 | # Capture a basic ping result to Google's primary DNS server to determine if 15 | # outside access is available to us. If this does not reply after 2 attempts, 16 | # we try one of Level3's DNS servers as well. If neither IP replies to a ping, 17 | # then we'll skip a few things further in provisioning rather than creating a 18 | # bunch of errors. 19 | ping_result="$(ping -c 2 8.8.4.4 2>&1)" 20 | if [[ $ping_result != *bytes?from* ]]; then 21 | ping_result="$(ping -c 2 4.2.2.2 2>&1)" 22 | fi 23 | 24 | # PACKAGE INSTALLATION 25 | # 26 | # Build a bash array to pass all of the packages we want to install to a single 27 | # apt-get command. This avoids doing all the leg work each time a package is 28 | # set to install. It also allows us to easily comment out or add single 29 | # packages. We set the array as empty to begin with so that we can append 30 | # individual packages to it as required. 31 | apt_package_install_list=() 32 | 33 | # Start with a bash array containing all packages we want to install in the 34 | # virtual machine. We'll then loop through each of these and check individual 35 | # status before adding them to the apt_package_install_list array. 36 | apt_package_check_list=( 37 | 38 | # PHP5 39 | # 40 | # Our base packages for php5. As long as php5-fpm and php5-cli are 41 | # installed, there is no need to install the general php5 package, which 42 | # can sometimes install apache as a requirement. 43 | php5-fpm 44 | php5-cli 45 | 46 | # Common and dev packages for php 47 | php5-common 48 | php5-dev 49 | 50 | # Extra PHP modules that we find useful 51 | php5-memcache 52 | php5-imagick 53 | php5-xdebug 54 | php5-mcrypt 55 | php5-mysql 56 | php5-imap 57 | php5-curl 58 | php-pear 59 | php5-gd 60 | php-apc 61 | php5 62 | 63 | # Apache is installed as the default web server 64 | apache2-mpm-worker 65 | libapache2-mod-fastcgi 66 | 67 | # memcached is made available for object caching 68 | memcached 69 | 70 | # mysql is the default database 71 | mysql-server 72 | 73 | # other packages that come in handy 74 | imagemagick 75 | subversion 76 | git-core 77 | unzip 78 | ngrep 79 | curl 80 | make 81 | vim 82 | colordiff 83 | postfix 84 | 85 | # Req'd for i18n tools 86 | gettext 87 | 88 | # Req'd for Webgrind 89 | graphviz 90 | 91 | # dos2unix 92 | # Allows conversion of DOS style line endings to something we'll have less 93 | # trouble with in Linux. 94 | dos2unix 95 | 96 | # nodejs for use by grunt 97 | g++ 98 | nodejs 99 | ) 100 | 101 | echo "Check for apt packages to install..." 102 | 103 | # Loop through each of our packages that should be installed on the system. If 104 | # not yet installed, it should be added to the array of packages to install. 105 | for pkg in "${apt_package_check_list[@]}"; do 106 | package_version="$(dpkg -s $pkg 2>&1 | grep 'Version:' | cut -d " " -f 2)" 107 | if [[ -n "${package_version}" ]]; then 108 | space_count="$(expr 20 - "${#pkg}")" #11 109 | pack_space_count="$(expr 30 - "${#package_version}")" 110 | real_space="$(expr ${space_count} + ${pack_space_count} + ${#package_version})" 111 | printf " * $pkg %${real_space}.${#package_version}s ${package_version}\n" 112 | else 113 | echo " *" $pkg [not installed] 114 | apt_package_install_list+=($pkg) 115 | fi 116 | done 117 | 118 | # MySQL 119 | # 120 | # Use debconf-set-selections to specify the default password for the root MySQL 121 | # account. This runs on every provision, even if MySQL has been installed. If 122 | # MySQL is already installed, it will not affect anything. 123 | echo mysql-server mysql-server/root_password password root | debconf-set-selections 124 | echo mysql-server mysql-server/root_password_again password root | debconf-set-selections 125 | 126 | # Postfix 127 | # 128 | # Use debconf-set-selections to specify the selections in the postfix setup. Set 129 | # up as an 'Internet Site' with the host name 'vvv'. Note that if your current 130 | # Internet connection does not allow communication over port 25, you will not be 131 | # able to send mail, even with postfix installed. 132 | echo postfix postfix/main_mailer_type select Internet Site | debconf-set-selections 133 | echo postfix postfix/mailname string vvv | debconf-set-selections 134 | 135 | # Provide our custom apt sources before running `apt-get update` 136 | ln -sf /srv/config/apt-source-append.list /etc/apt/sources.list.d/vvv-sources.list 137 | echo "Linked custom apt sources" 138 | 139 | if [[ $ping_result == *bytes?from* ]]; then 140 | # If there are any packages to be installed in the apt_package_list array, 141 | # then we'll run `apt-get update` and then `apt-get install` to proceed. 142 | if [[ ${#apt_package_install_list[@]} = 0 ]]; then 143 | echo -e "No apt packages to install.\n" 144 | else 145 | # Before running `apt-get update`, we should add the public keys for 146 | # the packages that we are installing from non standard sources via 147 | # our appended apt source.list 148 | 149 | # Launchpad Subversion key EAA903E3A2F4C039 150 | gpg -q --keyserver keyserver.ubuntu.com --recv-key EAA903E3A2F4C039 151 | gpg -q -a --export EAA903E3A2F4C039 | apt-key add - 152 | 153 | # Launchpad PHP key 4F4EA0AAE5267A6C 154 | gpg -q --keyserver keyserver.ubuntu.com --recv-key 4F4EA0AAE5267A6C 155 | gpg -q -a --export 4F4EA0AAE5267A6C | apt-key add - 156 | 157 | # Launchpad git key A1715D88E1DF1F24 158 | gpg -q --keyserver keyserver.ubuntu.com --recv-key A1715D88E1DF1F24 159 | gpg -q -a --export A1715D88E1DF1F24 | apt-key add - 160 | 161 | # Launchpad nodejs key C7917B12 162 | gpg -q --keyserver keyserver.ubuntu.com --recv-key C7917B12 163 | gpg -q -a --export C7917B12 | apt-key add - 164 | 165 | # update all of the package references before installing anything 166 | echo "Running apt-get update..." 167 | apt-get update --assume-yes 168 | 169 | # install required packages 170 | echo "Installing apt-get packages..." 171 | apt-get install --assume-yes ${apt_package_install_list[@]} 172 | 173 | # Clean up apt caches 174 | apt-get clean 175 | fi 176 | 177 | # ack-grep 178 | # 179 | # Install ack-rep directory from the version hosted at beyondgrep.com as the 180 | # PPAs for Ubuntu Precise are not available yet. 181 | if [[ -f /usr/bin/ack ]]; then 182 | echo "ack-grep already installed" 183 | else 184 | echo "Installing ack-grep as ack" 185 | curl -s http://beyondgrep.com/ack-2.04-single-file > /usr/bin/ack && chmod +x /usr/bin/ack 186 | fi 187 | 188 | # COMPOSER 189 | # 190 | # Install or Update Composer based on current state. Updates are direct from 191 | # master branch on GitHub repository. 192 | if [[ -n "$(composer --version | grep -q 'Composer version')" ]]; then 193 | echo "Updating Composer..." 194 | composer self-update 195 | else 196 | echo "Installing Composer..." 197 | curl -sS https://getcomposer.org/installer | php 198 | chmod +x composer.phar 199 | mv composer.phar /usr/local/bin/composer 200 | fi 201 | 202 | # PHPUnit 203 | # 204 | # Check that PHPUnit, Mockery, and Hamcrest are all successfully installed. 205 | # If not, then Composer should be given another shot at it. Versions for 206 | # these packages are controlled in `/srv/config/phpunit-composer.json`. 207 | if [[ ! -d /usr/local/src/vvv-phpunit ]]; then 208 | echo "Installing PHPUnit, Hamcrest and Mockery..." 209 | mkdir -p /usr/local/src/vvv-phpunit 210 | cp /srv/config/phpunit-composer.json /usr/local/src/vvv-phpunit/composer.json 211 | sh -c "cd /usr/local/src/vvv-phpunit && composer install" 212 | else 213 | cd /usr/local/src/vvv-phpunit 214 | if [[ -n "$(composer show -i | grep -q 'mockery')" ]]; then 215 | echo "Mockery installed" 216 | else 217 | vvvphpunit_update=1 218 | fi 219 | if [[ -n "$(composer show -i | grep -q 'phpunit')" ]]; then 220 | echo "PHPUnit installed" 221 | else 222 | vvvphpunit_update=1 223 | fi 224 | if [[ -n "$(composer show -i | grep -q 'hamcrest')" ]]; then 225 | echo "Hamcrest installed" 226 | else 227 | vvvphpunit_update=1 228 | fi 229 | cd ~/ 230 | fi 231 | 232 | if [[ "$vvvphpunit_update" = 1 ]]; then 233 | echo "Update PHPUnit, Hamcrest and Mockery..." 234 | cp /srv/config/phpunit-composer.json /usr/local/src/vvv-phpunit/composer.json 235 | sh -c "cd /usr/local/src/vvv-phpunit && composer update" 236 | fi 237 | 238 | # Grunt 239 | # 240 | # Install or Update Grunt based on gurrent state. Updates are direct 241 | # from NPM 242 | if [[ "$(grunt --version)" ]]; then 243 | echo "Updating Grunt CLI" 244 | npm update -g grunt-cli &>/dev/null 245 | npm update -g grunt-sass &>/dev/null 246 | npm update -g grunt-cssjanus &>/dev/null 247 | else 248 | echo "Installing Grunt CLI" 249 | npm install -g grunt-cli &>/dev/null 250 | npm install -g grunt-sass &>/dev/null 251 | npm install -g grunt-cssjanus &>/dev/null 252 | fi 253 | else 254 | echo -e "\nNo network connection available, skipping package installation" 255 | fi 256 | 257 | #echo -e "\nSetup configuration files..." 258 | 259 | # Unlink all previous symlinked config files. This allows us to avoid errors 260 | # as we proceed to copy over new versions of these config files. It is likely 261 | # that this section will be removed after everyone has had a fair chance. With 262 | # a `vagrant destroy`, none of this is necessary. 263 | unlink /etc/apache2/apache2.conf 264 | unlink /etc/apache2/conf.d/php5-fpm.conf 265 | unlink /etc/php5/fpm/pool.d/www.conf 266 | unlink /etc/php5/fpm/conf.d/php-custom.ini 267 | unlink /etc/php5/fpm/conf.d/xdebug.ini 268 | unlink /etc/php5/fpm/conf.d/apc.ini 269 | unlink /etc/memcached.conf 270 | unlink /home/vagrant/.bash_profile 271 | unlink /home/vagrant/.bash_aliases 272 | unlink /home/vagrant/.vimrc 273 | 274 | # Used to to ensure proper services are started on `vagrant up` 275 | cp /srv/config/init/vvv-start.conf /etc/init/vvv-start.conf 276 | 277 | echo " * /srv/config/init/vvv-start.conf -> /etc/init/vvv-start.conf" 278 | 279 | # Copy Apache configuration from local 280 | cp /srv/config/apache-config/apache2.conf /etc/apache2/apache2.conf 281 | cp /srv/config/apache-config/php5-fpm.conf /etc/apache2/conf.d/php5-fpm.conf 282 | rsync -rvzh --delete /srv/config/apache-config/sites/ /etc/apache2/custom-sites/ 283 | 284 | echo " * /srv/config/apache-config/apache2.conf -> /etc/apache2/apache2.conf" 285 | echo " * /srv/config/apache-config/php-fpm.conf -> /etc/apache2/conf.d/php-fpm.conf" 286 | echo " * /srv/config/apache-config/sites/ -> /etc/apache2/custom-sites/" 287 | 288 | # Configure Apache for PHP-FPM 289 | a2enmod actions fastcgi alias 290 | 291 | # Enable mod_rewrite 292 | a2enmod rewrite 293 | 294 | # Copy php-fpm configuration from local 295 | cp /srv/config/php5-fpm-config/www.conf /etc/php5/fpm/pool.d/www.conf 296 | cp /srv/config/php5-fpm-config/php-custom.ini /etc/php5/fpm/conf.d/php-custom.ini 297 | cp /srv/config/php5-fpm-config/xdebug.ini /etc/php5/fpm/conf.d/xdebug.ini 298 | cp /srv/config/php5-fpm-config/apc.ini /etc/php5/fpm/conf.d/apc.ini 299 | 300 | echo " * /srv/config/php5-fpm-config/www.conf -> /etc/php5/fpm/pool.d/www.conf" 301 | echo " * /srv/config/php5-fpm-config/php-custom.ini -> /etc/php5/fpm/conf.d/php-custom.ini" 302 | echo " * /srv/config/php5-fpm-config/xdebug.ini -> /etc/php5/fpm/conf.d/xdebug.ini" 303 | echo " * /srv/config/php5-fpm-config/apc.ini -> /etc/php5/fpm/conf.d/apc.ini" 304 | 305 | # Copy memcached configuration from local 306 | cp /srv/config/memcached-config/memcached.conf /etc/memcached.conf 307 | 308 | echo " * /srv/config/memcached-config/memcached.conf -> /etc/memcached.conf" 309 | 310 | # Copy custom dotfiles and bin file for the vagrant user from local 311 | cp /srv/config/bash_profile /home/vagrant/.bash_profile 312 | cp /srv/config/bash_aliases /home/vagrant/.bash_aliases 313 | cp /srv/config/vimrc /home/vagrant/.vimrc 314 | if [[ ! -d /home/vagrant/.subversion ]]; then 315 | mkdir /home/vagrant/.subversion 316 | fi 317 | cp /srv/config/subversion-servers /home/vagrant/.subversion/servers 318 | if [[ ! -d /home/vagrant/bin ]]; then 319 | mkdir /home/vagrant/bin 320 | fi 321 | rsync -rvzh --delete /srv/config/homebin/ /home/vagrant/bin/ 322 | 323 | echo " * /srv/config/bash_profile -> /home/vagrant/.bash_profile" 324 | echo " * /srv/config/bash_aliases -> /home/vagrant/.bash_aliases" 325 | echo " * /srv/config/vimrc -> /home/vagrant/.vimrc" 326 | echo " * /srv/config/subversion-servers -> /home/vagrant/.subversion/servers" 327 | echo " * /srv/config/homebin -> /home/vagrant/bin" 328 | 329 | # RESTART SERVICES 330 | # 331 | # Make sure the services we expect to be running are running. 332 | echo -e "\nRestart services..." 333 | service apache2 restart 334 | service memcached restart 335 | 336 | # Disable PHP Xdebug module by default 337 | php5dismod xdebug 338 | service php5-fpm restart 339 | 340 | # If MySQL is installed, go through the various imports and service tasks. 341 | exists_mysql="$(service mysql status)" 342 | if [[ "mysql: unrecognized service" != "${exists_mysql}" ]]; then 343 | echo -e "\nSetup MySQL configuration file links..." 344 | 345 | # Copy mysql configuration from local 346 | cp /srv/config/mysql-config/my.cnf /etc/mysql/my.cnf 347 | cp /srv/config/mysql-config/root-my.cnf /home/vagrant/.my.cnf 348 | 349 | echo " * /srv/config/mysql-config/my.cnf -> /etc/mysql/my.cnf" 350 | echo " * /srv/config/mysql-config/root-my.cnf -> /home/vagrant/.my.cnf" 351 | 352 | # MySQL gives us an error if we restart a non running service, which 353 | # happens after a `vagrant halt`. Check to see if it's running before 354 | # deciding whether to start or restart. 355 | if [[ "mysql stop/waiting" == "${exists_mysql}" ]]; then 356 | echo "service mysql start" 357 | service mysql start 358 | else 359 | echo "service mysql restart" 360 | service mysql restart 361 | fi 362 | 363 | # IMPORT SQL 364 | # 365 | # Create the databases (unique to system) that will be imported with 366 | # the mysqldump files located in database/backups/ 367 | if [[ -f /srv/database/init-custom.sql ]]; then 368 | mysql -u root -proot < /srv/database/init-custom.sql 369 | echo -e "\nInitial custom MySQL scripting..." 370 | else 371 | echo -e "\nNo custom MySQL scripting found in database/init-custom.sql, skipping..." 372 | fi 373 | 374 | # Setup MySQL by importing an init file that creates necessary 375 | # users and databases that our vagrant setup relies on. 376 | mysql -u root -proot < /srv/database/init.sql 377 | echo "Initial MySQL prep..." 378 | 379 | # Process each mysqldump SQL file in database/backups to import 380 | # an initial data set for MySQL. 381 | /srv/database/import-sql.sh 382 | else 383 | echo -e "\nMySQL is not installed. No databases imported." 384 | fi 385 | 386 | if [[ $ping_result == *bytes?from* ]]; then 387 | # WP-CLI Install 388 | if [[ ! -d /srv/www/wp-cli ]]; then 389 | echo -e "\nDownloading wp-cli, see http://wp-cli.org" 390 | git clone git://github.com/wp-cli/wp-cli.git /srv/www/wp-cli 391 | cd /srv/www/wp-cli 392 | composer install 393 | else 394 | echo -e "\nUpdating wp-cli..." 395 | cd /srv/www/wp-cli 396 | git pull --rebase origin master 397 | composer update 398 | fi 399 | # Link `wp` to the `/usr/local/bin` directory 400 | ln -sf /srv/www/wp-cli/bin/wp /usr/local/bin/wp 401 | 402 | # Download and extract phpMemcachedAdmin to provide a dashboard view and 403 | # admin interface to the goings on of memcached when running 404 | if [[ ! -d /srv/www/default/memcached-admin ]]; then 405 | echo -e "\nDownloading phpMemcachedAdmin, see https://code.google.com/p/phpmemcacheadmin/" 406 | cd /srv/www/default 407 | wget -q -O phpmemcachedadmin.tar.gz 'https://phpmemcacheadmin.googlecode.com/files/phpMemcachedAdmin-1.2.2-r262.tar.gz' 408 | mkdir memcached-admin 409 | tar -xf phpmemcachedadmin.tar.gz --directory memcached-admin 410 | rm phpmemcachedadmin.tar.gz 411 | else 412 | echo "phpMemcachedAdmin already installed." 413 | fi 414 | 415 | # Webgrind install (for viewing callgrind/cachegrind files produced by 416 | # xdebug profiler) 417 | if [[ ! -d /srv/www/default/webgrind ]]; then 418 | echo -e "\nDownloading webgrind, see https://github.com/jokkedk/webgrind" 419 | git clone git://github.com/jokkedk/webgrind.git /srv/www/default/webgrind 420 | else 421 | echo -e "\nUpdating webgrind..." 422 | cd /srv/www/default/webgrind 423 | git pull --rebase origin master 424 | fi 425 | 426 | # PHP_CodeSniffer (for running WordPress-Coding-Standards) 427 | if [[ ! -d /srv/www/phpcs ]]; then 428 | echo -e "\nDownloading PHP_CodeSniffer (phpcs), see https://github.com/squizlabs/PHP_CodeSniffer" 429 | git clone git://github.com/squizlabs/PHP_CodeSniffer.git /srv/www/phpcs 430 | else 431 | echo -e "\nUpdating PHP_CodeSniffer (phpcs)..." 432 | cd /srv/www/phpcs 433 | git pull --rebase origin master 434 | fi 435 | 436 | # Sniffs WordPress Coding Standards 437 | if [[ ! -d /srv/www/phpcs/CodeSniffer/Standards/WordPress ]]; then 438 | echo -e "\nDownloading WordPress-Coding-Standards, snifs for PHP_CodeSniffer, see https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards" 439 | git clone git://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git /srv/www/phpcs/CodeSniffer/Standards/WordPress 440 | else 441 | echo -e "\nUpdating PHP_CodeSniffer..." 442 | cd /srv/www/phpcs/CodeSniffer/Standards/WordPress 443 | git pull --rebase origin master 444 | fi 445 | 446 | # Install and configure the latest stable version of WordPress 447 | if [[ ! -d /srv/www/wordpress-default ]]; then 448 | echo "Downloading WordPress Stable, see http://wordpress.org/" 449 | cd /srv/www/ 450 | curl -O http://wordpress.org/latest.tar.gz 451 | tar -xvf latest.tar.gz 452 | mv wordpress wordpress-default 453 | rm latest.tar.gz 454 | cd /srv/www/wordpress-default 455 | echo "Configuring WordPress Stable..." 456 | wp core config --allow-root --dbname=wordpress_default --dbuser=wp --dbpass=wp --quiet --extra-php </dev/null 501 | else 502 | echo "Updating WordPress develop..." 503 | cd /srv/www/wordpress-develop/ 504 | svn up 505 | npm install &>/dev/null 506 | fi 507 | 508 | if [[ ! -d /srv/www/wordpress-develop/build ]]; then 509 | echo "Initializing grunt in WordPress develop... This may take a few moments." 510 | cd /srv/www/wordpress-develop/ 511 | grunt 512 | fi 513 | 514 | # Download phpMyAdmin 515 | if [[ ! -d /srv/www/default/database-admin ]]; then 516 | echo "Downloading phpMyAdmin 4.0.10..." 517 | cd /srv/www/default 518 | wget -q -O phpmyadmin.tar.gz 'http://sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/4.0.10/phpMyAdmin-4.0.10-all-languages.tar.gz/download' 519 | tar -xf phpmyadmin.tar.gz 520 | mv phpMyAdmin-4.0.10-all-languages database-admin 521 | rm phpmyadmin.tar.gz 522 | else 523 | echo "PHPMyAdmin already installed." 524 | fi 525 | cp /srv/config/phpmyadmin-config/config.inc.php /srv/www/default/database-admin/ 526 | else 527 | echo -e "\nNo network available, skipping network installations" 528 | fi 529 | 530 | 531 | # Look for site setup scripts 532 | for SITE_CONFIG_FILE in $(find /srv/www -maxdepth 5 -name 'vvv-init.sh'); do 533 | DIR="$(dirname $SITE_CONFIG_FILE)" 534 | ( 535 | cd $DIR 536 | bash vvv-init.sh 537 | ) 538 | done 539 | 540 | # RESTART SERVICES AGAIN 541 | # 542 | # Make sure the services we expect to be running are running. 543 | echo -e "\nRestart Apache..." 544 | service apache2 restart 545 | 546 | # Parse any vvv-hosts file located in www/ or subdirectories of www/ 547 | # for domains to be added to the virtual machine's host file so that it is 548 | # self aware. 549 | # 550 | # Domains should be entered on new lines. 551 | echo "Cleaning the virtual machine's /etc/hosts file..." 552 | sed -n '/# vvv-auto$/!p' /etc/hosts > /tmp/hosts 553 | mv /tmp/hosts /etc/hosts 554 | echo "Adding domains to the virtual machine's /etc/hosts file..." 555 | find /srv/www/ -maxdepth 5 -name 'vvv-hosts' | \ 556 | while read hostfile; do 557 | while IFS='' read -r line || [ -n "$line" ]; do 558 | if [[ "#" != ${line:0:1} ]]; then 559 | if [[ -z "$(grep -q "^127.0.0.1 $line$" /etc/hosts)" ]]; then 560 | echo "127.0.0.1 $line # vvv-auto" >> /etc/hosts 561 | echo " * Added $line from $hostfile" 562 | fi 563 | fi 564 | done < $hostfile 565 | done 566 | 567 | end_seconds="$(date +%s)" 568 | echo "-----------------------------" 569 | echo "Provisioning complete in "$(expr $end_seconds - $start_seconds)" seconds" 570 | if [[ $ping_result == *bytes?from* ]]; then 571 | echo "External network connection established, packages up to date." 572 | else 573 | echo "No external network available. Package installation and maintenance skipped." 574 | fi 575 | echo "For further setup instructions, visit http://vvv.dev" 576 | -------------------------------------------------------------------------------- /www/.gitshow: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericmann/vvv-apache/0db4db555f20eef9b5affe6b05cad29cbadbc6ae/www/.gitshow -------------------------------------------------------------------------------- /www/default/index.php: -------------------------------------------------------------------------------- 1 | 14 | 15 | 16 | 17 | Varying Vagrant Vagrants Dashboard 18 | 19 | 20 | 21 | 29 | 30 | 36 | 37 | -------------------------------------------------------------------------------- /www/default/phpinfo/index.php: -------------------------------------------------------------------------------- 1 |