- Go to chefResources directory. This directory contains a Vagrantfile, which can launch a centos7 vagrant machine with Chefdk and other essential tools installed.
- Launch a new vagrant machine and login into it.
- Package resource
- Add nginx repo by installing epel-release.
- Install nginx using package resource
- Directory resource
- Create home directory for vhosts.
- File resource
- Create index files for nginx vhosts.
- Create blog.opstree.com.conf and chef.opstree.com.conf into the /etc/nginx/conf.d directory with files available for this.
- Make entry in /etc/hosts
- This is possible to make these entry with chef but it is a little complex for this time as we are not so proficient with chef. So we are doing this manually for now, but in our next article we will do this with chef.
- Service resource
- Restart your nginx server to make changes effective.