As I have received multiple requests now, I decided to make a little bonus for you 😉
It seems like a lot of you preferring MySQL over PostgreSQL. I don’t understand why, but that’s another topic 😉
Hurray! This is for now the last part of this tutorial series. Today we will install symfony. Or better said, we will install the symfony installer.
What would be a modern web application without a database? Ok, you could also build an API that just takes data modifies it and give it back to you. Or a static site generator or whatever. But in most cases, you will build apps with databases.
Oh man, this is hard, we are at part 4 and haven’t seen anything. This sucks. Let’s change it!
In this tutorial I will show you, how to install nginx and add virtual hosts, of course provisioned 😉
Today I created a virtual machine for mongoDB. It’s a long time since I worked last time with it. So I wanted a generic machine that I can start, stop or destroy without the need to reinstall it everytime by hand. Sounds like vagrant and ansible 😉
Get our hands dirty
As mentioned, I will use a Vagrant base image of Ubuntu 14.04 and provision it with ansible to install and configure mongoDB. Since I don’t like to use vagrant portmapping for all port that I may be using, I like to use the vagrant plugin ‘vagrant-hostsupdater’.
- Install vagrant from here.
For example on debian or ubuntu:
1sudo dpkg -i ~/Downloads/vagrant*.deb
- Install vagrants hostsupdater plugin:
1vagrant plugin install vagrant-hostsupdater
- Install git and ansible on your machine
1sudo apt-get install ansible git
- Clone my git repository and change to the directory:
1git clone email@example.com:hauckd/vagrant-ansible-mongodb.git && cd vagrant-ansible-mongodb
- Just run the vagrant machine
- That’s it!
After the startup and the provisioning of the vagrant machine finished you either can ssh into the vagrant machine to play with your mongodb instance
or connect directly to mongodb with
That’s the cool thing about the hostsupdater plugin, you can interact with the machine just like a real host, just give it a hostname in the Vagrantfile.
So after a couple of minutes you are up and running and can begin your journey with a great noSQL database management system.
Don’t forget to follow me on twitter or subscribe to the newsletter on the left site to recieve the latest posts. Of course you can give me a few stars on github 🙂