{"id":16445220,"url":"https://github.com/dgapitts/vagrant-chef-solo-intro","last_synced_at":"2025-06-22T04:06:31.396Z","repository":{"id":36494868,"uuid":"40800496","full_name":"dgapitts/vagrant-chef-solo-intro","owner":"dgapitts","description":"Getting started with Chef and Knife (Chef-Solo) ... build a simple apache2 webserver","archived":false,"fork":false,"pushed_at":"2015-09-20T14:14:48.000Z","size":148,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-26T08:32:56.683Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dgapitts.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-16T05:46:04.000Z","updated_at":"2015-08-16T15:12:39.000Z","dependencies_parsed_at":"2022-08-22T21:50:25.893Z","dependency_job_id":null,"html_url":"https://github.com/dgapitts/vagrant-chef-solo-intro","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dgapitts/vagrant-chef-solo-intro","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgapitts%2Fvagrant-chef-solo-intro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgapitts%2Fvagrant-chef-solo-intro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgapitts%2Fvagrant-chef-solo-intro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgapitts%2Fvagrant-chef-solo-intro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dgapitts","download_url":"https://codeload.github.com/dgapitts/vagrant-chef-solo-intro/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgapitts%2Fvagrant-chef-solo-intro/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261233245,"owners_count":23128199,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T09:43:41.572Z","updated_at":"2025-06-22T04:06:26.350Z","avatar_url":"https://github.com/dgapitts.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Getting started with Chef-Solo: deploying a simple apache2 webserver\n\nI have been struggling a little bit with 'Ruby/Gem Version Hell' on my laptop (MacOSX) and prefer working with Vagrant and Linux as \n\n  - This can be easily rebuilt in a 100% consistent maner (see blog post/link below for details)\n  - No one is running MacOSX in their production datacenters, it is 100% Linux ... I love MaxOSX but for really work I am a Linux fan boy ...\n\nSo working through the following good article to get started with Chef and Knife: http://gettingstartedwithchef.com/first-steps-with-chef.html\n\nI ended up running using a trusty64 (14.04) Ubuntu box image. I also broke the setup process into a scripts/steps which where to be run as root:\n\n```sh\n# startup and ssh to vagrant box:\nvagrant up\nvagrant ssh\n\n# switch to root and work from cross-mounted vagrant directory (easier to inspect):\nsudo -i\ncd /vagrant\n```\nNote: I'm only running at root, as this is how the 'getting started with chef' tutorial was written. Some refactoring for better security could be done here...\n\nNow the rest of the process is scripted\n\n```sh\n./step01_setup_chef-master-repo_under_slash_vagrant.sh\n./step02_download_first_knife_cookbook.sh\n./step03_configure_phpapp_cookbook.sh\nchef-solo -c solo.rb -j web.json\n```\n\nPlease inspect these scripts (i.e. in this git repo) for further details..\n\nThis approach is a good sansity check for check new Linux images and working through Ruby/Gem Version issues... here is a short blog post about some of the issues I had:\n\nhttp://dba-amsterdam.blogspot.nl/2015/08/learning-chef-and-ruby-version-pain.html\n\nOnce you have this working, you should be able to mark a simple test call to Apache2 webserver:\n\n```sh\nroot@knife1:/vagrant# curl http://localhost/index.htm\n\n\u003c!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\"\u003e\n\u003chtml\u003e\u003chead\u003e\n\u003ctitle\u003e403 Forbidden\u003c/title\u003e\n\u003c/head\u003e\u003cbody\u003e\n\u003ch1\u003eForbidden\u003c/h1\u003e\n\u003cp\u003eYou don't have permission to access /index.htm\non this server.\u003c/p\u003e\n\u003chr\u003e\n\u003caddress\u003eApache Server at localhost Port 80\u003c/address\u003e\n\u003c/body\u003e\u003c/html\u003e\n```\n\nOK ... displaying 'Hello Chef-Solo World' was my initial aim, but the key point is that Apache2 is up, running and complaining about suspect URL calls!\n\nLastly, as I was working under the cross-mounted /vagrant directory, as this easier to inspect (and edit) e.g. via my personal favorite editor: sublime text. However this makes the rebuild process slightly more complicated i.e. to completely rebuild the environment I needed to\n  - destroy old box image\n  - cleanup left over chef and knife (i.e. chef-solo) files under /vagrant\n  - restart vagrant and ssh to nex box\n\nSo I scripted this:\n\n```sh\n~/projects/vagrant-chef-solo-intro $ cat rebuild.sh\nvagrant destroy\nrm -rf chef-repo\nrm -rf chef-solo\nvagrant up\nvagrant ssh\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgapitts%2Fvagrant-chef-solo-intro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdgapitts%2Fvagrant-chef-solo-intro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgapitts%2Fvagrant-chef-solo-intro/lists"}