My personal modified Vagrant lamp file based on scotch box
##This version includes:
- Multisite settings ready
- Folder db for database
- Mysql dump backups on each provision by date
- Ubuntu 14.04 LTS (Trusty Tahr)
- PHP 5.6
- Ruby 2.2.x
- Vim
- Git
- cURL
- GD and Imagick
- Composer
- Beanstalkd
- Node
- NPM
- Mcrypt
- MySQL
- PostgreSQL
- SQLite
- Redis
- Memcache and Memcached
- Grunt
- Bower
- Yeoman
- Gulp
- Browsersync
- PM2
- Laravel Installer
- Laravel Envoy
- Blackfire Profiler
- No Internet connection required
- PHP Errors turned on
- Laravel and WordPress ready
- Operating System agnostic
- Goodbye XAMPP / WAMP
- New Vagrant version? Update worry free. ScotchBox is very reliable with a lesser chance of breaking with various updates
- Super easy database access and control
- Virtual host ready
- PHP short tags turned on
- H5BP’s server configs
- MIT License
- Download and Install Vagrant
- Download and Install VirtualBox
- Clone the Scotch Box GitHub Repository
- Run
vagrant up - Access Your Project at http://192.168.33.10/
vagrant upvagrant suspendvagrant destroyvagrant ssh-
Add projects on vagrant file at line 25 each project should be added with quots, example: "project1.dev" "yourdomain.dev" "projectnamex.dev" and so on.
-
After adding a project run vagrant up then vagrant provision so it creats the necesary folders.
-
Add your new project domain to the host list of your system, on a windows machine this is located at C:\Windows\System32\drivers\etc\hosts remeber this file can only be edited by admin or root. Host should start with the box ip 192.168.33.10 then your project domain an example of how it should look:
192.168.33.10 project1.dev
192.168.33.10 domainxyz.dev
192.168.33.10 mydomainname.dev
192.168.33.10 project201.dev
- Hostname: localhost or 127.0.0.1
- Username: root
- Password: root
- Database: scotchbox
- Hostname: localhost or 127.0.0.1
- Username: root
- Password: root
- Database: scotchbox
- Port: 5432
- Hostname: localhost
- Database: scotchbox
- Port: 27017
- Hostname: 127.0.0.1:2222
- Username: vagrant
- Password: vagrant
Just do:
vagrant ssh
mailcatcher --http-ip=0.0.0.0
Then visit:
http://192.168.33.10:1080
Although not necessary, if you want to check for updates, just type:
vagrant box outdatedIt will tell you if you are running the latest version or not, of the box. If it says you aren't, simply run:
vagrant box updateIf you're like me, you prefer to develop at a domain name versus an IP address. If you want to get rid of the some-what ugly IP address, just add a record like the following example to your computer's host file.
192.168.33.10 whatever-i-want.localOr if you want "www" to work as well, do:
192.168.33.10 whatever-i-want.local www.whatever-i-want.localTechnically you could also use a Vagrant Plugin like Vagrant Hostmanager to automatically update your host file when you run Vagrant Up. However, the purpose of Scotch Box is to have as little dependencies as possible so that it's always working when you run "vagrant up".
You may want to change some of the out-of-the-box configurations for
the various parts that come with Scotch Box. To do so, vagrant ssh
into the box, and edit the appropriate file. For example, to change
PHP settings:
vagrant ssh
sudo vim /etc/php5/apache2/conf.d/user.ini
Note that the changes that you make will be for the current running
Scotch Box only. If you vagrant destroy and then vagrant up your
box again, these manual configuration changes will be lost.
If you prefer to automate your configuration changes so that you can
destroy and re-create boxes as needed, Vagrant allows you to create a
"provision script" that runs as part of vagrant up. See the
Vagrant
documentation
for notes. For example, you could add the following line to your
Vagrantfile under the config.vm.hostname = "scotchbox" line:
config.vm.provision :shell, path: "bootstrap.sh"
and then create bootstrap.sh with the following content in the same
directory as the Vagrantfile:
#!/bin/bash
# Disable Zend OPcache
sed -i 's/;opcache.enable=0/opcache.enable=0/g' /etc/php5/apache2/php.ini
This script will be run each time you vagrant up, and it can be run
on an already-up box using vagrant provision.
sudo apt-get update
sudo add-apt-repository ppa:ondrej/php
sudo apt-get install php7.0
sudo apt-get update
sudo apt-get install php7.0-mysql libapache2-mod-php7.0
sudo a2dismod php5
sudo a2enmod php7.0
sudo apachectl restart
Copyright (c) 2014-2015 Nicholas Cerminara, scotch.io, LLC
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.