Skip to content
This repository was archived by the owner on May 1, 2019. It is now read-only.

Build Vagrant slim configuration #511

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ This site will eventually be a community site for publishing and sharing Zend Fr
* Copy `config/autoload/cache.local.php.dist` to `config/autoload/cache.local.php`. It's optional
* Build the Database with ``php public/index.php migrations:migrate``

### Vagrant setup
* Clone this project `git clone git://github.com/zendframework/modules.zendframework.com.git`
* Run `vagrant up` to build environment
* Copy `config/autoload/github.local.php.dist` to `config/autoload/github.local.php` and enter the Id and Secret provided during the application registration on GitHub
* Copy `config/autoload/database.local.php.dist` to `config/autoload/database.local.php` and enter your database (username: root, password: root)
* Copy `config/autoload/cache.local.php.dist` to `config/autoload/cache.local.php`. It's optional
* Build the Database with ``php public/index.php migrations:migrate``

### Development Mode

To enable development mode:
Expand Down
48 changes: 48 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

VAGRANTFILE_API_VERSION = '2'

@script = <<SCRIPT
DOCUMENT_ROOT_ZEND="/var/www/zf/public"
apt-get update
debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
apt-get install -y apache2 git curl php5-cli php5 php5-curl php5-intl \
libapache2-mod-php5 \
mysql-server php5-mysql
echo "
<VirtualHost *:80>
ServerName zfmodules.local
DocumentRoot $DOCUMENT_ROOT_ZEND
<Directory $DOCUMENT_ROOT_ZEND>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
" > /etc/apache2/sites-available/zfmodules.conf
a2enmod rewrite
a2dissite 000-default
a2ensite zfmodules
service apache2 restart
cd /var/www/zf
curl -Ss https://getcomposer.org/installer | php
php composer.phar install --no-progress
echo "** [ZEND] Visit http://localhost:8085 in your browser for to view the application **"
SCRIPT

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = 'ubuntu/vivid64'
config.vm.network "forwarded_port", guest: 80, host: 8085
config.vm.network "forwarded_port", guest: 3306, host: 3306
config.vm.hostname = "zfmodules.local"
config.vm.synced_folder '.', '/var/www/zf', owner: "www-data", group: "www-data"
config.vm.provision 'shell', inline: @script

config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--memory", "1024"]
end

end