LAMP box with mass vhost setup
This repository is currently set up for local development and it utilizes Vagrant with VirtualBox provider to emulate production environment on Windows, OSX and Linux (note that it has been tested just on Linux and OSX). If you have preinstalled Vagrant or VirtualBox, make sure you update to latest versions
You should read more on Vagrant if you're not familiar with it before you proceed.
Installed on the box:
- PHP 7.1
- Apache 2.4
- MariaDB 10.0
- MongoDB 2.6
- Redis 3.2
- Composer
- Install Vagrant and VirtualBox
- Clone this repository to your machine
- From project root, run
vagrant up
- Update your hosts file as described below
- Add your projects to
Sites
directory
Notes:
- Make sure your projects directory are lowercase because browsers will lowercase your domain, same goes for hosts file records.
- User
ubuntu
has passwordubuntu
- Xdebug is set on port
9000
Append the following to your hosts file in order to load 3 examples in your browser
192.168.33.10 example1.local
192.168.33.10 example2.pub
192.168.33.10 example3.public_html
This box utilizes Dynamically Configured Mass Virtual Hosting by Apache.
Current box setup recognizes hostname and based of TLD decides where's the project root.
Domain without TLD (in examples above that would be example1
, example2
and example3
) is the project directory name
and everything you want to be loaded for each of the domains must live in directory Sites/<PROJECT_DIRECTORY>/
.
When .local
is recognized, Sites/<PROJECT_DIRECTORY>/
is the recognized as project root, and everything else including
.pub
and .public_html
presumes that project root is a subdirectory of <PROJECT_ROOT>
named as TLD provided. Reference
to Sites/example2/
and Sites/example2/
to get the idea.
Remote access to database is possible using user root
with password toor
.