project
└── frontend
└── www
├── assets
└── index.php
git clone [email protected]:stepanzarubin/vulamp.git
-
Install Vagrant https://www.vagrantup.com/
-
Install Virtual Box https://www.virtualbox.org/. Make sure the disk with virtual machines has at least 50GB of free space
-
On Windows (optional) I recommend https://conemu.github.io/ as a console emulator
-
Install Vagrant plugins
vagrant plugin install [plugin_name]- https://github.com/smerrill/vagrant-rsync-back
- Default
rsyncalternative: https://github.com/smerrill/vagrant-gatling-rsync
Official plugins https://github.com/mitchellh/vagrant/wiki/Available-Vagrant-Plugins you can install any other which work better for your host OS
Call
vagrant plugin updatein order to update installed plugins -
On Windows Only path fix required (can be actual for any plugin)
- Find these 2 files
2.
C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.8.1\plugins\synced_folders\rsync\helper.rb3.C:\Users\YOUR USER\.vagrant.d\gems\gems\vagrant-rsync-back-0.0.1\lib\vagrant-rsync-back\command\rsync_back.rb - Both of them have this code
# rsync for Windows expects cygwin style paths, always. hostpath = Vagrant::Util::Platform.cygwin_path(hostpath)- Replace
hostpathto be
hostpath = "/cygdrive" + Vagrant::Util::Platform.cygwin_path(hostpath) - Find these 2 files
2.
-
On Windows Only
Rsyncinstall options:- Try
vulamp\extra\windows\Rsync_3.0.9.rar rsyncon host and VM must be compatible so get a version which works for you- https://www.cygwin.com/
- https://github.com/fdcastel/cygrsync (
RSync.exeto systemPATHvariable)
- Try
-
Place database file
db.gzunderproject\vulamp\db\db.gz -
Create
project\vulamp\Vagrantfilebased onvagrant\Vagrantfile.example, open it and updatevirtualboxprovider setup, set as big values as you can formemoryandcpusbased on your hardware -
Run Vagrant from console
- Go to
project\vulamp\ - Run
vagrant up - Run
vagrant rsync-autoand keep this running in the background
- Go to
-
Import project database (potential problem on Windows with running
<command>can be fixed bydos2unixfile converter, .e.g inside Git Bashdos2unix.exe importDb.sh importDb.sh)- Run
vagrant sshor connect to[email protected]using any ssh client - Run inside VM
/vulamp/sh/db/importDb.shor/vulamp/sh/db/importDbPowerOff.sh(last will also power off VM, after importing big database most likely you will restart your computer)
- Run
-
Working with database migrations
- Run inside guest VM migration command
- Run on host
vagrant rsync-backin order to copy generated migration files back to host
-
Bootstrapping additional software supposed to happen via
sh/bootstrapsdirectory -
Configure your host OS hosts file, e.g. on Windows add
192.168.33.11 vg.projecttoC:\Windows\System32\drivers\etc\hosts -
192.168.33.11is defined inVagrantfileasconfig.vm.network "private_network", ip: "192.168.33.11"