VirtualBox + Vagrant + Landrush; running Ubuntu 14.04 LTS w/ a full LAMP stack. Includes a tutorial!
- See full tutorial: http://jaswsinc.com/vagrant-ubuntu-lamp/
You need to have VirtualBox, Vagrant, and Landrush installed. See full tutorial.
$ brew cask install virtualbox
$ brew cask install vagrant
$ vagrant plugin install landrush
You need to install the ubuntu/trusty64
Box. See full tutorial.
$ vagrant box add ubuntu/trusty64
$ mkdir ~/Projects && cd ~/Projects
$ git clone --recurse-submodules https://github.com/jaswsinc/vagrant-ubuntu-lamp
Note: If you want a specific branch, be sure to checkout that specific branch. For instance, the wordpress
branch makes things much easier if you're running WordPress. The master
branch is a base with just a LAMP stack; i.e., no special considerations for any third-party software. You'll want to read: BRANCHES.md for more information.
$ cd ~/Projects/vagrant-ubuntu-lamp
git checkout wordpress
$ cd ~/Projects/vagrant-ubuntu-lamp
$ vagrant up # Boot-up the Box with LAMP ready-to-go!
- Open http://ubuntu-lamp.vm. You should see a
phpinfo()
page. - Open https://ubuntu-lamp.vm. You should get an SSL security warning. Please bypass this self-signed certificate warning and proceed. You should again see the
phpinfo()
page. SSL is working as expected!
Note: If you use something other than the master
branch in this repo, the default hostname will be different. It will include the branch name; e.g., http://ubuntu-lamp-wordpress.vm
if you are running the wordpress
branch.
The is the web root. Add your application files. e.g., WordPress, Drupal, Joomla, etc.
This LAMP stack comes preconfigured with a MySQL database and environment variables you can use in any PHP config. files.
$_SERVER['MYSQL_DB_HOST']
This is the database host name. Defaults tolocalhost
. Port is3306
(default port).$_SERVER['MYSQL_DB_NAME']
This is the database name. Defaults tovagrant
.$_SERVER['MYSQL_DB_USER']
This is the database username. Defaults tovagrant
.$_SERVER['MYSQL_DB_PASSWORD']
This is the database password. Defaults tovagrant
.
A username/password is required to access each of these tools. It is always the same thing.
- Username:
vagrant
Password:vagrant
Available Tools (Using Any of These is Optional):
- https://ubuntu-lamp.vm/tools/pma PhpMyAdmin
DB name:vagrant
, DB username:vagrant
, DB password:vagrant
- https://ubuntu-lamp.vm/tools/opcache PHP OPCache extension status and management page.
- https://ubuntu-lamp.vm/tools/php.php PHP info (i.e.,
phpinfo()
) page. - https://ubuntu-lamp.vm/tools/php5-fpm-status/ PHP5-FPM status page.
- https://ubuntu-lamp.vm/tools/apache-status/ Apache status page.
- https://ubuntu-lamp.vm/tools/apache-info/ Apache info page.
$ cd ~/Projects/vagrant-ubuntu-lamp
$ vagrant destroy # Tear it down and customize.
In the project directory you'll find bootstrap.bash
. At the top there are some configurable parameters that you can tune-in if you like. You may also want to tweak the Vagrantfile
for the project; e.g., to change the config.vm.hostname
or config.landrush.tld
. Enjoy!
$ vagrant up # Bring it back up after you are done customizing.
By default, the hostname will be: http://ubuntu-lamp.vm
. You can change this by editing config.vm.hostname
in Vagrantfile
.
Note: If you use something other than the master
branch in this repo, the default hostname will be different. It will include the branch name; e.g., http://ubuntu-lamp-wordpress.vm
if you are running the wordpress
branch.
However, you can avoid the extra step associated with the hostname altogether. Clone this repo into a directory that uses a .vm
suffix. A quick look at Vagrantfile
and you'll see that if your directory ends with .vm
I use the directory basename as the VM hostname. For instance, I could run through the following steps and end up with http://my.vm
and https://my.vm
automatically.
$ git clone --recurse-submodules https://github.com/jaswsinc/vagrant-ubuntu-lamp my.vm
$ cd my.vm && vagrant up # Now visit: `http://my.vm`