- Getting Started
- Building Your Vagrant VM
- Logging in to Your VM
- Running the Code
- Refactoring Your Code
A Vagrantfile
has been provided in order to make this code more convenient to
run. To get started via Vagrant
, you'll need:
- A working
Vagrant
environment with the VirtualBox provider - A
git checkout
of this repository - Your MaxMind Account ID and License Key
After you have checked out this repository, run this command from the root
directory. (Replace YOURACCOUNTID
with your MaxMind Account ID and replace
YOURLICENSEKEY
with your License Key first. Some Vagrant users may need to
suffix the command with --provider=virtualbox
.)
MM_ACCOUNT_ID=YOURACCOUNTID MM_LICENSE_KEY=YOURLICENSEKEY vagrant up
This will build your Vagrant VM.
To log in to your container, run this command:
vagrant ssh
Once you have logged in, you can run the server:
cd /vagrant
php -S 0:9595
Now you can visit http://localhost:9595 on your host machine and make GeoLite2 Web Service queries.
You can now freely edit the code outside of the Vagrant VM and re-run it from inside the VM.