<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Psinaik</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Psinaik"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Psinaik"/>
	<updated>2026-08-22T23:31:26Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100611</id>
		<title>CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100611"/>
		<updated>2015-12-16T19:54:06Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: /* Future Scope */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction to Expertiza==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is a web application to create reusable learning objects through peer review. It supports various features such as team projects and the submission of various documents including URLs and wiki pages. It is being used extensively across various universities for select courses.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Currently, setting up the infrastructure for expertiza is done manually. The task is to write a Chef-solo&amp;lt;ref&amp;gt;[https://docs.chef.io/chef_solo.html Chef Solo]&amp;lt;/ref&amp;gt; recipe which will create a production ready environment for expertiza. Chef-solo recipes are Ruby&amp;lt;ref&amp;gt;[https://www.ruby-lang.org/en/ Ruby]&amp;lt;/ref&amp;gt; code.&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
&lt;br /&gt;
We need to provide a single step setup of expertiza for production.&lt;br /&gt;
&lt;br /&gt;
*It should include setting up the basic environment, application dependency, configuration setup and database setup.&lt;br /&gt;
*It should also include recipe for regular deployment.&lt;br /&gt;
&lt;br /&gt;
==Terminology==&lt;br /&gt;
===Chef Solo&amp;lt;ref&amp;gt;https://docs.chef.io/chef_solo.html&amp;lt;/ref&amp;gt;=== &lt;br /&gt;
Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each organization is comprised of one(or more) workstations, a single server, and every node that will be configured and maintained by the chef-client. Cookbooks (and recipes) are used to tell the chef-client how each node in your organization should be configured. The chef-client(which is installed on every node) does the actual configuration.&lt;br /&gt;
&lt;br /&gt;
*'''Node:'''&lt;br /&gt;
:A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.&lt;br /&gt;
&lt;br /&gt;
*'''Recipe: ''' &lt;br /&gt;
:A recipe specifies the resources to use and the order in which they are to be applied. It is mostly a collection of resources, defined using patterns(resource names, attribute-value pairs, and actions). A recipe       must define everything that is required to configure part of a system.&lt;br /&gt;
&lt;br /&gt;
*'''Cookbook:''' &lt;br /&gt;
:A cookbook is the fundamental unit of configuration and policy distribution. A cookbook defines a scenario and contains everything that is required to support that scenario.&lt;br /&gt;
&lt;br /&gt;
*'''WorkStation:'''&lt;br /&gt;
:A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery. &lt;br /&gt;
:The workstation is the location from which most users do most of their work.&lt;br /&gt;
:One(or more) workstations are configured to allow users to author, test, and maintain cookbooks. Cookbooks are uploaded to the Chef server from the workstation.&lt;br /&gt;
&lt;br /&gt;
*'''Chef Server:'''&lt;br /&gt;
:The Chef server acts as a hub of information. Cookbooks and policy settings are uploaded to the Chef server by users from workstations.&lt;br /&gt;
&lt;br /&gt;
*'''Chef-client:'''&lt;br /&gt;
:The chef-client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL for specific resources&lt;br /&gt;
&lt;br /&gt;
===Nginx===&lt;br /&gt;
&lt;br /&gt;
Nginx is a free, open-source, high-performance [HTTP] server and reverse proxy&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/glossary/reverse-proxy-server/]&amp;lt;/ref&amp;gt;, as well as an IMAP&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol&amp;lt;/ref&amp;gt;/POP3&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Post_Office_Protocol&amp;lt;/ref&amp;gt; proxy server. Nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/wiki/ Nginx Sever]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unicorn===&lt;br /&gt;
&lt;br /&gt;
Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.  Slow clients should only be served by placing a reverse proxy capable of fully buffering both the the request and response in between unicorn and slow clients.&lt;br /&gt;
&amp;lt;ref&amp;gt;[https://github.com/defunkt/unicorn Unicorn Web Server]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Plan of Action==&lt;br /&gt;
===Steps to Implement the Automated Deployment Process===&lt;br /&gt;
&lt;br /&gt;
[[File:Img01ExpInfra.png | frame|none|Expertiza Virtual Infrastructure]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Set up a virtual Vanilla&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Vanilla_software Vanilla]&amp;lt;/ref&amp;gt; Ubuntu&amp;lt;ref&amp;gt;[http://www.ubuntu.com Ubuntu]&amp;lt;/ref&amp;gt; Machine.&lt;br /&gt;
&lt;br /&gt;
2. Update the Ubuntu to the specified version.&lt;br /&gt;
&lt;br /&gt;
3. Clone Expertiza from Github.&lt;br /&gt;
&lt;br /&gt;
4. Install packages for Java, Ruby and all the ruby dependencies.&lt;br /&gt;
&lt;br /&gt;
5. Bundle install for installing all the gems in Gemfile.&lt;br /&gt;
&lt;br /&gt;
6. Install MYSQL&amp;lt;ref&amp;gt;[https://mysql.com Mysql server]&amp;lt;/ref&amp;gt;, configure it and migrate databases.&lt;br /&gt;
&lt;br /&gt;
7. Install Unicorn gem. Unicorn is a Rack&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Rack_%28web_server_interface%29 Rack Server]&amp;lt;/ref&amp;gt; HTTP server that uses forked processes to handle multiple incoming requests concurrently. For expertiza, unicorn is being used as the web server, which will interact with the database servers to fetch the data.&lt;br /&gt;
&lt;br /&gt;
8. Make changes in the nginx configuration.&lt;br /&gt;
&lt;br /&gt;
9. Install nginx. Nginx is a web server. It is being used in the Expertiza architecture as a reverse proxy server. Through nginx, we will also attempt to serve static pages directly.&lt;br /&gt;
&lt;br /&gt;
10. Configure Unicorn and integrate it to work with nginx.&lt;br /&gt;
&lt;br /&gt;
11. Start both Unicorn and Nginx server.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Stack==&lt;br /&gt;
&lt;br /&gt;
[[File:Exp1.png]]&lt;br /&gt;
&lt;br /&gt;
The above visually describes the expertiza stack on the virtual machine. The stack includes nginx as the front end, web server which will redirect the requests to the unicorn server. The scope of the project includes just 1 unicorn server but the recipe will be written in a way that later modifications can be made to add more than one unicorn servers under a load balancer. The unicorn server will interact with the database server and write/fetch data into it.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Deployment==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. We first created a droplet( virtual private server) using digital ocean&amp;lt;ref&amp;gt;https://www.digitalocean.com/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Drop.png]]&lt;br /&gt;
&lt;br /&gt;
2. We recorded the IP address of the newly created droplet and created the associated &amp;lt;ipaddress&amp;gt;.json file.&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;ipaddress&amp;gt;.json''' : This file holds all the node specific values required to install services and config node.&lt;br /&gt;
We will set node_user , user_hash_password , ruby version , mysql root &amp;amp; password . The main function apart from holding node variables is to run recipes in a specific code.&lt;br /&gt;
&lt;br /&gt;
[[File:New_ip.png]]&lt;br /&gt;
&lt;br /&gt;
The following recipes(.rb files), scripts and node specific files were created to achieve automatic deployment. Other pre-installed files and folder for Chef cookbook can be found in the git repository mentioned above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. We then run the bash command in following format&amp;lt;code&amp;gt;sh setup_vps.sh &amp;lt;node_username&amp;gt; &amp;lt;node_ip_address&amp;gt; &amp;lt;node_port&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command will run the knife tool that will set up Chef-solo on the node and will execute the recipes.&lt;br /&gt;
This needs to be run from the directory where '''setup_vps.sh''' is present.&lt;br /&gt;
&lt;br /&gt;
[[File:New setup vps.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. '''default.rb''' : This recipe will update the Ubuntu machine packages, install the list of prerequisite packages and set the time zone.&lt;br /&gt;
&lt;br /&gt;
[[File:New default.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. '''expertiza_clone''' : This recipe will create a directory and clone the Expertiza git source code into that directory.&lt;br /&gt;
&lt;br /&gt;
[[File:New expertiza clone.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. '''set_java_home''': This recipe will set the Java configuration. It will then bundle install all the gems used by the Expertiza.&lt;br /&gt;
&lt;br /&gt;
[[File:New_set_java.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. '''mysql.rb''' : This recipe will install the MySQL server , MySQL client and its associated dependencies. The root password is preloaded and then fetched on installation by setting DEBIAN_FRONTEND environment variable.&lt;br /&gt;
&lt;br /&gt;
[[File:New sql.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. '''database.rb''' : This recipe will execute scrubbed.sql on MySQL, which in turn will create all the Schema for production, development and test environments. It will also populate the database tables with seed (configuration) data.&lt;br /&gt;
&lt;br /&gt;
[[File:New database.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. '''nginx.rb''' : This recipe will install nginx which is a web proxy server that will listen on user defined port and redirect the requests for static content(images, css, javascript) to the public folder of the Expertiza rails app.&lt;br /&gt;
&lt;br /&gt;
[[File:New_nginx.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. '''unicorn_conf.rb''' : This recipe will install and configure Unicorn web server used in production environment to handle requests for dynamic content passed on by the Nginx server.&lt;br /&gt;
&lt;br /&gt;
[[File:New_unicorn_corn.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
11. '''start_server.rb''' : This will restart all the installed services, after which Expertiza can start taking requests.&lt;br /&gt;
&lt;br /&gt;
[[File:New start server1.png]]&lt;br /&gt;
&lt;br /&gt;
==Github link==&lt;br /&gt;
https://github.com/amurark/knife-solo/&lt;br /&gt;
&lt;br /&gt;
==Points for the reviewer==&lt;br /&gt;
&lt;br /&gt;
While reviewing this project, please consider the following points:&lt;br /&gt;
&lt;br /&gt;
*1. There is no scope for testing in our project. This has been discussed and approved by the mentor. &lt;br /&gt;
*2. There is no scope for UML diagrams for this project, as there are no classes/interface involved.&lt;br /&gt;
&lt;br /&gt;
==Future Scope==&lt;br /&gt;
&lt;br /&gt;
The cookbook has been created with the assumption of root user as the administer.For security purposes deployment should be done with another user with sudo privileges, and then root login disabled. Also a new user for MySQL with full database privileges needs to be created. But that hasn't been achieved automatically in the resent cookbook. Further, Unicorn configuration is done with a single Unicorn server in mind. It has to be configured for multiple servers for load balancing in events of heavy traffic.&lt;br /&gt;
Currently, we are manually creating the digitalOcean droplet which is the remote server where expertiza is deployed. In future, this can be automated using a plugin provided by vagrant for digital ocean.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100610</id>
		<title>CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100610"/>
		<updated>2015-12-16T19:48:13Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: /* Github link */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction to Expertiza==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is a web application to create reusable learning objects through peer review. It supports various features such as team projects and the submission of various documents including URLs and wiki pages. It is being used extensively across various universities for select courses.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Currently, setting up the infrastructure for expertiza is done manually. The task is to write a Chef-solo&amp;lt;ref&amp;gt;[https://docs.chef.io/chef_solo.html Chef Solo]&amp;lt;/ref&amp;gt; recipe which will create a production ready environment for expertiza. Chef-solo recipes are Ruby&amp;lt;ref&amp;gt;[https://www.ruby-lang.org/en/ Ruby]&amp;lt;/ref&amp;gt; code.&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
&lt;br /&gt;
We need to provide a single step setup of expertiza for production.&lt;br /&gt;
&lt;br /&gt;
*It should include setting up the basic environment, application dependency, configuration setup and database setup.&lt;br /&gt;
*It should also include recipe for regular deployment.&lt;br /&gt;
&lt;br /&gt;
==Terminology==&lt;br /&gt;
===Chef Solo&amp;lt;ref&amp;gt;https://docs.chef.io/chef_solo.html&amp;lt;/ref&amp;gt;=== &lt;br /&gt;
Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each organization is comprised of one(or more) workstations, a single server, and every node that will be configured and maintained by the chef-client. Cookbooks (and recipes) are used to tell the chef-client how each node in your organization should be configured. The chef-client(which is installed on every node) does the actual configuration.&lt;br /&gt;
&lt;br /&gt;
*'''Node:'''&lt;br /&gt;
:A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.&lt;br /&gt;
&lt;br /&gt;
*'''Recipe: ''' &lt;br /&gt;
:A recipe specifies the resources to use and the order in which they are to be applied. It is mostly a collection of resources, defined using patterns(resource names, attribute-value pairs, and actions). A recipe       must define everything that is required to configure part of a system.&lt;br /&gt;
&lt;br /&gt;
*'''Cookbook:''' &lt;br /&gt;
:A cookbook is the fundamental unit of configuration and policy distribution. A cookbook defines a scenario and contains everything that is required to support that scenario.&lt;br /&gt;
&lt;br /&gt;
*'''WorkStation:'''&lt;br /&gt;
:A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery. &lt;br /&gt;
:The workstation is the location from which most users do most of their work.&lt;br /&gt;
:One(or more) workstations are configured to allow users to author, test, and maintain cookbooks. Cookbooks are uploaded to the Chef server from the workstation.&lt;br /&gt;
&lt;br /&gt;
*'''Chef Server:'''&lt;br /&gt;
:The Chef server acts as a hub of information. Cookbooks and policy settings are uploaded to the Chef server by users from workstations.&lt;br /&gt;
&lt;br /&gt;
*'''Chef-client:'''&lt;br /&gt;
:The chef-client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL for specific resources&lt;br /&gt;
&lt;br /&gt;
===Nginx===&lt;br /&gt;
&lt;br /&gt;
Nginx is a free, open-source, high-performance [HTTP] server and reverse proxy&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/glossary/reverse-proxy-server/]&amp;lt;/ref&amp;gt;, as well as an IMAP&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol&amp;lt;/ref&amp;gt;/POP3&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Post_Office_Protocol&amp;lt;/ref&amp;gt; proxy server. Nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/wiki/ Nginx Sever]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unicorn===&lt;br /&gt;
&lt;br /&gt;
Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.  Slow clients should only be served by placing a reverse proxy capable of fully buffering both the the request and response in between unicorn and slow clients.&lt;br /&gt;
&amp;lt;ref&amp;gt;[https://github.com/defunkt/unicorn Unicorn Web Server]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Plan of Action==&lt;br /&gt;
===Steps to Implement the Automated Deployment Process===&lt;br /&gt;
&lt;br /&gt;
[[File:Img01ExpInfra.png | frame|none|Expertiza Virtual Infrastructure]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Set up a virtual Vanilla&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Vanilla_software Vanilla]&amp;lt;/ref&amp;gt; Ubuntu&amp;lt;ref&amp;gt;[http://www.ubuntu.com Ubuntu]&amp;lt;/ref&amp;gt; Machine.&lt;br /&gt;
&lt;br /&gt;
2. Update the Ubuntu to the specified version.&lt;br /&gt;
&lt;br /&gt;
3. Clone Expertiza from Github.&lt;br /&gt;
&lt;br /&gt;
4. Install packages for Java, Ruby and all the ruby dependencies.&lt;br /&gt;
&lt;br /&gt;
5. Bundle install for installing all the gems in Gemfile.&lt;br /&gt;
&lt;br /&gt;
6. Install MYSQL&amp;lt;ref&amp;gt;[https://mysql.com Mysql server]&amp;lt;/ref&amp;gt;, configure it and migrate databases.&lt;br /&gt;
&lt;br /&gt;
7. Install Unicorn gem. Unicorn is a Rack&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Rack_%28web_server_interface%29 Rack Server]&amp;lt;/ref&amp;gt; HTTP server that uses forked processes to handle multiple incoming requests concurrently. For expertiza, unicorn is being used as the web server, which will interact with the database servers to fetch the data.&lt;br /&gt;
&lt;br /&gt;
8. Make changes in the nginx configuration.&lt;br /&gt;
&lt;br /&gt;
9. Install nginx. Nginx is a web server. It is being used in the Expertiza architecture as a reverse proxy server. Through nginx, we will also attempt to serve static pages directly.&lt;br /&gt;
&lt;br /&gt;
10. Configure Unicorn and integrate it to work with nginx.&lt;br /&gt;
&lt;br /&gt;
11. Start both Unicorn and Nginx server.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Stack==&lt;br /&gt;
&lt;br /&gt;
[[File:Exp1.png]]&lt;br /&gt;
&lt;br /&gt;
The above visually describes the expertiza stack on the virtual machine. The stack includes nginx as the front end, web server which will redirect the requests to the unicorn server. The scope of the project includes just 1 unicorn server but the recipe will be written in a way that later modifications can be made to add more than one unicorn servers under a load balancer. The unicorn server will interact with the database server and write/fetch data into it.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Deployment==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. We first created a droplet( virtual private server) using digital ocean&amp;lt;ref&amp;gt;https://www.digitalocean.com/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Drop.png]]&lt;br /&gt;
&lt;br /&gt;
2. We recorded the IP address of the newly created droplet and created the associated &amp;lt;ipaddress&amp;gt;.json file.&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;ipaddress&amp;gt;.json''' : This file holds all the node specific values required to install services and config node.&lt;br /&gt;
We will set node_user , user_hash_password , ruby version , mysql root &amp;amp; password . The main function apart from holding node variables is to run recipes in a specific code.&lt;br /&gt;
&lt;br /&gt;
[[File:New_ip.png]]&lt;br /&gt;
&lt;br /&gt;
The following recipes(.rb files), scripts and node specific files were created to achieve automatic deployment. Other pre-installed files and folder for Chef cookbook can be found in the git repository mentioned above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. We then run the bash command in following format&amp;lt;code&amp;gt;sh setup_vps.sh &amp;lt;node_username&amp;gt; &amp;lt;node_ip_address&amp;gt; &amp;lt;node_port&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command will run the knife tool that will set up Chef-solo on the node and will execute the recipes.&lt;br /&gt;
This needs to be run from the directory where '''setup_vps.sh''' is present.&lt;br /&gt;
&lt;br /&gt;
[[File:New setup vps.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. '''default.rb''' : This recipe will update the Ubuntu machine packages, install the list of prerequisite packages and set the time zone.&lt;br /&gt;
&lt;br /&gt;
[[File:New default.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. '''expertiza_clone''' : This recipe will create a directory and clone the Expertiza git source code into that directory.&lt;br /&gt;
&lt;br /&gt;
[[File:New expertiza clone.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. '''set_java_home''': This recipe will set the Java configuration. It will then bundle install all the gems used by the Expertiza.&lt;br /&gt;
&lt;br /&gt;
[[File:New_set_java.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. '''mysql.rb''' : This recipe will install the MySQL server , MySQL client and its associated dependencies. The root password is preloaded and then fetched on installation by setting DEBIAN_FRONTEND environment variable.&lt;br /&gt;
&lt;br /&gt;
[[File:New sql.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. '''database.rb''' : This recipe will execute scrubbed.sql on MySQL, which in turn will create all the Schema for production, development and test environments. It will also populate the database tables with seed (configuration) data.&lt;br /&gt;
&lt;br /&gt;
[[File:New database.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. '''nginx.rb''' : This recipe will install nginx which is a web proxy server that will listen on user defined port and redirect the requests for static content(images, css, javascript) to the public folder of the Expertiza rails app.&lt;br /&gt;
&lt;br /&gt;
[[File:New_nginx.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. '''unicorn_conf.rb''' : This recipe will install and configure Unicorn web server used in production environment to handle requests for dynamic content passed on by the Nginx server.&lt;br /&gt;
&lt;br /&gt;
[[File:New_unicorn_corn.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
11. '''start_server.rb''' : This will restart all the installed services, after which Expertiza can start taking requests.&lt;br /&gt;
&lt;br /&gt;
[[File:New start server1.png]]&lt;br /&gt;
&lt;br /&gt;
==Github link==&lt;br /&gt;
https://github.com/amurark/knife-solo/&lt;br /&gt;
&lt;br /&gt;
==Points for the reviewer==&lt;br /&gt;
&lt;br /&gt;
While reviewing this project, please consider the following points:&lt;br /&gt;
&lt;br /&gt;
*1. There is no scope for testing in our project. This has been discussed and approved by the mentor. &lt;br /&gt;
*2. There is no scope for UML diagrams for this project, as there are no classes/interface involved.&lt;br /&gt;
&lt;br /&gt;
==Future Scope==&lt;br /&gt;
&lt;br /&gt;
The cookbook has been created with the assumption of root user as the administer.For security purposes deployment should be done with another user with sudo privileges, and then root login disabled. Also a new user for MySQL with full database privileges needs to be created. But that hasn't been achieved automatically in the resent cookbook. Further, Unicorn configuration is done with a single Unicorn server in mind. It has to be configured for multiple servers for load balancing in events of heavy traffic. &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100607</id>
		<title>CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100607"/>
		<updated>2015-12-16T18:33:00Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: /* Sample Chef-Solo Recipe Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction to Expertiza==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is a web application to create reusable learning objects through peer review. It supports various features such as team projects and the submission of various documents including URLs and wiki pages. It is being used extensively across various universities for select courses.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Currently, setting up the infrastructure for expertiza is done manually. The task is to write a Chef-solo&amp;lt;ref&amp;gt;[https://docs.chef.io/chef_solo.html Chef Solo]&amp;lt;/ref&amp;gt; recipe which will create a production ready environment for expertiza. Chef-solo recipes are Ruby&amp;lt;ref&amp;gt;[https://www.ruby-lang.org/en/ Ruby]&amp;lt;/ref&amp;gt; code.&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
&lt;br /&gt;
We need to provide a single step setup of expertiza for production.&lt;br /&gt;
&lt;br /&gt;
*It should include setting up the basic environment, application dependency, configuration setup and database setup.&lt;br /&gt;
*It should also include recipe for regular deployment.&lt;br /&gt;
&lt;br /&gt;
==Terminology==&lt;br /&gt;
===Chef Solo&amp;lt;ref&amp;gt;https://docs.chef.io/chef_solo.html&amp;lt;/ref&amp;gt;=== &lt;br /&gt;
Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each organization is comprised of one(or more) workstations, a single server, and every node that will be configured and maintained by the chef-client. Cookbooks (and recipes) are used to tell the chef-client how each node in your organization should be configured. The chef-client(which is installed on every node) does the actual configuration.&lt;br /&gt;
&lt;br /&gt;
*'''Node:'''&lt;br /&gt;
:A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.&lt;br /&gt;
&lt;br /&gt;
*'''Recipe: ''' &lt;br /&gt;
:A recipe specifies the resources to use and the order in which they are to be applied. It is mostly a collection of resources, defined using patterns(resource names, attribute-value pairs, and actions). A recipe       must define everything that is required to configure part of a system.&lt;br /&gt;
&lt;br /&gt;
*'''Cookbook:''' &lt;br /&gt;
:A cookbook is the fundamental unit of configuration and policy distribution. A cookbook defines a scenario and contains everything that is required to support that scenario.&lt;br /&gt;
&lt;br /&gt;
*'''WorkStation:'''&lt;br /&gt;
:A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery. &lt;br /&gt;
:The workstation is the location from which most users do most of their work.&lt;br /&gt;
:One(or more) workstations are configured to allow users to author, test, and maintain cookbooks. Cookbooks are uploaded to the Chef server from the workstation.&lt;br /&gt;
&lt;br /&gt;
*'''Chef Server:'''&lt;br /&gt;
:The Chef server acts as a hub of information. Cookbooks and policy settings are uploaded to the Chef server by users from workstations.&lt;br /&gt;
&lt;br /&gt;
*'''Chef-client:'''&lt;br /&gt;
:The chef-client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL for specific resources&lt;br /&gt;
&lt;br /&gt;
===Nginx===&lt;br /&gt;
&lt;br /&gt;
Nginx is a free, open-source, high-performance [HTTP] server and reverse proxy&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/glossary/reverse-proxy-server/]&amp;lt;/ref&amp;gt;, as well as an IMAP&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol&amp;lt;/ref&amp;gt;/POP3&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Post_Office_Protocol&amp;lt;/ref&amp;gt; proxy server. Nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/wiki/ Nginx Sever]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unicorn===&lt;br /&gt;
&lt;br /&gt;
Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.  Slow clients should only be served by placing a reverse proxy capable of fully buffering both the the request and response in between unicorn and slow clients.&lt;br /&gt;
&amp;lt;ref&amp;gt;[https://github.com/defunkt/unicorn Unicorn Web Server]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Plan of Action==&lt;br /&gt;
===Steps to Implement the Automated Deployment Process===&lt;br /&gt;
&lt;br /&gt;
[[File:Img01ExpInfra.png | frame|none|Expertiza Virtual Infrastructure]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Setup a virtual Vanilla&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Vanilla_software Vanilla]&amp;lt;/ref&amp;gt; Ubuntu&amp;lt;ref&amp;gt;[http://www.ubuntu.com Ubuntu]&amp;lt;/ref&amp;gt; Machine.&lt;br /&gt;
&lt;br /&gt;
2. Update the Ubuntu to the specified version.&lt;br /&gt;
&lt;br /&gt;
3. Clone Expertiza from Github.&lt;br /&gt;
&lt;br /&gt;
4. Install packages for Java, Ruby and all the ruby dependencies.&lt;br /&gt;
&lt;br /&gt;
5. Bundle install for installing all the gems in Gemfile.&lt;br /&gt;
&lt;br /&gt;
6. Install MYSQL&amp;lt;ref&amp;gt;[https://mysql.com Mysql server]&amp;lt;/ref&amp;gt;, configure it and migrate databases.&lt;br /&gt;
&lt;br /&gt;
7. Install Unicorn gem. Unicorn is a Rack&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Rack_%28web_server_interface%29 Rack Server]&amp;lt;/ref&amp;gt; HTTP server that uses forked processes to handle multiple incoming requests concurrently. For expertiza, unicorn is being used as the web server, which will interact with the database servers to fetch the data.&lt;br /&gt;
&lt;br /&gt;
8. Make changes in the nginx configuration.&lt;br /&gt;
&lt;br /&gt;
9. Install nginx. Nginx is a web server. It is being used in the Expertiza architecture as a reverse proxy server. Through nginx, we will also attempt to serve static pages directly.&lt;br /&gt;
&lt;br /&gt;
10. Configure Unicorn and integrate it to work with nginx.&lt;br /&gt;
&lt;br /&gt;
11. Start both Unicorn and Nginx server.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Stack==&lt;br /&gt;
&lt;br /&gt;
[[File:Exp1.png]]&lt;br /&gt;
&lt;br /&gt;
The above visually describes the expertiza stack on the virtual machine. The stack includes nginx as the front end, web server which will redirect the requests to the unicorn server. The scope of the project includes just 1 unicorn server but the recipe will be written in a way that later modifications can be made to add more than one unicorn servers under a load balancer. The unicorn server will interact with the database server and write/fetch data into it.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Deployment==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. We first created a droplet( virtual private server) using digital ocean&amp;lt;ref&amp;gt;https://www.digitalocean.com/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Drop.png]]&lt;br /&gt;
&lt;br /&gt;
2. We recorded the IP address of the newly created droplet and created the associated &amp;lt;ipaddress&amp;gt;.json file.&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;ipaddress&amp;gt;.json''' : This file holds all the node specific values required to install services and config node.&lt;br /&gt;
We will set node_user , user_hash_password , ruby version , mysql root &amp;amp; password . The main function apart from holding node variables is to run recipes in a specific code.&lt;br /&gt;
&lt;br /&gt;
[[File:New_ip.png]]&lt;br /&gt;
&lt;br /&gt;
The following recipes(.rb files), scripts and node specific files were created to achieve automatic deployment. Other pre-installed files and folder for Chef cookbook can be found in the git repository mentioned above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. We then run the bash command in following format&amp;lt;code&amp;gt;sh setup_vps.sh &amp;lt;node_username&amp;gt; &amp;lt;node_ip_address&amp;gt; &amp;lt;node_port&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command will run the knife tool that will setup Chef-solo on the node and will execute the recipes.&lt;br /&gt;
This needs to be run from the directory where '''setup_vps.sh''' is present.&lt;br /&gt;
&lt;br /&gt;
[[File:New setup vps.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. '''default.rb''' : This recipe will update the Ubuntu machine packages, install the list of prerequisite packages and set the time zone.&lt;br /&gt;
&lt;br /&gt;
[[File:New default.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. '''expertiza_clone''' : This recipe will create a directory and clone the Expertiza git source code into that directory.&lt;br /&gt;
&lt;br /&gt;
[[File:New expertiza clone.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. '''set_java_home''': This recipe will set the Java configuration. It will then bundle install all the gems used by the Expertiza.&lt;br /&gt;
&lt;br /&gt;
[[File:New_set_java.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. '''mysql.rb''' : This recipe will install the MySQL server , MySQL client and its associated dependencies. The root password is preloaded and then fetched on installation by setting DEBIAN_FRONTEND environment variable.&lt;br /&gt;
&lt;br /&gt;
[[File:New sql.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. '''database.rb''' : This recipe will execute scrubbed.sql on MySQL, which in turn will create all the Schema for production, development and test environments. It will also populate the database tables with seed (configuration) data.&lt;br /&gt;
&lt;br /&gt;
[[File:New database.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. '''nginx.rb''' : This recipe will install nginx which is a web proxy server that will listen on user defined port and redirect the requests for static content(images, css, javascript) to the public folder of the Expertiza rails app.&lt;br /&gt;
&lt;br /&gt;
[[File:New_nginx.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. '''unicorn_conf.rb''' : This recipe will install and configure Unicorn web server used in production environment to handle requests for dynamic content passed on by the Nginx server.&lt;br /&gt;
&lt;br /&gt;
[[File:New_unicorn_corn.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
11. '''start_server.rb''' : This will restart all the installed services, after which Expertiza can start taking requests.&lt;br /&gt;
&lt;br /&gt;
[[File:New start server1.png]]&lt;br /&gt;
&lt;br /&gt;
==Github link==&lt;br /&gt;
https://github.com/amurark/expertiza&lt;br /&gt;
&lt;br /&gt;
==Points for the reviewer==&lt;br /&gt;
&lt;br /&gt;
While reviewing this project, please consider the following points:&lt;br /&gt;
&lt;br /&gt;
*1. There is no scope for testing in our project. This has been discussed and approved by the mentor. &lt;br /&gt;
*2. There is no scope for UML diagrams for this project, as there are no classes/interface involved.&lt;br /&gt;
&lt;br /&gt;
==Future Scope==&lt;br /&gt;
&lt;br /&gt;
The cookbook has been created with the assumption of root user as the administer.For security purposes deployment should be done with another user with sudo privileges, and then root login disabled. Also a new user for MySQL with full database privileges needs to be created. But that hasn't been achieved automatically in the resent cookbook. Further, Unicorn configuration is done with a single Unicorn server in mind. It has to be configured for multiple servers for load balancing in events of heavy traffic. &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100606</id>
		<title>CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100606"/>
		<updated>2015-12-16T18:32:01Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: /* Sample Chef-Solo Recipe Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction to Expertiza==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is a web application to create reusable learning objects through peer review. It supports various features such as team projects and the submission of various documents including URLs and wiki pages. It is being used extensively across various universities for select courses.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Currently, setting up the infrastructure for expertiza is done manually. The task is to write a Chef-solo&amp;lt;ref&amp;gt;[https://docs.chef.io/chef_solo.html Chef Solo]&amp;lt;/ref&amp;gt; recipe which will create a production ready environment for expertiza. Chef-solo recipes are Ruby&amp;lt;ref&amp;gt;[https://www.ruby-lang.org/en/ Ruby]&amp;lt;/ref&amp;gt; code.&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
&lt;br /&gt;
We need to provide a single step setup of expertiza for production.&lt;br /&gt;
&lt;br /&gt;
*It should include setting up the basic environment, application dependency, configuration setup and database setup.&lt;br /&gt;
*It should also include recipe for regular deployment.&lt;br /&gt;
&lt;br /&gt;
==Terminology==&lt;br /&gt;
===Chef Solo&amp;lt;ref&amp;gt;https://docs.chef.io/chef_solo.html&amp;lt;/ref&amp;gt;=== &lt;br /&gt;
Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each organization is comprised of one(or more) workstations, a single server, and every node that will be configured and maintained by the chef-client. Cookbooks (and recipes) are used to tell the chef-client how each node in your organization should be configured. The chef-client(which is installed on every node) does the actual configuration.&lt;br /&gt;
&lt;br /&gt;
*'''Node:'''&lt;br /&gt;
:A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.&lt;br /&gt;
&lt;br /&gt;
*'''Recipe: ''' &lt;br /&gt;
:A recipe specifies the resources to use and the order in which they are to be applied. It is mostly a collection of resources, defined using patterns(resource names, attribute-value pairs, and actions). A recipe       must define everything that is required to configure part of a system.&lt;br /&gt;
&lt;br /&gt;
*'''Cookbook:''' &lt;br /&gt;
:A cookbook is the fundamental unit of configuration and policy distribution. A cookbook defines a scenario and contains everything that is required to support that scenario.&lt;br /&gt;
&lt;br /&gt;
*'''WorkStation:'''&lt;br /&gt;
:A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery. &lt;br /&gt;
:The workstation is the location from which most users do most of their work.&lt;br /&gt;
:One(or more) workstations are configured to allow users to author, test, and maintain cookbooks. Cookbooks are uploaded to the Chef server from the workstation.&lt;br /&gt;
&lt;br /&gt;
*'''Chef Server:'''&lt;br /&gt;
:The Chef server acts as a hub of information. Cookbooks and policy settings are uploaded to the Chef server by users from workstations.&lt;br /&gt;
&lt;br /&gt;
*'''Chef-client:'''&lt;br /&gt;
:The chef-client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL for specific resources&lt;br /&gt;
&lt;br /&gt;
===Nginx===&lt;br /&gt;
&lt;br /&gt;
Nginx is a free, open-source, high-performance [HTTP] server and reverse proxy&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/glossary/reverse-proxy-server/]&amp;lt;/ref&amp;gt;, as well as an IMAP&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol&amp;lt;/ref&amp;gt;/POP3&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Post_Office_Protocol&amp;lt;/ref&amp;gt; proxy server. Nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/wiki/ Nginx Sever]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unicorn===&lt;br /&gt;
&lt;br /&gt;
Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.  Slow clients should only be served by placing a reverse proxy capable of fully buffering both the the request and response in between unicorn and slow clients.&lt;br /&gt;
&amp;lt;ref&amp;gt;[https://github.com/defunkt/unicorn Unicorn Web Server]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Plan of Action==&lt;br /&gt;
===Steps to Implement the Automated Deployment Process===&lt;br /&gt;
&lt;br /&gt;
[[File:Img01ExpInfra.png | frame|none|Expertiza Virtual Infrastructure]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Setup a virtual Vanilla&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Vanilla_software Vanilla]&amp;lt;/ref&amp;gt; Ubuntu&amp;lt;ref&amp;gt;[http://www.ubuntu.com Ubuntu]&amp;lt;/ref&amp;gt; Machine.&lt;br /&gt;
&lt;br /&gt;
2. Update the Ubuntu to the specified version.&lt;br /&gt;
&lt;br /&gt;
3. Clone Expertiza from Github.&lt;br /&gt;
&lt;br /&gt;
4. Install packages for Java, Ruby and all the ruby dependencies.&lt;br /&gt;
&lt;br /&gt;
5. Bundle install for installing all the gems in Gemfile.&lt;br /&gt;
&lt;br /&gt;
6. Install MYSQL&amp;lt;ref&amp;gt;[https://mysql.com Mysql server]&amp;lt;/ref&amp;gt;, configure it and migrate databases.&lt;br /&gt;
&lt;br /&gt;
7. Install Unicorn gem. Unicorn is a Rack&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Rack_%28web_server_interface%29 Rack Server]&amp;lt;/ref&amp;gt; HTTP server that uses forked processes to handle multiple incoming requests concurrently. For expertiza, unicorn is being used as the web server, which will interact with the database servers to fetch the data.&lt;br /&gt;
&lt;br /&gt;
8. Make changes in the nginx configuration.&lt;br /&gt;
&lt;br /&gt;
9. Install nginx. Nginx is a web server. It is being used in the Expertiza architecture as a reverse proxy server. Through nginx, we will also attempt to serve static pages directly.&lt;br /&gt;
&lt;br /&gt;
10. Configure Unicorn and integrate it to work with nginx.&lt;br /&gt;
&lt;br /&gt;
11. Start both Unicorn and Nginx server.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Stack==&lt;br /&gt;
&lt;br /&gt;
[[File:Exp1.png]]&lt;br /&gt;
&lt;br /&gt;
The above visually describes the expertiza stack on the virtual machine. The stack includes nginx as the front end, web server which will redirect the requests to the unicorn server. The scope of the project includes just 1 unicorn server but the recipe will be written in a way that later modifications can be made to add more than one unicorn servers under a load balancer. The unicorn server will interact with the database server and write/fetch data into it.&lt;br /&gt;
&lt;br /&gt;
==Sample Chef-Solo Recipe Example==&lt;br /&gt;
Chef solo has cookbooks and recipes. An example of recipes is as follows:&lt;br /&gt;
&lt;br /&gt;
    package &amp;quot;git-core&amp;quot; #apt-get install git-core&lt;br /&gt;
    user node[:user][:name] do&lt;br /&gt;
        password node[:user][:password]&lt;br /&gt;
        gid &amp;quot;admin&amp;quot;&lt;br /&gt;
        home &amp;quot;/home/#{node[:user][:name]}&amp;quot;&lt;br /&gt;
        supports :manage_home =&amp;gt; true&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
This recipe orchestrates the installation of git-core and creates a new user and sets its privileges and password along with the home directory. Similarly, the plan of action is to write recipes for downloading, installing and configuring various components(nginx, unicorn, Ruby, MYSQL etc.) which will contribute towards building the infrastructure of expertiza.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Deployment==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. We first created a droplet( virtual private server) using digital ocean&amp;lt;ref&amp;gt;https://www.digitalocean.com/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Drop.png]]&lt;br /&gt;
&lt;br /&gt;
2. We recorded the IP address of the newly created droplet and created the associated &amp;lt;ipaddress&amp;gt;.json file.&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;ipaddress&amp;gt;.json''' : This file holds all the node specific values required to install services and config node.&lt;br /&gt;
We will set node_user , user_hash_password , ruby version , mysql root &amp;amp; password . The main function apart from holding node variables is to run recipes in a specific code.&lt;br /&gt;
&lt;br /&gt;
[[File:New_ip.png]]&lt;br /&gt;
&lt;br /&gt;
The following recipes(.rb files), scripts and node specific files were created to achieve automatic deployment. Other pre-installed files and folder for Chef cookbook can be found in the git repository mentioned above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. We then run the bash command in following format&amp;lt;code&amp;gt;sh setup_vps.sh &amp;lt;node_username&amp;gt; &amp;lt;node_ip_address&amp;gt; &amp;lt;node_port&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command will run the knife tool that will setup Chef-solo on the node and will execute the recipes.&lt;br /&gt;
This needs to be run from the directory where '''setup_vps.sh''' is present.&lt;br /&gt;
&lt;br /&gt;
[[File:New setup vps.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. '''default.rb''' : This recipe will update the Ubuntu machine packages, install the list of prerequisite packages and set the time zone.&lt;br /&gt;
&lt;br /&gt;
[[File:New default.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. '''expertiza_clone''' : This recipe will create a directory and clone the Expertiza git source code into that directory.&lt;br /&gt;
&lt;br /&gt;
[[File:New expertiza clone.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. '''set_java_home''': This recipe will set the Java configuration. It will then bundle install all the gems used by the Expertiza.&lt;br /&gt;
&lt;br /&gt;
[[File:New_set_java.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. '''mysql.rb''' : This recipe will install the MySQL server , MySQL client and its associated dependencies. The root password is preloaded and then fetched on installation by setting DEBIAN_FRONTEND environment variable.&lt;br /&gt;
&lt;br /&gt;
[[File:New sql.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. '''database.rb''' : This recipe will execute scrubbed.sql on MySQL, which in turn will create all the Schema for production, development and test environments. It will also populate the database tables with seed (configuration) data.&lt;br /&gt;
&lt;br /&gt;
[[File:New database.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. '''nginx.rb''' : This recipe will install nginx which is a web proxy server that will listen on user defined port and redirect the requests for static content(images, css, javascript) to the public folder of the Expertiza rails app.&lt;br /&gt;
&lt;br /&gt;
[[File:New_nginx.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. '''unicorn_conf.rb''' : This recipe will install and configure Unicorn web server used in production environment to handle requests for dynamic content passed on by the Nginx server.&lt;br /&gt;
&lt;br /&gt;
[[File:New_unicorn_corn.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
11. '''start_server.rb''' : This will restart all the installed services, after which Expertiza can start taking requests.&lt;br /&gt;
&lt;br /&gt;
[[File:New start server1.png]]&lt;br /&gt;
&lt;br /&gt;
==Github link==&lt;br /&gt;
https://github.com/amurark/expertiza&lt;br /&gt;
&lt;br /&gt;
==Points for the reviewer==&lt;br /&gt;
&lt;br /&gt;
While reviewing this project, please consider the following points:&lt;br /&gt;
&lt;br /&gt;
*1. There is no scope for testing in our project. This has been discussed and approved by the mentor. &lt;br /&gt;
*2. There is no scope for UML diagrams for this project, as there are no classes/interface involved.&lt;br /&gt;
&lt;br /&gt;
==Future Scope==&lt;br /&gt;
&lt;br /&gt;
The cookbook has been created with the assumption of root user as the administer.For security purposes deployment should be done with another user with sudo privileges, and then root login disabled. Also a new user for MySQL with full database privileges needs to be created. But that hasn't been achieved automatically in the resent cookbook. Further, Unicorn configuration is done with a single Unicorn server in mind. It has to be configured for multiple servers for load balancing in events of heavy traffic. &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100604</id>
		<title>CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100604"/>
		<updated>2015-12-16T18:31:36Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: /* Chef-Solo Recipe Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction to Expertiza==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is a web application to create reusable learning objects through peer review. It supports various features such as team projects and the submission of various documents including URLs and wiki pages. It is being used extensively across various universities for select courses.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Currently, setting up the infrastructure for expertiza is done manually. The task is to write a Chef-solo&amp;lt;ref&amp;gt;[https://docs.chef.io/chef_solo.html Chef Solo]&amp;lt;/ref&amp;gt; recipe which will create a production ready environment for expertiza. Chef-solo recipes are Ruby&amp;lt;ref&amp;gt;[https://www.ruby-lang.org/en/ Ruby]&amp;lt;/ref&amp;gt; code.&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
&lt;br /&gt;
We need to provide a single step setup of expertiza for production.&lt;br /&gt;
&lt;br /&gt;
*It should include setting up the basic environment, application dependency, configuration setup and database setup.&lt;br /&gt;
*It should also include recipe for regular deployment.&lt;br /&gt;
&lt;br /&gt;
==Terminology==&lt;br /&gt;
===Chef Solo&amp;lt;ref&amp;gt;https://docs.chef.io/chef_solo.html&amp;lt;/ref&amp;gt;=== &lt;br /&gt;
Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each organization is comprised of one(or more) workstations, a single server, and every node that will be configured and maintained by the chef-client. Cookbooks (and recipes) are used to tell the chef-client how each node in your organization should be configured. The chef-client(which is installed on every node) does the actual configuration.&lt;br /&gt;
&lt;br /&gt;
*'''Node:'''&lt;br /&gt;
:A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.&lt;br /&gt;
&lt;br /&gt;
*'''Recipe: ''' &lt;br /&gt;
:A recipe specifies the resources to use and the order in which they are to be applied. It is mostly a collection of resources, defined using patterns(resource names, attribute-value pairs, and actions). A recipe       must define everything that is required to configure part of a system.&lt;br /&gt;
&lt;br /&gt;
*'''Cookbook:''' &lt;br /&gt;
:A cookbook is the fundamental unit of configuration and policy distribution. A cookbook defines a scenario and contains everything that is required to support that scenario.&lt;br /&gt;
&lt;br /&gt;
*'''WorkStation:'''&lt;br /&gt;
:A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery. &lt;br /&gt;
:The workstation is the location from which most users do most of their work.&lt;br /&gt;
:One(or more) workstations are configured to allow users to author, test, and maintain cookbooks. Cookbooks are uploaded to the Chef server from the workstation.&lt;br /&gt;
&lt;br /&gt;
*'''Chef Server:'''&lt;br /&gt;
:The Chef server acts as a hub of information. Cookbooks and policy settings are uploaded to the Chef server by users from workstations.&lt;br /&gt;
&lt;br /&gt;
*'''Chef-client:'''&lt;br /&gt;
:The chef-client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL for specific resources&lt;br /&gt;
&lt;br /&gt;
===Nginx===&lt;br /&gt;
&lt;br /&gt;
Nginx is a free, open-source, high-performance [HTTP] server and reverse proxy&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/glossary/reverse-proxy-server/]&amp;lt;/ref&amp;gt;, as well as an IMAP&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol&amp;lt;/ref&amp;gt;/POP3&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Post_Office_Protocol&amp;lt;/ref&amp;gt; proxy server. Nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/wiki/ Nginx Sever]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unicorn===&lt;br /&gt;
&lt;br /&gt;
Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.  Slow clients should only be served by placing a reverse proxy capable of fully buffering both the the request and response in between unicorn and slow clients.&lt;br /&gt;
&amp;lt;ref&amp;gt;[https://github.com/defunkt/unicorn Unicorn Web Server]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Plan of Action==&lt;br /&gt;
===Steps to Implement the Automated Deployment Process===&lt;br /&gt;
&lt;br /&gt;
[[File:Img01ExpInfra.png | frame|none|Expertiza Virtual Infrastructure]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Setup a virtual Vanilla&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Vanilla_software Vanilla]&amp;lt;/ref&amp;gt; Ubuntu&amp;lt;ref&amp;gt;[http://www.ubuntu.com Ubuntu]&amp;lt;/ref&amp;gt; Machine.&lt;br /&gt;
&lt;br /&gt;
2. Update the Ubuntu to the specified version.&lt;br /&gt;
&lt;br /&gt;
3. Clone Expertiza from Github.&lt;br /&gt;
&lt;br /&gt;
4. Install packages for Java, Ruby and all the ruby dependencies.&lt;br /&gt;
&lt;br /&gt;
5. Bundle install for installing all the gems in Gemfile.&lt;br /&gt;
&lt;br /&gt;
6. Install MYSQL&amp;lt;ref&amp;gt;[https://mysql.com Mysql server]&amp;lt;/ref&amp;gt;, configure it and migrate databases.&lt;br /&gt;
&lt;br /&gt;
7. Install Unicorn gem. Unicorn is a Rack&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Rack_%28web_server_interface%29 Rack Server]&amp;lt;/ref&amp;gt; HTTP server that uses forked processes to handle multiple incoming requests concurrently. For expertiza, unicorn is being used as the web server, which will interact with the database servers to fetch the data.&lt;br /&gt;
&lt;br /&gt;
8. Make changes in the nginx configuration.&lt;br /&gt;
&lt;br /&gt;
9. Install nginx. Nginx is a web server. It is being used in the Expertiza architecture as a reverse proxy server. Through nginx, we will also attempt to serve static pages directly.&lt;br /&gt;
&lt;br /&gt;
10. Configure Unicorn and integrate it to work with nginx.&lt;br /&gt;
&lt;br /&gt;
11. Start both Unicorn and Nginx server.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Stack==&lt;br /&gt;
&lt;br /&gt;
[[File:Exp1.png]]&lt;br /&gt;
&lt;br /&gt;
The above visually describes the expertiza stack on the virtual machine. The stack includes nginx as the front end, web server which will redirect the requests to the unicorn server. The scope of the project includes just 1 unicorn server but the recipe will be written in a way that later modifications can be made to add more than one unicorn servers under a load balancer. The unicorn server will interact with the database server and write/fetch data into it.&lt;br /&gt;
&lt;br /&gt;
==Sample Chef-Solo Recipe Example==&lt;br /&gt;
Chef solo has cookbooks and recipes. An example of recipes is as follows:&lt;br /&gt;
    package &amp;quot;git-core&amp;quot; #apt-get install git-core&lt;br /&gt;
&lt;br /&gt;
    user node[:user][:name] do&lt;br /&gt;
        password node[:user][:password]&lt;br /&gt;
        gid &amp;quot;admin&amp;quot;&lt;br /&gt;
        home &amp;quot;/home/#{node[:user][:name]}&amp;quot;&lt;br /&gt;
        supports :manage_home =&amp;gt; true&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
This recipe orchestrates the installation of git-core and creates a new user and sets its privileges and password along with the home directory. Similarly, the plan of action is to write recipes for downloading, installing and configuring various components(nginx, unicorn, Ruby, MYSQL etc.) which will contribute towards building the infrastructure of expertiza.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Deployment==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. We first created a droplet( virtual private server) using digital ocean&amp;lt;ref&amp;gt;https://www.digitalocean.com/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Drop.png]]&lt;br /&gt;
&lt;br /&gt;
2. We recorded the IP address of the newly created droplet and created the associated &amp;lt;ipaddress&amp;gt;.json file.&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;ipaddress&amp;gt;.json''' : This file holds all the node specific values required to install services and config node.&lt;br /&gt;
We will set node_user , user_hash_password , ruby version , mysql root &amp;amp; password . The main function apart from holding node variables is to run recipes in a specific code.&lt;br /&gt;
&lt;br /&gt;
[[File:New_ip.png]]&lt;br /&gt;
&lt;br /&gt;
The following recipes(.rb files), scripts and node specific files were created to achieve automatic deployment. Other pre-installed files and folder for Chef cookbook can be found in the git repository mentioned above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. We then run the bash command in following format&amp;lt;code&amp;gt;sh setup_vps.sh &amp;lt;node_username&amp;gt; &amp;lt;node_ip_address&amp;gt; &amp;lt;node_port&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command will run the knife tool that will setup Chef-solo on the node and will execute the recipes.&lt;br /&gt;
This needs to be run from the directory where '''setup_vps.sh''' is present.&lt;br /&gt;
&lt;br /&gt;
[[File:New setup vps.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. '''default.rb''' : This recipe will update the Ubuntu machine packages, install the list of prerequisite packages and set the time zone.&lt;br /&gt;
&lt;br /&gt;
[[File:New default.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. '''expertiza_clone''' : This recipe will create a directory and clone the Expertiza git source code into that directory.&lt;br /&gt;
&lt;br /&gt;
[[File:New expertiza clone.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. '''set_java_home''': This recipe will set the Java configuration. It will then bundle install all the gems used by the Expertiza.&lt;br /&gt;
&lt;br /&gt;
[[File:New_set_java.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. '''mysql.rb''' : This recipe will install the MySQL server , MySQL client and its associated dependencies. The root password is preloaded and then fetched on installation by setting DEBIAN_FRONTEND environment variable.&lt;br /&gt;
&lt;br /&gt;
[[File:New sql.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. '''database.rb''' : This recipe will execute scrubbed.sql on MySQL, which in turn will create all the Schema for production, development and test environments. It will also populate the database tables with seed (configuration) data.&lt;br /&gt;
&lt;br /&gt;
[[File:New database.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. '''nginx.rb''' : This recipe will install nginx which is a web proxy server that will listen on user defined port and redirect the requests for static content(images, css, javascript) to the public folder of the Expertiza rails app.&lt;br /&gt;
&lt;br /&gt;
[[File:New_nginx.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. '''unicorn_conf.rb''' : This recipe will install and configure Unicorn web server used in production environment to handle requests for dynamic content passed on by the Nginx server.&lt;br /&gt;
&lt;br /&gt;
[[File:New_unicorn_corn.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
11. '''start_server.rb''' : This will restart all the installed services, after which Expertiza can start taking requests.&lt;br /&gt;
&lt;br /&gt;
[[File:New start server1.png]]&lt;br /&gt;
&lt;br /&gt;
==Github link==&lt;br /&gt;
https://github.com/amurark/expertiza&lt;br /&gt;
&lt;br /&gt;
==Points for the reviewer==&lt;br /&gt;
&lt;br /&gt;
While reviewing this project, please consider the following points:&lt;br /&gt;
&lt;br /&gt;
*1. There is no scope for testing in our project. This has been discussed and approved by the mentor. &lt;br /&gt;
*2. There is no scope for UML diagrams for this project, as there are no classes/interface involved.&lt;br /&gt;
&lt;br /&gt;
==Future Scope==&lt;br /&gt;
&lt;br /&gt;
The cookbook has been created with the assumption of root user as the administer.For security purposes deployment should be done with another user with sudo privileges, and then root login disabled. Also a new user for MySQL with full database privileges needs to be created. But that hasn't been achieved automatically in the resent cookbook. Further, Unicorn configuration is done with a single Unicorn server in mind. It has to be configured for multiple servers for load balancing in events of heavy traffic. &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100603</id>
		<title>CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100603"/>
		<updated>2015-12-16T18:28:26Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: /* Expertiza Deployment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction to Expertiza==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is a web application to create reusable learning objects through peer review. It supports various features such as team projects and the submission of various documents including URLs and wiki pages. It is being used extensively across various universities for select courses.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Currently, setting up the infrastructure for expertiza is done manually. The task is to write a Chef-solo&amp;lt;ref&amp;gt;[https://docs.chef.io/chef_solo.html Chef Solo]&amp;lt;/ref&amp;gt; recipe which will create a production ready environment for expertiza. Chef-solo recipes are Ruby&amp;lt;ref&amp;gt;[https://www.ruby-lang.org/en/ Ruby]&amp;lt;/ref&amp;gt; code.&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
&lt;br /&gt;
We need to provide a single step setup of expertiza for production.&lt;br /&gt;
&lt;br /&gt;
*It should include setting up the basic environment, application dependency, configuration setup and database setup.&lt;br /&gt;
*It should also include recipe for regular deployment.&lt;br /&gt;
&lt;br /&gt;
==Terminology==&lt;br /&gt;
===Chef Solo&amp;lt;ref&amp;gt;https://docs.chef.io/chef_solo.html&amp;lt;/ref&amp;gt;=== &lt;br /&gt;
Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each organization is comprised of one(or more) workstations, a single server, and every node that will be configured and maintained by the chef-client. Cookbooks (and recipes) are used to tell the chef-client how each node in your organization should be configured. The chef-client(which is installed on every node) does the actual configuration.&lt;br /&gt;
&lt;br /&gt;
*'''Node:'''&lt;br /&gt;
:A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.&lt;br /&gt;
&lt;br /&gt;
*'''Recipe: ''' &lt;br /&gt;
:A recipe specifies the resources to use and the order in which they are to be applied. It is mostly a collection of resources, defined using patterns(resource names, attribute-value pairs, and actions). A recipe       must define everything that is required to configure part of a system.&lt;br /&gt;
&lt;br /&gt;
*'''Cookbook:''' &lt;br /&gt;
:A cookbook is the fundamental unit of configuration and policy distribution. A cookbook defines a scenario and contains everything that is required to support that scenario.&lt;br /&gt;
&lt;br /&gt;
*'''WorkStation:'''&lt;br /&gt;
:A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery. &lt;br /&gt;
:The workstation is the location from which most users do most of their work.&lt;br /&gt;
:One(or more) workstations are configured to allow users to author, test, and maintain cookbooks. Cookbooks are uploaded to the Chef server from the workstation.&lt;br /&gt;
&lt;br /&gt;
*'''Chef Server:'''&lt;br /&gt;
:The Chef server acts as a hub of information. Cookbooks and policy settings are uploaded to the Chef server by users from workstations.&lt;br /&gt;
&lt;br /&gt;
*'''Chef-client:'''&lt;br /&gt;
:The chef-client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL for specific resources&lt;br /&gt;
&lt;br /&gt;
===Nginx===&lt;br /&gt;
&lt;br /&gt;
Nginx is a free, open-source, high-performance [HTTP] server and reverse proxy&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/glossary/reverse-proxy-server/]&amp;lt;/ref&amp;gt;, as well as an IMAP&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol&amp;lt;/ref&amp;gt;/POP3&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Post_Office_Protocol&amp;lt;/ref&amp;gt; proxy server. Nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/wiki/ Nginx Sever]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unicorn===&lt;br /&gt;
&lt;br /&gt;
Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.  Slow clients should only be served by placing a reverse proxy capable of fully buffering both the the request and response in between unicorn and slow clients.&lt;br /&gt;
&amp;lt;ref&amp;gt;[https://github.com/defunkt/unicorn Unicorn Web Server]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Plan of Action==&lt;br /&gt;
===Steps to Implement the Automated Deployment Process===&lt;br /&gt;
&lt;br /&gt;
[[File:Img01ExpInfra.png | frame|none|Expertiza Virtual Infrastructure]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Setup a virtual Vanilla&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Vanilla_software Vanilla]&amp;lt;/ref&amp;gt; Ubuntu&amp;lt;ref&amp;gt;[http://www.ubuntu.com Ubuntu]&amp;lt;/ref&amp;gt; Machine.&lt;br /&gt;
&lt;br /&gt;
2. Update the Ubuntu to the specified version.&lt;br /&gt;
&lt;br /&gt;
3. Clone Expertiza from Github.&lt;br /&gt;
&lt;br /&gt;
4. Install packages for Java, Ruby and all the ruby dependencies.&lt;br /&gt;
&lt;br /&gt;
5. Bundle install for installing all the gems in Gemfile.&lt;br /&gt;
&lt;br /&gt;
6. Install MYSQL&amp;lt;ref&amp;gt;[https://mysql.com Mysql server]&amp;lt;/ref&amp;gt;, configure it and migrate databases.&lt;br /&gt;
&lt;br /&gt;
7. Install Unicorn gem. Unicorn is a Rack&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Rack_%28web_server_interface%29 Rack Server]&amp;lt;/ref&amp;gt; HTTP server that uses forked processes to handle multiple incoming requests concurrently. For expertiza, unicorn is being used as the web server, which will interact with the database servers to fetch the data.&lt;br /&gt;
&lt;br /&gt;
8. Make changes in the nginx configuration.&lt;br /&gt;
&lt;br /&gt;
9. Install nginx. Nginx is a web server. It is being used in the Expertiza architecture as a reverse proxy server. Through nginx, we will also attempt to serve static pages directly.&lt;br /&gt;
&lt;br /&gt;
10. Configure Unicorn and integrate it to work with nginx.&lt;br /&gt;
&lt;br /&gt;
11. Start both Unicorn and Nginx server.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Stack==&lt;br /&gt;
&lt;br /&gt;
[[File:Exp1.png]]&lt;br /&gt;
&lt;br /&gt;
The above visually describes the expertiza stack on the virtual machine. The stack includes nginx as the front end, web server which will redirect the requests to the unicorn server. The scope of the project includes just 1 unicorn server but the recipe will be written in a way that later modifications can be made to add more than one unicorn servers under a load balancer. The unicorn server will interact with the database server and write/fetch data into it.&lt;br /&gt;
&lt;br /&gt;
==Chef-Solo Recipe Example==&lt;br /&gt;
Chef solo has cookbooks and recipes. An example of recipes is as follows:&lt;br /&gt;
    package &amp;quot;git-core&amp;quot; #apt-get install git-core&lt;br /&gt;
&lt;br /&gt;
    user node[:user][:name] do&lt;br /&gt;
        password node[:user][:password]&lt;br /&gt;
        gid &amp;quot;admin&amp;quot;&lt;br /&gt;
        home &amp;quot;/home/#{node[:user][:name]}&amp;quot;&lt;br /&gt;
        supports :manage_home =&amp;gt; true&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
This recipe orchestrates the installation of git-core and creates a new user and sets its privileges and password along with the home directory. Similarly, the plan of action is to write recipes for downloading, installing and configuring various components(nginx, unicorn, Ruby, MYSQL etc.) which will contribute towards building the infrastructure of expertiza.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Deployment==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. We first created a droplet( virtual private server) using digital ocean&amp;lt;ref&amp;gt;https://www.digitalocean.com/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Drop.png]]&lt;br /&gt;
&lt;br /&gt;
2. We recorded the IP address of the newly created droplet and created the associated &amp;lt;ipaddress&amp;gt;.json file.&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;ipaddress&amp;gt;.json''' : This file holds all the node specific values required to install services and config node.&lt;br /&gt;
We will set node_user , user_hash_password , ruby version , mysql root &amp;amp; password . The main function apart from holding node variables is to run recipes in a specific code.&lt;br /&gt;
&lt;br /&gt;
[[File:New_ip.png]]&lt;br /&gt;
&lt;br /&gt;
The following recipes(.rb files), scripts and node specific files were created to achieve automatic deployment. Other pre-installed files and folder for Chef cookbook can be found in the git repository mentioned above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. We then run the bash command in following format&amp;lt;code&amp;gt;sh setup_vps.sh &amp;lt;node_username&amp;gt; &amp;lt;node_ip_address&amp;gt; &amp;lt;node_port&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command will run the knife tool that will setup Chef-solo on the node and will execute the recipes.&lt;br /&gt;
This needs to be run from the directory where '''setup_vps.sh''' is present.&lt;br /&gt;
&lt;br /&gt;
[[File:New setup vps.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. '''default.rb''' : This recipe will update the Ubuntu machine packages, install the list of prerequisite packages and set the time zone.&lt;br /&gt;
&lt;br /&gt;
[[File:New default.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. '''expertiza_clone''' : This recipe will create a directory and clone the Expertiza git source code into that directory.&lt;br /&gt;
&lt;br /&gt;
[[File:New expertiza clone.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. '''set_java_home''': This recipe will set the Java configuration. It will then bundle install all the gems used by the Expertiza.&lt;br /&gt;
&lt;br /&gt;
[[File:New_set_java.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. '''mysql.rb''' : This recipe will install the MySQL server , MySQL client and its associated dependencies. The root password is preloaded and then fetched on installation by setting DEBIAN_FRONTEND environment variable.&lt;br /&gt;
&lt;br /&gt;
[[File:New sql.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. '''database.rb''' : This recipe will execute scrubbed.sql on MySQL, which in turn will create all the Schema for production, development and test environments. It will also populate the database tables with seed (configuration) data.&lt;br /&gt;
&lt;br /&gt;
[[File:New database.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. '''nginx.rb''' : This recipe will install nginx which is a web proxy server that will listen on user defined port and redirect the requests for static content(images, css, javascript) to the public folder of the Expertiza rails app.&lt;br /&gt;
&lt;br /&gt;
[[File:New_nginx.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. '''unicorn_conf.rb''' : This recipe will install and configure Unicorn web server used in production environment to handle requests for dynamic content passed on by the Nginx server.&lt;br /&gt;
&lt;br /&gt;
[[File:New_unicorn_corn.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
11. '''start_server.rb''' : This will restart all the installed services, after which Expertiza can start taking requests.&lt;br /&gt;
&lt;br /&gt;
[[File:New start server1.png]]&lt;br /&gt;
&lt;br /&gt;
==Github link==&lt;br /&gt;
https://github.com/amurark/expertiza&lt;br /&gt;
&lt;br /&gt;
==Points for the reviewer==&lt;br /&gt;
&lt;br /&gt;
While reviewing this project, please consider the following points:&lt;br /&gt;
&lt;br /&gt;
*1. There is no scope for testing in our project. This has been discussed and approved by the mentor. &lt;br /&gt;
*2. There is no scope for UML diagrams for this project, as there are no classes/interface involved.&lt;br /&gt;
&lt;br /&gt;
==Future Scope==&lt;br /&gt;
&lt;br /&gt;
The cookbook has been created with the assumption of root user as the administer.For security purposes deployment should be done with another user with sudo privileges, and then root login disabled. Also a new user for MySQL with full database privileges needs to be created. But that hasn't been achieved automatically in the resent cookbook. Further, Unicorn configuration is done with a single Unicorn server in mind. It has to be configured for multiple servers for load balancing in events of heavy traffic. &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100602</id>
		<title>CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100602"/>
		<updated>2015-12-16T18:27:17Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: /* Expertiza Deployment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction to Expertiza==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is a web application to create reusable learning objects through peer review. It supports various features such as team projects and the submission of various documents including URLs and wiki pages. It is being used extensively across various universities for select courses.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Currently, setting up the infrastructure for expertiza is done manually. The task is to write a Chef-solo&amp;lt;ref&amp;gt;[https://docs.chef.io/chef_solo.html Chef Solo]&amp;lt;/ref&amp;gt; recipe which will create a production ready environment for expertiza. Chef-solo recipes are Ruby&amp;lt;ref&amp;gt;[https://www.ruby-lang.org/en/ Ruby]&amp;lt;/ref&amp;gt; code.&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
&lt;br /&gt;
We need to provide a single step setup of expertiza for production.&lt;br /&gt;
&lt;br /&gt;
*It should include setting up the basic environment, application dependency, configuration setup and database setup.&lt;br /&gt;
*It should also include recipe for regular deployment.&lt;br /&gt;
&lt;br /&gt;
==Terminology==&lt;br /&gt;
===Chef Solo&amp;lt;ref&amp;gt;https://docs.chef.io/chef_solo.html&amp;lt;/ref&amp;gt;=== &lt;br /&gt;
Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each organization is comprised of one(or more) workstations, a single server, and every node that will be configured and maintained by the chef-client. Cookbooks (and recipes) are used to tell the chef-client how each node in your organization should be configured. The chef-client(which is installed on every node) does the actual configuration.&lt;br /&gt;
&lt;br /&gt;
*'''Node:'''&lt;br /&gt;
:A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.&lt;br /&gt;
&lt;br /&gt;
*'''Recipe: ''' &lt;br /&gt;
:A recipe specifies the resources to use and the order in which they are to be applied. It is mostly a collection of resources, defined using patterns(resource names, attribute-value pairs, and actions). A recipe       must define everything that is required to configure part of a system.&lt;br /&gt;
&lt;br /&gt;
*'''Cookbook:''' &lt;br /&gt;
:A cookbook is the fundamental unit of configuration and policy distribution. A cookbook defines a scenario and contains everything that is required to support that scenario.&lt;br /&gt;
&lt;br /&gt;
*'''WorkStation:'''&lt;br /&gt;
:A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery. &lt;br /&gt;
:The workstation is the location from which most users do most of their work.&lt;br /&gt;
:One(or more) workstations are configured to allow users to author, test, and maintain cookbooks. Cookbooks are uploaded to the Chef server from the workstation.&lt;br /&gt;
&lt;br /&gt;
*'''Chef Server:'''&lt;br /&gt;
:The Chef server acts as a hub of information. Cookbooks and policy settings are uploaded to the Chef server by users from workstations.&lt;br /&gt;
&lt;br /&gt;
*'''Chef-client:'''&lt;br /&gt;
:The chef-client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL for specific resources&lt;br /&gt;
&lt;br /&gt;
===Nginx===&lt;br /&gt;
&lt;br /&gt;
Nginx is a free, open-source, high-performance [HTTP] server and reverse proxy&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/glossary/reverse-proxy-server/]&amp;lt;/ref&amp;gt;, as well as an IMAP&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol&amp;lt;/ref&amp;gt;/POP3&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Post_Office_Protocol&amp;lt;/ref&amp;gt; proxy server. Nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/wiki/ Nginx Sever]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unicorn===&lt;br /&gt;
&lt;br /&gt;
Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.  Slow clients should only be served by placing a reverse proxy capable of fully buffering both the the request and response in between unicorn and slow clients.&lt;br /&gt;
&amp;lt;ref&amp;gt;[https://github.com/defunkt/unicorn Unicorn Web Server]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Plan of Action==&lt;br /&gt;
===Steps to Implement the Automated Deployment Process===&lt;br /&gt;
&lt;br /&gt;
[[File:Img01ExpInfra.png | frame|none|Expertiza Virtual Infrastructure]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Setup a virtual Vanilla&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Vanilla_software Vanilla]&amp;lt;/ref&amp;gt; Ubuntu&amp;lt;ref&amp;gt;[http://www.ubuntu.com Ubuntu]&amp;lt;/ref&amp;gt; Machine.&lt;br /&gt;
&lt;br /&gt;
2. Update the Ubuntu to the specified version.&lt;br /&gt;
&lt;br /&gt;
3. Clone Expertiza from Github.&lt;br /&gt;
&lt;br /&gt;
4. Install packages for Java, Ruby and all the ruby dependencies.&lt;br /&gt;
&lt;br /&gt;
5. Bundle install for installing all the gems in Gemfile.&lt;br /&gt;
&lt;br /&gt;
6. Install MYSQL&amp;lt;ref&amp;gt;[https://mysql.com Mysql server]&amp;lt;/ref&amp;gt;, configure it and migrate databases.&lt;br /&gt;
&lt;br /&gt;
7. Install Unicorn gem. Unicorn is a Rack&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Rack_%28web_server_interface%29 Rack Server]&amp;lt;/ref&amp;gt; HTTP server that uses forked processes to handle multiple incoming requests concurrently. For expertiza, unicorn is being used as the web server, which will interact with the database servers to fetch the data.&lt;br /&gt;
&lt;br /&gt;
8. Make changes in the nginx configuration.&lt;br /&gt;
&lt;br /&gt;
9. Install nginx. Nginx is a web server. It is being used in the Expertiza architecture as a reverse proxy server. Through nginx, we will also attempt to serve static pages directly.&lt;br /&gt;
&lt;br /&gt;
10. Configure Unicorn and integrate it to work with nginx.&lt;br /&gt;
&lt;br /&gt;
11. Start both Unicorn and Nginx server.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Stack==&lt;br /&gt;
&lt;br /&gt;
[[File:Exp1.png]]&lt;br /&gt;
&lt;br /&gt;
The above visually describes the expertiza stack on the virtual machine. The stack includes nginx as the front end, web server which will redirect the requests to the unicorn server. The scope of the project includes just 1 unicorn server but the recipe will be written in a way that later modifications can be made to add more than one unicorn servers under a load balancer. The unicorn server will interact with the database server and write/fetch data into it.&lt;br /&gt;
&lt;br /&gt;
==Chef-Solo Recipe Example==&lt;br /&gt;
Chef solo has cookbooks and recipes. An example of recipes is as follows:&lt;br /&gt;
    package &amp;quot;git-core&amp;quot; #apt-get install git-core&lt;br /&gt;
&lt;br /&gt;
    user node[:user][:name] do&lt;br /&gt;
        password node[:user][:password]&lt;br /&gt;
        gid &amp;quot;admin&amp;quot;&lt;br /&gt;
        home &amp;quot;/home/#{node[:user][:name]}&amp;quot;&lt;br /&gt;
        supports :manage_home =&amp;gt; true&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
This recipe orchestrates the installation of git-core and creates a new user and sets its privileges and password along with the home directory. Similarly, the plan of action is to write recipes for downloading, installing and configuring various components(nginx, unicorn, Ruby, MYSQL etc.) which will contribute towards building the infrastructure of expertiza.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Deployment==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. We first created a droplet( virtual private server) using digital ocean&amp;lt;ref&amp;gt;https://www.digitalocean.com/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Drop.png]]&lt;br /&gt;
&lt;br /&gt;
2. We recorded the IP address of the newly created droplet and created the associated &amp;lt;ipaddress&amp;gt;.json file.&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;ipaddress&amp;gt;.json''' : This file holds all the node specific values required to install services and config node.&lt;br /&gt;
We will set node_user , user_hash_password , ruby version , mysql root &amp;amp; password . The main function apart from holding node variables is to run recipes in a specific code.&lt;br /&gt;
&lt;br /&gt;
[[File:New_ip.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following recipes(.rb files), scripts and node specific files were created to achieve automatic deployment. Other pre-installed files and folder for Chef cookbook can be found in the git repository mentioned above.&lt;br /&gt;
&lt;br /&gt;
3. We then run the bash command in following format&amp;lt;code&amp;gt;sh setup_vps.sh &amp;lt;node_username&amp;gt; &amp;lt;node_ip_address&amp;gt; &amp;lt;node_port&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command will run the knife tool that will setup Chef-solo on the node and will execute the recipes.&lt;br /&gt;
This needs to be run from the directory where '''setup_vps.sh''' is present.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New setup vps.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. '''default.rb''' : This recipe will update the Ubuntu machine packages, install the list of prerequisite packages and set the time zone.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New default.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. '''expertiza_clone''' : This recipe will create a directory and clone the Expertiza git source code into that directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New expertiza clone.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. '''set_java_home''': This recipe will set the Java configuration. It will then bundle install all the gems used by the Expertiza.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New_set_java.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. '''mysql.rb''' : This recipe will install the MySQL server , MySQL client and its associated dependencies. The root password is preloaded and then fetched on installation by setting DEBIAN_FRONTEND environment variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New sql.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. '''database.rb''' : This recipe will execute scrubbed.sql on MySQL, which in turn will create all the Schema for production, development and test environments. It will also populate the database tables with seed (configuration) data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New database.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. '''nginx.rb''' : This recipe will install nginx which is a web proxy server that will listen on user defined port and redirect the requests for static content(images, css, javascript) to the public folder of the Expertiza rails app.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New_nginx.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. '''unicorn_conf.rb''' : This recipe will install and configure Unicorn web server used in production environment to handle requests for dynamic content passed on by the Nginx server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New_unicorn_corn.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
11. '''start_server.rb''' : This will restart all the installed services, after which Expertiza can start taking requests.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New start server1.png]]&lt;br /&gt;
&lt;br /&gt;
==Github link==&lt;br /&gt;
https://github.com/amurark/expertiza&lt;br /&gt;
&lt;br /&gt;
==Points for the reviewer==&lt;br /&gt;
&lt;br /&gt;
While reviewing this project, please consider the following points:&lt;br /&gt;
&lt;br /&gt;
*1. There is no scope for testing in our project. This has been discussed and approved by the mentor. &lt;br /&gt;
*2. There is no scope for UML diagrams for this project, as there are no classes/interface involved.&lt;br /&gt;
&lt;br /&gt;
==Future Scope==&lt;br /&gt;
&lt;br /&gt;
The cookbook has been created with the assumption of root user as the administer.For security purposes deployment should be done with another user with sudo privileges, and then root login disabled. Also a new user for MySQL with full database privileges needs to be created. But that hasn't been achieved automatically in the resent cookbook. Further, Unicorn configuration is done with a single Unicorn server in mind. It has to be configured for multiple servers for load balancing in events of heavy traffic. &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100600</id>
		<title>CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100600"/>
		<updated>2015-12-16T18:20:46Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: /* Expertiza Deployment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction to Expertiza==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is a web application to create reusable learning objects through peer review. It supports various features such as team projects and the submission of various documents including URLs and wiki pages. It is being used extensively across various universities for select courses.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Currently, setting up the infrastructure for expertiza is done manually. The task is to write a Chef-solo&amp;lt;ref&amp;gt;[https://docs.chef.io/chef_solo.html Chef Solo]&amp;lt;/ref&amp;gt; recipe which will create a production ready environment for expertiza. Chef-solo recipes are Ruby&amp;lt;ref&amp;gt;[https://www.ruby-lang.org/en/ Ruby]&amp;lt;/ref&amp;gt; code.&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
&lt;br /&gt;
We need to provide a single step setup of expertiza for production.&lt;br /&gt;
&lt;br /&gt;
*It should include setting up the basic environment, application dependency, configuration setup and database setup.&lt;br /&gt;
*It should also include recipe for regular deployment.&lt;br /&gt;
&lt;br /&gt;
==Terminology==&lt;br /&gt;
===Chef Solo&amp;lt;ref&amp;gt;https://docs.chef.io/chef_solo.html&amp;lt;/ref&amp;gt;=== &lt;br /&gt;
Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each organization is comprised of one(or more) workstations, a single server, and every node that will be configured and maintained by the chef-client. Cookbooks (and recipes) are used to tell the chef-client how each node in your organization should be configured. The chef-client(which is installed on every node) does the actual configuration.&lt;br /&gt;
&lt;br /&gt;
*'''Node:'''&lt;br /&gt;
:A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.&lt;br /&gt;
&lt;br /&gt;
*'''Recipe: ''' &lt;br /&gt;
:A recipe specifies the resources to use and the order in which they are to be applied. It is mostly a collection of resources, defined using patterns(resource names, attribute-value pairs, and actions). A recipe       must define everything that is required to configure part of a system.&lt;br /&gt;
&lt;br /&gt;
*'''Cookbook:''' &lt;br /&gt;
:A cookbook is the fundamental unit of configuration and policy distribution. A cookbook defines a scenario and contains everything that is required to support that scenario.&lt;br /&gt;
&lt;br /&gt;
*'''WorkStation:'''&lt;br /&gt;
:A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery. &lt;br /&gt;
:The workstation is the location from which most users do most of their work.&lt;br /&gt;
:One(or more) workstations are configured to allow users to author, test, and maintain cookbooks. Cookbooks are uploaded to the Chef server from the workstation.&lt;br /&gt;
&lt;br /&gt;
*'''Chef Server:'''&lt;br /&gt;
:The Chef server acts as a hub of information. Cookbooks and policy settings are uploaded to the Chef server by users from workstations.&lt;br /&gt;
&lt;br /&gt;
*'''Chef-client:'''&lt;br /&gt;
:The chef-client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL for specific resources&lt;br /&gt;
&lt;br /&gt;
===Nginx===&lt;br /&gt;
&lt;br /&gt;
Nginx is a free, open-source, high-performance [HTTP] server and reverse proxy&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/glossary/reverse-proxy-server/]&amp;lt;/ref&amp;gt;, as well as an IMAP&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol&amp;lt;/ref&amp;gt;/POP3&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Post_Office_Protocol&amp;lt;/ref&amp;gt; proxy server. Nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/wiki/ Nginx Sever]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unicorn===&lt;br /&gt;
&lt;br /&gt;
Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.  Slow clients should only be served by placing a reverse proxy capable of fully buffering both the the request and response in between unicorn and slow clients.&lt;br /&gt;
&amp;lt;ref&amp;gt;[https://github.com/defunkt/unicorn Unicorn Web Server]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Plan of Action==&lt;br /&gt;
===Steps to Implement the Automated Deployment Process===&lt;br /&gt;
&lt;br /&gt;
[[File:Img01ExpInfra.png | frame|none|Expertiza Virtual Infrastructure]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Setup a virtual Vanilla&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Vanilla_software Vanilla]&amp;lt;/ref&amp;gt; Ubuntu&amp;lt;ref&amp;gt;[http://www.ubuntu.com Ubuntu]&amp;lt;/ref&amp;gt; Machine.&lt;br /&gt;
&lt;br /&gt;
2. Update the Ubuntu to the specified version.&lt;br /&gt;
&lt;br /&gt;
3. Clone Expertiza from Github.&lt;br /&gt;
&lt;br /&gt;
4. Install packages for Java, Ruby and all the ruby dependencies.&lt;br /&gt;
&lt;br /&gt;
5. Bundle install for installing all the gems in Gemfile.&lt;br /&gt;
&lt;br /&gt;
6. Install MYSQL&amp;lt;ref&amp;gt;[https://mysql.com Mysql server]&amp;lt;/ref&amp;gt;, configure it and migrate databases.&lt;br /&gt;
&lt;br /&gt;
7. Install Unicorn gem. Unicorn is a Rack&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Rack_%28web_server_interface%29 Rack Server]&amp;lt;/ref&amp;gt; HTTP server that uses forked processes to handle multiple incoming requests concurrently. For expertiza, unicorn is being used as the web server, which will interact with the database servers to fetch the data.&lt;br /&gt;
&lt;br /&gt;
8. Make changes in the nginx configuration.&lt;br /&gt;
&lt;br /&gt;
9. Install nginx. Nginx is a web server. It is being used in the Expertiza architecture as a reverse proxy server. Through nginx, we will also attempt to serve static pages directly.&lt;br /&gt;
&lt;br /&gt;
10. Configure Unicorn and integrate it to work with nginx.&lt;br /&gt;
&lt;br /&gt;
11. Start both Unicorn and Nginx server.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Stack==&lt;br /&gt;
&lt;br /&gt;
[[File:Exp1.png]]&lt;br /&gt;
&lt;br /&gt;
The above visually describes the expertiza stack on the virtual machine. The stack includes nginx as the front end, web server which will redirect the requests to the unicorn server. The scope of the project includes just 1 unicorn server but the recipe will be written in a way that later modifications can be made to add more than one unicorn servers under a load balancer. The unicorn server will interact with the database server and write/fetch data into it.&lt;br /&gt;
&lt;br /&gt;
==Chef-Solo Recipe Example==&lt;br /&gt;
Chef solo has cookbooks and recipes. An example of recipes is as follows:&lt;br /&gt;
    package &amp;quot;git-core&amp;quot; #apt-get install git-core&lt;br /&gt;
&lt;br /&gt;
    user node[:user][:name] do&lt;br /&gt;
        password node[:user][:password]&lt;br /&gt;
        gid &amp;quot;admin&amp;quot;&lt;br /&gt;
        home &amp;quot;/home/#{node[:user][:name]}&amp;quot;&lt;br /&gt;
        supports :manage_home =&amp;gt; true&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
This recipe orchestrates the installation of git-core and creates a new user and sets its privileges and password along with the home directory. Similarly, the plan of action is to write recipes for downloading, installing and configuring various components(nginx, unicorn, Ruby, MYSQL etc.) which will contribute towards building the infrastructure of expertiza.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Deployment==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. We first created a droplet( virtual private server) using digital ocean&amp;lt;ref&amp;gt;https://www.digitalocean.com/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Drop.png]]&lt;br /&gt;
&lt;br /&gt;
2. We recorded the IP address of the newly created droplet and created the associated &amp;lt;ipaddress&amp;gt;.json file.&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;ipaddress&amp;gt;.json''' : This file holds all the node specific values required to install services and config node.&lt;br /&gt;
We will set node_user , user_hash_password , ruby version , mysql root &amp;amp; password . The main function apart from holding node variables is to run recipes in a specific code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New_ip.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following recipes(.rb files), scripts and node specific files were created to achieve automatic deployment. Other pre-installed files and folder for Chef cookbook can be found in the git repository mentioned above.&lt;br /&gt;
&lt;br /&gt;
3. We then run the bash command in following format&amp;lt;code&amp;gt;sh setup_vps.sh &amp;lt;node_username&amp;gt; &amp;lt;node_ip_address&amp;gt; &amp;lt;node_port&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command will run the knife tool that will setup Chef-solo on the node and will execute the recipes.&lt;br /&gt;
This needs to be run from the directory where '''setup_vps.sh''' is present.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New setup vps.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. '''default.rb''' : This recipe will update the Ubuntu machine packages, install the list of prerequisite packages and set the time zone.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New default.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. '''expertiza_clone''' : This recipe will create a directory and clone the Expertiza git source code into that directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New expertiza clone.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. '''set_java_home''': This recipe will set the Java configuration. It will then bundle install all the gems used by the Expertiza.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New_set_java.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. '''mysql.rb''' : This recipe will install the MySQL server , MySQL client and its associated dependencies. The root password is preloaded and then fetched on installation by setting DEBIAN_FRONTEND environment variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New sql.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. '''database.rb''' : This recipe will execute scrubbed.sql on MySQL, which in turn will create all the Schema for production, development and test environments. It will also populate the database tables with seed (configuration) data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New database.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. '''nginx.rb''' : This recipe will install nginx which is a web proxy server that will listen on user defined port and redirect the requests for static content(images, css, javascript) to the public folder of the Expertiza rails app.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New_nginx.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. '''unicorn_conf.rb''' : This recipe will install and configure Unicorn web server used in production environment to handle requests for dynamic content passed on by the Nginx server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New_unicorn_corn.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
11. '''start_server.rb''' : This will restart all the installed services, after which Expertiza can start taking requests.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New start server1.png]]&lt;br /&gt;
&lt;br /&gt;
==Github link==&lt;br /&gt;
https://github.com/amurark/expertiza&lt;br /&gt;
&lt;br /&gt;
==Points for the reviewer==&lt;br /&gt;
&lt;br /&gt;
While reviewing this project, please consider the following points:&lt;br /&gt;
&lt;br /&gt;
*1. There is no scope for testing in our project. This has been discussed and approved by the mentor. &lt;br /&gt;
*2. There is no scope for UML diagrams for this project, as there are no classes/interface involved.&lt;br /&gt;
&lt;br /&gt;
==Future Scope==&lt;br /&gt;
&lt;br /&gt;
The cookbook has been created with the assumption of root user as the administer.For security purposes deployment should be done with another user with sudo privileges, and then root login disabled. Also a new user for MySQL with full database privileges needs to be created. But that hasn't been achieved automatically in the resent cookbook. Further, Unicorn configuration is done with a single Unicorn server in mind. It has to be configured for multiple servers for load balancing in events of heavy traffic. &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100598</id>
		<title>CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100598"/>
		<updated>2015-12-16T18:18:10Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: /* Chef-Solo Recipe Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction to Expertiza==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is a web application to create reusable learning objects through peer review. It supports various features such as team projects and the submission of various documents including URLs and wiki pages. It is being used extensively across various universities for select courses.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Currently, setting up the infrastructure for expertiza is done manually. The task is to write a Chef-solo&amp;lt;ref&amp;gt;[https://docs.chef.io/chef_solo.html Chef Solo]&amp;lt;/ref&amp;gt; recipe which will create a production ready environment for expertiza. Chef-solo recipes are Ruby&amp;lt;ref&amp;gt;[https://www.ruby-lang.org/en/ Ruby]&amp;lt;/ref&amp;gt; code.&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
&lt;br /&gt;
We need to provide a single step setup of expertiza for production.&lt;br /&gt;
&lt;br /&gt;
*It should include setting up the basic environment, application dependency, configuration setup and database setup.&lt;br /&gt;
*It should also include recipe for regular deployment.&lt;br /&gt;
&lt;br /&gt;
==Terminology==&lt;br /&gt;
===Chef Solo&amp;lt;ref&amp;gt;https://docs.chef.io/chef_solo.html&amp;lt;/ref&amp;gt;=== &lt;br /&gt;
Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each organization is comprised of one(or more) workstations, a single server, and every node that will be configured and maintained by the chef-client. Cookbooks (and recipes) are used to tell the chef-client how each node in your organization should be configured. The chef-client(which is installed on every node) does the actual configuration.&lt;br /&gt;
&lt;br /&gt;
*'''Node:'''&lt;br /&gt;
:A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.&lt;br /&gt;
&lt;br /&gt;
*'''Recipe: ''' &lt;br /&gt;
:A recipe specifies the resources to use and the order in which they are to be applied. It is mostly a collection of resources, defined using patterns(resource names, attribute-value pairs, and actions). A recipe       must define everything that is required to configure part of a system.&lt;br /&gt;
&lt;br /&gt;
*'''Cookbook:''' &lt;br /&gt;
:A cookbook is the fundamental unit of configuration and policy distribution. A cookbook defines a scenario and contains everything that is required to support that scenario.&lt;br /&gt;
&lt;br /&gt;
*'''WorkStation:'''&lt;br /&gt;
:A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery. &lt;br /&gt;
:The workstation is the location from which most users do most of their work.&lt;br /&gt;
:One(or more) workstations are configured to allow users to author, test, and maintain cookbooks. Cookbooks are uploaded to the Chef server from the workstation.&lt;br /&gt;
&lt;br /&gt;
*'''Chef Server:'''&lt;br /&gt;
:The Chef server acts as a hub of information. Cookbooks and policy settings are uploaded to the Chef server by users from workstations.&lt;br /&gt;
&lt;br /&gt;
*'''Chef-client:'''&lt;br /&gt;
:The chef-client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL for specific resources&lt;br /&gt;
&lt;br /&gt;
===Nginx===&lt;br /&gt;
&lt;br /&gt;
Nginx is a free, open-source, high-performance [HTTP] server and reverse proxy&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/glossary/reverse-proxy-server/]&amp;lt;/ref&amp;gt;, as well as an IMAP&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol&amp;lt;/ref&amp;gt;/POP3&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Post_Office_Protocol&amp;lt;/ref&amp;gt; proxy server. Nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/wiki/ Nginx Sever]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unicorn===&lt;br /&gt;
&lt;br /&gt;
Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.  Slow clients should only be served by placing a reverse proxy capable of fully buffering both the the request and response in between unicorn and slow clients.&lt;br /&gt;
&amp;lt;ref&amp;gt;[https://github.com/defunkt/unicorn Unicorn Web Server]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Plan of Action==&lt;br /&gt;
===Steps to Implement the Automated Deployment Process===&lt;br /&gt;
&lt;br /&gt;
[[File:Img01ExpInfra.png | frame|none|Expertiza Virtual Infrastructure]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Setup a virtual Vanilla&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Vanilla_software Vanilla]&amp;lt;/ref&amp;gt; Ubuntu&amp;lt;ref&amp;gt;[http://www.ubuntu.com Ubuntu]&amp;lt;/ref&amp;gt; Machine.&lt;br /&gt;
&lt;br /&gt;
2. Update the Ubuntu to the specified version.&lt;br /&gt;
&lt;br /&gt;
3. Clone Expertiza from Github.&lt;br /&gt;
&lt;br /&gt;
4. Install packages for Java, Ruby and all the ruby dependencies.&lt;br /&gt;
&lt;br /&gt;
5. Bundle install for installing all the gems in Gemfile.&lt;br /&gt;
&lt;br /&gt;
6. Install MYSQL&amp;lt;ref&amp;gt;[https://mysql.com Mysql server]&amp;lt;/ref&amp;gt;, configure it and migrate databases.&lt;br /&gt;
&lt;br /&gt;
7. Install Unicorn gem. Unicorn is a Rack&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Rack_%28web_server_interface%29 Rack Server]&amp;lt;/ref&amp;gt; HTTP server that uses forked processes to handle multiple incoming requests concurrently. For expertiza, unicorn is being used as the web server, which will interact with the database servers to fetch the data.&lt;br /&gt;
&lt;br /&gt;
8. Make changes in the nginx configuration.&lt;br /&gt;
&lt;br /&gt;
9. Install nginx. Nginx is a web server. It is being used in the Expertiza architecture as a reverse proxy server. Through nginx, we will also attempt to serve static pages directly.&lt;br /&gt;
&lt;br /&gt;
10. Configure Unicorn and integrate it to work with nginx.&lt;br /&gt;
&lt;br /&gt;
11. Start both Unicorn and Nginx server.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Stack==&lt;br /&gt;
&lt;br /&gt;
[[File:Exp1.png]]&lt;br /&gt;
&lt;br /&gt;
The above visually describes the expertiza stack on the virtual machine. The stack includes nginx as the front end, web server which will redirect the requests to the unicorn server. The scope of the project includes just 1 unicorn server but the recipe will be written in a way that later modifications can be made to add more than one unicorn servers under a load balancer. The unicorn server will interact with the database server and write/fetch data into it.&lt;br /&gt;
&lt;br /&gt;
==Chef-Solo Recipe Example==&lt;br /&gt;
Chef solo has cookbooks and recipes. An example of recipes is as follows:&lt;br /&gt;
    package &amp;quot;git-core&amp;quot; #apt-get install git-core&lt;br /&gt;
&lt;br /&gt;
    user node[:user][:name] do&lt;br /&gt;
        password node[:user][:password]&lt;br /&gt;
        gid &amp;quot;admin&amp;quot;&lt;br /&gt;
        home &amp;quot;/home/#{node[:user][:name]}&amp;quot;&lt;br /&gt;
        supports :manage_home =&amp;gt; true&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
This recipe orchestrates the installation of git-core and creates a new user and sets its privileges and password along with the home directory. Similarly, the plan of action is to write recipes for downloading, installing and configuring various components(nginx, unicorn, Ruby, MYSQL etc.) which will contribute towards building the infrastructure of expertiza.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Deployment==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. We first created a droplet( virtual private server) using digital ocean&amp;lt;ref&amp;gt;https://www.digitalocean.com/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Drop.png]]&lt;br /&gt;
&lt;br /&gt;
2. We recorded the IP address of the newly created droplet and created the associated &amp;lt;ipaddress&amp;gt;.json file.&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;ipaddress&amp;gt;.json''' : This file holds all the node specific values required to install services and config node.&lt;br /&gt;
We will set node_user , user_hash_password , ruby version , mysql root &amp;amp; password . The main function apart from holding node variables is to run recipes in a specific code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New_ip.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following recipes(.rb files), scripts and node specific files were created to achieve automatic deployment. Other pre-installed files and folder for Chef cookbook can be found in the git repository mentioned above.&lt;br /&gt;
&lt;br /&gt;
3. We then run the bash command in following format&amp;lt;code&amp;gt;sh setup_vps.sh &amp;lt;node_username&amp;gt; &amp;lt;node_ip_address&amp;gt; &amp;lt;node_port&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command will run the knife tool that will setup Chef-solo on the node and will execute the recipes.&lt;br /&gt;
This needs to be run from the directory where '''setup_vps.sh''' is present.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New setup vps.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. '''default.rb''' : This recipe will update the Ubuntu machine packages, install the list of prerequisite packages and set the time zone.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New default.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. '''expertiza_clone''' : This recipe will create a directory and clone the Expertiza git source code into that directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New expertiza clone.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. '''set_java_home''': This recipe will set the Java configuration. It will then bundle instal all the gems used by the Expertiza.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New_set_java.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. '''mysql.rb''' : This recipe will install the MySQL server , MySQL client and its associated dependencies. The root password is preloaded and then fetched on installation by setting DEBIAN_FRONTEND environment variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New sql.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. '''database.rb''' : This recipe will execute scrubbed.sql on MySQL, which in turn will create all the Schema for production, development and test environments. It will also populate the database tables with seed (configuration) data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New database.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. '''nginx.rb''' : This recipe will install nginx which is a web proxy server that will listen on user defined port and redirect the requests for static content(images, css, javascript) to the public folder of Expertiza rails app.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New_nginx.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. '''unicorn_conf.rb''' : This recipe will install and configure Unicorn web server used in production environment to handle requests for dynamic content passed on by the Nginx server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New_unicorn_corn.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
11. '''start_server.rb''' : This will restart all the installed services, after which Expertiza can start taking requests.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New start server1.png]]&lt;br /&gt;
&lt;br /&gt;
==Github link==&lt;br /&gt;
https://github.com/amurark/expertiza&lt;br /&gt;
&lt;br /&gt;
==Points for the reviewer==&lt;br /&gt;
&lt;br /&gt;
While reviewing this project, please consider the following points:&lt;br /&gt;
&lt;br /&gt;
*1. There is no scope for testing in our project. This has been discussed and approved by the mentor. &lt;br /&gt;
*2. There is no scope for UML diagrams for this project, as there are no classes/interface involved.&lt;br /&gt;
&lt;br /&gt;
==Future Scope==&lt;br /&gt;
&lt;br /&gt;
The cookbook has been created with the assumption of root user as the administer.For security purposes deployment should be done with another user with sudo privileges, and then root login disabled. Also a new user for MySQL with full database privileges needs to be created. But that hasn't been achieved automatically in the resent cookbook. Further, Unicorn configuration is done with a single Unicorn server in mind. It has to be configured for multiple servers for load balancing in events of heavy traffic. &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100596</id>
		<title>CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100596"/>
		<updated>2015-12-16T18:12:04Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: /* Expertiza Deployment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction to Expertiza==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is a web application to create reusable learning objects through peer review. It supports various features such as team projects and the submission of various documents including URLs and wiki pages. It is being used extensively across various universities for select courses.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Currently, setting up the infrastructure for expertiza is done manually. The task is to write a Chef-solo&amp;lt;ref&amp;gt;[https://docs.chef.io/chef_solo.html Chef Solo]&amp;lt;/ref&amp;gt; recipe which will create a production ready environment for expertiza. Chef-solo recipes are Ruby&amp;lt;ref&amp;gt;[https://www.ruby-lang.org/en/ Ruby]&amp;lt;/ref&amp;gt; code.&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
&lt;br /&gt;
We need to provide a single step setup of expertiza for production.&lt;br /&gt;
&lt;br /&gt;
*It should include setting up the basic environment, application dependency, configuration setup and database setup.&lt;br /&gt;
*It should also include recipe for regular deployment.&lt;br /&gt;
&lt;br /&gt;
==Terminology==&lt;br /&gt;
===Chef Solo&amp;lt;ref&amp;gt;https://docs.chef.io/chef_solo.html&amp;lt;/ref&amp;gt;=== &lt;br /&gt;
Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each organization is comprised of one(or more) workstations, a single server, and every node that will be configured and maintained by the chef-client. Cookbooks (and recipes) are used to tell the chef-client how each node in your organization should be configured. The chef-client(which is installed on every node) does the actual configuration.&lt;br /&gt;
&lt;br /&gt;
*'''Node:'''&lt;br /&gt;
:A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.&lt;br /&gt;
&lt;br /&gt;
*'''Recipe: ''' &lt;br /&gt;
:A recipe specifies the resources to use and the order in which they are to be applied. It is mostly a collection of resources, defined using patterns(resource names, attribute-value pairs, and actions). A recipe       must define everything that is required to configure part of a system.&lt;br /&gt;
&lt;br /&gt;
*'''Cookbook:''' &lt;br /&gt;
:A cookbook is the fundamental unit of configuration and policy distribution. A cookbook defines a scenario and contains everything that is required to support that scenario.&lt;br /&gt;
&lt;br /&gt;
*'''WorkStation:'''&lt;br /&gt;
:A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery. &lt;br /&gt;
:The workstation is the location from which most users do most of their work.&lt;br /&gt;
:One(or more) workstations are configured to allow users to author, test, and maintain cookbooks. Cookbooks are uploaded to the Chef server from the workstation.&lt;br /&gt;
&lt;br /&gt;
*'''Chef Server:'''&lt;br /&gt;
:The Chef server acts as a hub of information. Cookbooks and policy settings are uploaded to the Chef server by users from workstations.&lt;br /&gt;
&lt;br /&gt;
*'''Chef-client:'''&lt;br /&gt;
:The chef-client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL for specific resources&lt;br /&gt;
&lt;br /&gt;
===Nginx===&lt;br /&gt;
&lt;br /&gt;
Nginx is a free, open-source, high-performance [HTTP] server and reverse proxy&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/glossary/reverse-proxy-server/]&amp;lt;/ref&amp;gt;, as well as an IMAP&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol&amp;lt;/ref&amp;gt;/POP3&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Post_Office_Protocol&amp;lt;/ref&amp;gt; proxy server. Nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/wiki/ Nginx Sever]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unicorn===&lt;br /&gt;
&lt;br /&gt;
Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.  Slow clients should only be served by placing a reverse proxy capable of fully buffering both the the request and response in between unicorn and slow clients.&lt;br /&gt;
&amp;lt;ref&amp;gt;[https://github.com/defunkt/unicorn Unicorn Web Server]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Plan of Action==&lt;br /&gt;
===Steps to Implement the Automated Deployment Process===&lt;br /&gt;
&lt;br /&gt;
[[File:Img01ExpInfra.png | frame|none|Expertiza Virtual Infrastructure]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Setup a virtual Vanilla&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Vanilla_software Vanilla]&amp;lt;/ref&amp;gt; Ubuntu&amp;lt;ref&amp;gt;[http://www.ubuntu.com Ubuntu]&amp;lt;/ref&amp;gt; Machine.&lt;br /&gt;
&lt;br /&gt;
2. Update the Ubuntu to the specified version.&lt;br /&gt;
&lt;br /&gt;
3. Clone Expertiza from Github.&lt;br /&gt;
&lt;br /&gt;
4. Install packages for Java, Ruby and all the ruby dependencies.&lt;br /&gt;
&lt;br /&gt;
5. Bundle install for installing all the gems in Gemfile.&lt;br /&gt;
&lt;br /&gt;
6. Install MYSQL&amp;lt;ref&amp;gt;[https://mysql.com Mysql server]&amp;lt;/ref&amp;gt;, configure it and migrate databases.&lt;br /&gt;
&lt;br /&gt;
7. Install Unicorn gem. Unicorn is a Rack&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Rack_%28web_server_interface%29 Rack Server]&amp;lt;/ref&amp;gt; HTTP server that uses forked processes to handle multiple incoming requests concurrently. For expertiza, unicorn is being used as the web server, which will interact with the database servers to fetch the data.&lt;br /&gt;
&lt;br /&gt;
8. Make changes in the nginx configuration.&lt;br /&gt;
&lt;br /&gt;
9. Install nginx. Nginx is a web server. It is being used in the Expertiza architecture as a reverse proxy server. Through nginx, we will also attempt to serve static pages directly.&lt;br /&gt;
&lt;br /&gt;
10. Configure Unicorn and integrate it to work with nginx.&lt;br /&gt;
&lt;br /&gt;
11. Start both Unicorn and Nginx server.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Stack==&lt;br /&gt;
&lt;br /&gt;
[[File:Exp1.png]]&lt;br /&gt;
&lt;br /&gt;
The above visually describes the expertiza stack on the virtual machine. The stack includes nginx as the front end, web server which will redirect the requests to the unicorn server. The scope of the project includes just 1 unicorn server but the recipe will be written in a way that later modifications can be made to add more than one unicorn servers under a load balancer. The unicorn server will interact with the database server and write/fetch data into it.&lt;br /&gt;
&lt;br /&gt;
==Chef-Solo Recipe Example==&lt;br /&gt;
Chef solo has cookbooks and recipes. An example of recipes is as follows:&lt;br /&gt;
    package &amp;quot;git-core&amp;quot; #apt-get install git-core&lt;br /&gt;
&lt;br /&gt;
    user node[:user][:name] do&lt;br /&gt;
        password node[:user][:password]&lt;br /&gt;
        gid &amp;quot;admin&amp;quot;&lt;br /&gt;
        home &amp;quot;/home/#{node[:user][:name]}&amp;quot;&lt;br /&gt;
        supports :manage_home =&amp;gt; true&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
This recipe orchestrates the installation of git-core and creates a new user and sets its privileges and password along with the home directory. Similarly, the plan of action is to write recipes for downloading, installing and configuring various components(nginx, unicorn, RMV, Ruby, MYSQL etc.) which will contribute towards building the infrastructure of expertiza.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Deployment==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. We first created a droplet( virtual private server) using digital ocean&amp;lt;ref&amp;gt;https://www.digitalocean.com/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Drop.png]]&lt;br /&gt;
&lt;br /&gt;
2. We recorded the IP address of the newly created droplet and created the associated &amp;lt;ipaddress&amp;gt;.json file.&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;ipaddress&amp;gt;.json''' : This file holds all the node specific values required to install services and config node.&lt;br /&gt;
We will set node_user , user_hash_password , ruby version , mysql root &amp;amp; password . The main function apart from holding node variables is to run recipes in a specific code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New_ip.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following recipes(.rb files), scripts and node specific files were created to achieve automatic deployment. Other pre-installed files and folder for Chef cookbook can be found in the git repository mentioned above.&lt;br /&gt;
&lt;br /&gt;
3. We then run the bash command in following format&amp;lt;code&amp;gt;sh setup_vps.sh &amp;lt;node_username&amp;gt; &amp;lt;node_ip_address&amp;gt; &amp;lt;node_port&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command will run the knife tool that will setup Chef-solo on the node and will execute the recipes.&lt;br /&gt;
This needs to be run from the directory where '''setup_vps.sh''' is present.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New setup vps.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. '''default.rb''' : This recipe will update the Ubuntu machine packages, install the list of prerequisite packages and set the time zone.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New default.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. '''expertiza_clone''' : This recipe will create a directory and clone the Expertiza git source code into that directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New expertiza clone.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. '''set_java_home''': This recipe will set the Java configuration. It will then bundle instal all the gems used by the Expertiza.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New_set_java.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. '''mysql.rb''' : This recipe will install the MySQL server , MySQL client and its associated dependencies. The root password is preloaded and then fetched on installation by setting DEBIAN_FRONTEND environment variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New sql.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. '''database.rb''' : This recipe will execute scrubbed.sql on MySQL, which in turn will create all the Schema for production, development and test environments. It will also populate the database tables with seed (configuration) data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New database.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. '''nginx.rb''' : This recipe will install nginx which is a web proxy server that will listen on user defined port and redirect the requests for static content(images, css, javascript) to the public folder of Expertiza rails app.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New_nginx.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. '''unicorn_conf.rb''' : This recipe will install and configure Unicorn web server used in production environment to handle high traffic and achieve load balancing . All the requests for dynamic content will go through it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New_unicorn_corn.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
11. '''start_server.rb''' : This will restart all the installed services, after which Expertiza can start taking requests.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New start server1.png]]&lt;br /&gt;
&lt;br /&gt;
==Github link==&lt;br /&gt;
https://github.com/amurark/expertiza&lt;br /&gt;
&lt;br /&gt;
==Points for the reviewer==&lt;br /&gt;
&lt;br /&gt;
While reviewing this project, please consider the following points:&lt;br /&gt;
&lt;br /&gt;
*1. There is no scope for testing in our project. This has been discussed and approved by the mentor. &lt;br /&gt;
*2. There is no scope for UML diagrams for this project, as there are no classes/interface involved.&lt;br /&gt;
&lt;br /&gt;
==Future Scope==&lt;br /&gt;
&lt;br /&gt;
The cookbook has been created with the assumption of root user as the administer.For security purposes deployment should be done with another user with sudo privileges, and then root login disabled. Also a new user for MySQL with full database privileges needs to be created. But that hasn't been achieved automatically in the resent cookbook. Further, Unicorn configuration is done with a single Unicorn server in mind. It has to be configured for multiple servers for load balancing in events of heavy traffic. &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100595</id>
		<title>CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100595"/>
		<updated>2015-12-16T18:10:47Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: /* Expertiza Stack */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction to Expertiza==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is a web application to create reusable learning objects through peer review. It supports various features such as team projects and the submission of various documents including URLs and wiki pages. It is being used extensively across various universities for select courses.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Currently, setting up the infrastructure for expertiza is done manually. The task is to write a Chef-solo&amp;lt;ref&amp;gt;[https://docs.chef.io/chef_solo.html Chef Solo]&amp;lt;/ref&amp;gt; recipe which will create a production ready environment for expertiza. Chef-solo recipes are Ruby&amp;lt;ref&amp;gt;[https://www.ruby-lang.org/en/ Ruby]&amp;lt;/ref&amp;gt; code.&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
&lt;br /&gt;
We need to provide a single step setup of expertiza for production.&lt;br /&gt;
&lt;br /&gt;
*It should include setting up the basic environment, application dependency, configuration setup and database setup.&lt;br /&gt;
*It should also include recipe for regular deployment.&lt;br /&gt;
&lt;br /&gt;
==Terminology==&lt;br /&gt;
===Chef Solo&amp;lt;ref&amp;gt;https://docs.chef.io/chef_solo.html&amp;lt;/ref&amp;gt;=== &lt;br /&gt;
Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each organization is comprised of one(or more) workstations, a single server, and every node that will be configured and maintained by the chef-client. Cookbooks (and recipes) are used to tell the chef-client how each node in your organization should be configured. The chef-client(which is installed on every node) does the actual configuration.&lt;br /&gt;
&lt;br /&gt;
*'''Node:'''&lt;br /&gt;
:A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.&lt;br /&gt;
&lt;br /&gt;
*'''Recipe: ''' &lt;br /&gt;
:A recipe specifies the resources to use and the order in which they are to be applied. It is mostly a collection of resources, defined using patterns(resource names, attribute-value pairs, and actions). A recipe       must define everything that is required to configure part of a system.&lt;br /&gt;
&lt;br /&gt;
*'''Cookbook:''' &lt;br /&gt;
:A cookbook is the fundamental unit of configuration and policy distribution. A cookbook defines a scenario and contains everything that is required to support that scenario.&lt;br /&gt;
&lt;br /&gt;
*'''WorkStation:'''&lt;br /&gt;
:A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery. &lt;br /&gt;
:The workstation is the location from which most users do most of their work.&lt;br /&gt;
:One(or more) workstations are configured to allow users to author, test, and maintain cookbooks. Cookbooks are uploaded to the Chef server from the workstation.&lt;br /&gt;
&lt;br /&gt;
*'''Chef Server:'''&lt;br /&gt;
:The Chef server acts as a hub of information. Cookbooks and policy settings are uploaded to the Chef server by users from workstations.&lt;br /&gt;
&lt;br /&gt;
*'''Chef-client:'''&lt;br /&gt;
:The chef-client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL for specific resources&lt;br /&gt;
&lt;br /&gt;
===Nginx===&lt;br /&gt;
&lt;br /&gt;
Nginx is a free, open-source, high-performance [HTTP] server and reverse proxy&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/glossary/reverse-proxy-server/]&amp;lt;/ref&amp;gt;, as well as an IMAP&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol&amp;lt;/ref&amp;gt;/POP3&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Post_Office_Protocol&amp;lt;/ref&amp;gt; proxy server. Nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/wiki/ Nginx Sever]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unicorn===&lt;br /&gt;
&lt;br /&gt;
Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.  Slow clients should only be served by placing a reverse proxy capable of fully buffering both the the request and response in between unicorn and slow clients.&lt;br /&gt;
&amp;lt;ref&amp;gt;[https://github.com/defunkt/unicorn Unicorn Web Server]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Plan of Action==&lt;br /&gt;
===Steps to Implement the Automated Deployment Process===&lt;br /&gt;
&lt;br /&gt;
[[File:Img01ExpInfra.png | frame|none|Expertiza Virtual Infrastructure]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Setup a virtual Vanilla&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Vanilla_software Vanilla]&amp;lt;/ref&amp;gt; Ubuntu&amp;lt;ref&amp;gt;[http://www.ubuntu.com Ubuntu]&amp;lt;/ref&amp;gt; Machine.&lt;br /&gt;
&lt;br /&gt;
2. Update the Ubuntu to the specified version.&lt;br /&gt;
&lt;br /&gt;
3. Clone Expertiza from Github.&lt;br /&gt;
&lt;br /&gt;
4. Install packages for Java, Ruby and all the ruby dependencies.&lt;br /&gt;
&lt;br /&gt;
5. Bundle install for installing all the gems in Gemfile.&lt;br /&gt;
&lt;br /&gt;
6. Install MYSQL&amp;lt;ref&amp;gt;[https://mysql.com Mysql server]&amp;lt;/ref&amp;gt;, configure it and migrate databases.&lt;br /&gt;
&lt;br /&gt;
7. Install Unicorn gem. Unicorn is a Rack&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Rack_%28web_server_interface%29 Rack Server]&amp;lt;/ref&amp;gt; HTTP server that uses forked processes to handle multiple incoming requests concurrently. For expertiza, unicorn is being used as the web server, which will interact with the database servers to fetch the data.&lt;br /&gt;
&lt;br /&gt;
8. Make changes in the nginx configuration.&lt;br /&gt;
&lt;br /&gt;
9. Install nginx. Nginx is a web server. It is being used in the Expertiza architecture as a reverse proxy server. Through nginx, we will also attempt to serve static pages directly.&lt;br /&gt;
&lt;br /&gt;
10. Configure Unicorn and integrate it to work with nginx.&lt;br /&gt;
&lt;br /&gt;
11. Start both Unicorn and Nginx server.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Stack==&lt;br /&gt;
&lt;br /&gt;
[[File:Exp1.png]]&lt;br /&gt;
&lt;br /&gt;
The above visually describes the expertiza stack on the virtual machine. The stack includes nginx as the front end, web server which will redirect the requests to the unicorn server. The scope of the project includes just 1 unicorn server but the recipe will be written in a way that later modifications can be made to add more than one unicorn servers under a load balancer. The unicorn server will interact with the database server and write/fetch data into it.&lt;br /&gt;
&lt;br /&gt;
==Chef-Solo Recipe Example==&lt;br /&gt;
Chef solo has cookbooks and recipes. An example of recipes is as follows:&lt;br /&gt;
    package &amp;quot;git-core&amp;quot; #apt-get install git-core&lt;br /&gt;
&lt;br /&gt;
    user node[:user][:name] do&lt;br /&gt;
        password node[:user][:password]&lt;br /&gt;
        gid &amp;quot;admin&amp;quot;&lt;br /&gt;
        home &amp;quot;/home/#{node[:user][:name]}&amp;quot;&lt;br /&gt;
        supports :manage_home =&amp;gt; true&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
This recipe orchestrates the installation of git-core and creates a new user and sets its privileges and password along with the home directory. Similarly, the plan of action is to write recipes for downloading, installing and configuring various components(nginx, unicorn, RMV, Ruby, MYSQL etc.) which will contribute towards building the infrastructure of expertiza.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Deployment==&lt;br /&gt;
&lt;br /&gt;
1. We first created a droplet( virtual private server) using digital ocean&amp;lt;ref&amp;gt;https://www.digitalocean.com/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Drop.png]]&lt;br /&gt;
&lt;br /&gt;
2. We recorded the IP address of the newly created droplet and created the associated &amp;lt;ipaddress&amp;gt;.json file.&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;ipaddress&amp;gt;.json''' : This file holds all the node specific values required to install services and config node.&lt;br /&gt;
We will set node_user , user_hash_password , ruby version , mysql root &amp;amp; password . The main function apart from holding node variables is to run recipes in a specific code.&lt;br /&gt;
&lt;br /&gt;
[[File:New_ip.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following recipes(.rb files), scripts and node specific files were created to achieve automatic deployment. Other pre-installed files and folder for Chef cookbook can be found in the git repository mentioned above.&lt;br /&gt;
&lt;br /&gt;
3. We then run the bash command in following format&amp;lt;code&amp;gt;sh setup_vps.sh &amp;lt;node_username&amp;gt; &amp;lt;node_ip_address&amp;gt; &amp;lt;node_port&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command will run the knife tool that will setup Chef-solo on the node and will execute the recipes.&lt;br /&gt;
This needs to be run from the directory where '''setup_vps.sh''' is present.&lt;br /&gt;
&lt;br /&gt;
[[File:New setup vps.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. '''default.rb''' : This recipe will update the Ubuntu machine packages, install the list of prerequisite packages and set the time zone.&lt;br /&gt;
&lt;br /&gt;
[[File:New default.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. '''expertiza_clone''' : This recipe will create a directory and clone the Expertiza git source code into that directory.&lt;br /&gt;
&lt;br /&gt;
[[File:New expertiza clone.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. '''set_java_home''': This recipe will set the Java configuration. It will then bundle instal all the gems used by the Expertiza.&lt;br /&gt;
&lt;br /&gt;
[[File:New_set_java.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. '''mysql.rb''' : This recipe will install the MySQL server , MySQL client and its associated dependencies. The root password is preloaded and then fetched on installation by setting DEBIAN_FRONTEND environment variable.&lt;br /&gt;
&lt;br /&gt;
[[File:New sql.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. '''database.rb''' : This recipe will execute scrubbed.sql on MySQL, which in turn will create all the Schema for production, development and test environments. It will also populate the database tables with seed (configuration) data.&lt;br /&gt;
&lt;br /&gt;
[[File:New database.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. '''nginx.rb''' : This recipe will install nginx which is a web proxy server that will listen on user defined port and redirect the requests for static content(images, css, javascript) to the public folder of Expertiza rails app.&lt;br /&gt;
&lt;br /&gt;
[[File:New_nginx.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. '''unicorn_conf.rb''' : This recipe will install and configure Unicorn web server used in production environment to handle high traffic and achieve load balancing . All the requests for dynamic content will go through it.&lt;br /&gt;
&lt;br /&gt;
[[File:New_unicorn_corn.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
11. '''start_server.rb''' : This will restart all the installed services, after which Expertiza can start taking requests.&lt;br /&gt;
&lt;br /&gt;
[[File:New start server1.png]]&lt;br /&gt;
&lt;br /&gt;
==Github link==&lt;br /&gt;
https://github.com/amurark/expertiza&lt;br /&gt;
&lt;br /&gt;
==Points for the reviewer==&lt;br /&gt;
&lt;br /&gt;
While reviewing this project, please consider the following points:&lt;br /&gt;
&lt;br /&gt;
*1. There is no scope for testing in our project. This has been discussed and approved by the mentor. &lt;br /&gt;
*2. There is no scope for UML diagrams for this project, as there are no classes/interface involved.&lt;br /&gt;
&lt;br /&gt;
==Future Scope==&lt;br /&gt;
&lt;br /&gt;
The cookbook has been created with the assumption of root user as the administer.For security purposes deployment should be done with another user with sudo privileges, and then root login disabled. Also a new user for MySQL with full database privileges needs to be created. But that hasn't been achieved automatically in the resent cookbook. Further, Unicorn configuration is done with a single Unicorn server in mind. It has to be configured for multiple servers for load balancing in events of heavy traffic. &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100594</id>
		<title>CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100594"/>
		<updated>2015-12-16T18:05:55Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: /* Expertiza Deployment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction to Expertiza==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is a web application to create reusable learning objects through peer review. It supports various features such as team projects and the submission of various documents including URLs and wiki pages. It is being used extensively across various universities for select courses.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Currently, setting up the infrastructure for expertiza is done manually. The task is to write a Chef-solo&amp;lt;ref&amp;gt;[https://docs.chef.io/chef_solo.html Chef Solo]&amp;lt;/ref&amp;gt; recipe which will create a production ready environment for expertiza. Chef-solo recipes are Ruby&amp;lt;ref&amp;gt;[https://www.ruby-lang.org/en/ Ruby]&amp;lt;/ref&amp;gt; code.&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
&lt;br /&gt;
We need to provide a single step setup of expertiza for production.&lt;br /&gt;
&lt;br /&gt;
*It should include setting up the basic environment, application dependency, configuration setup and database setup.&lt;br /&gt;
*It should also include recipe for regular deployment.&lt;br /&gt;
&lt;br /&gt;
==Terminology==&lt;br /&gt;
===Chef Solo&amp;lt;ref&amp;gt;https://docs.chef.io/chef_solo.html&amp;lt;/ref&amp;gt;=== &lt;br /&gt;
Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each organization is comprised of one(or more) workstations, a single server, and every node that will be configured and maintained by the chef-client. Cookbooks (and recipes) are used to tell the chef-client how each node in your organization should be configured. The chef-client(which is installed on every node) does the actual configuration.&lt;br /&gt;
&lt;br /&gt;
*'''Node:'''&lt;br /&gt;
:A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.&lt;br /&gt;
&lt;br /&gt;
*'''Recipe: ''' &lt;br /&gt;
:A recipe specifies the resources to use and the order in which they are to be applied. It is mostly a collection of resources, defined using patterns(resource names, attribute-value pairs, and actions). A recipe       must define everything that is required to configure part of a system.&lt;br /&gt;
&lt;br /&gt;
*'''Cookbook:''' &lt;br /&gt;
:A cookbook is the fundamental unit of configuration and policy distribution. A cookbook defines a scenario and contains everything that is required to support that scenario.&lt;br /&gt;
&lt;br /&gt;
*'''WorkStation:'''&lt;br /&gt;
:A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery. &lt;br /&gt;
:The workstation is the location from which most users do most of their work.&lt;br /&gt;
:One(or more) workstations are configured to allow users to author, test, and maintain cookbooks. Cookbooks are uploaded to the Chef server from the workstation.&lt;br /&gt;
&lt;br /&gt;
*'''Chef Server:'''&lt;br /&gt;
:The Chef server acts as a hub of information. Cookbooks and policy settings are uploaded to the Chef server by users from workstations.&lt;br /&gt;
&lt;br /&gt;
*'''Chef-client:'''&lt;br /&gt;
:The chef-client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL for specific resources&lt;br /&gt;
&lt;br /&gt;
===Nginx===&lt;br /&gt;
&lt;br /&gt;
Nginx is a free, open-source, high-performance [HTTP] server and reverse proxy&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/glossary/reverse-proxy-server/]&amp;lt;/ref&amp;gt;, as well as an IMAP&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol&amp;lt;/ref&amp;gt;/POP3&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Post_Office_Protocol&amp;lt;/ref&amp;gt; proxy server. Nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/wiki/ Nginx Sever]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unicorn===&lt;br /&gt;
&lt;br /&gt;
Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.  Slow clients should only be served by placing a reverse proxy capable of fully buffering both the the request and response in between unicorn and slow clients.&lt;br /&gt;
&amp;lt;ref&amp;gt;[https://github.com/defunkt/unicorn Unicorn Web Server]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Plan of Action==&lt;br /&gt;
===Steps to Implement the Automated Deployment Process===&lt;br /&gt;
&lt;br /&gt;
[[File:Img01ExpInfra.png | frame|none|Expertiza Virtual Infrastructure]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Setup a virtual Vanilla&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Vanilla_software Vanilla]&amp;lt;/ref&amp;gt; Ubuntu&amp;lt;ref&amp;gt;[http://www.ubuntu.com Ubuntu]&amp;lt;/ref&amp;gt; Machine.&lt;br /&gt;
&lt;br /&gt;
2. Update the Ubuntu to the specified version.&lt;br /&gt;
&lt;br /&gt;
3. Clone Expertiza from Github.&lt;br /&gt;
&lt;br /&gt;
4. Install packages for Java, Ruby and all the ruby dependencies.&lt;br /&gt;
&lt;br /&gt;
5. Bundle install for installing all the gems in Gemfile.&lt;br /&gt;
&lt;br /&gt;
6. Install MYSQL&amp;lt;ref&amp;gt;[https://mysql.com Mysql server]&amp;lt;/ref&amp;gt;, configure it and migrate databases.&lt;br /&gt;
&lt;br /&gt;
7. Install Unicorn gem. Unicorn is a Rack&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Rack_%28web_server_interface%29 Rack Server]&amp;lt;/ref&amp;gt; HTTP server that uses forked processes to handle multiple incoming requests concurrently. For expertiza, unicorn is being used as the web server, which will interact with the database servers to fetch the data.&lt;br /&gt;
&lt;br /&gt;
8. Make changes in the nginx configuration.&lt;br /&gt;
&lt;br /&gt;
9. Install nginx. Nginx is a web server. It is being used in the Expertiza architecture as a reverse proxy server. Through nginx, we will also attempt to serve static pages directly.&lt;br /&gt;
&lt;br /&gt;
10. Configure Unicorn and integrate it to work with nginx.&lt;br /&gt;
&lt;br /&gt;
11. Start both Unicorn and Nginx server.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Stack==&lt;br /&gt;
&lt;br /&gt;
[[File:Exp1.png]]&lt;br /&gt;
&lt;br /&gt;
The above visually describes the expertiza stack on the virtual machine. The stack includes nginx as the front end, web server which will redirect the requests to the unicorn server. The scope of the project includes just 1 unicorn server but the recipe will be written in a way that later modifications can be made to add more than 1 unicorn servers under a load balancer. The unicorn server will interact with the database server and write/fetch data into it.&lt;br /&gt;
&lt;br /&gt;
==Chef-Solo Recipe Example==&lt;br /&gt;
Chef solo has cookbooks and recipes. An example of recipes is as follows:&lt;br /&gt;
    package &amp;quot;git-core&amp;quot; #apt-get install git-core&lt;br /&gt;
&lt;br /&gt;
    user node[:user][:name] do&lt;br /&gt;
        password node[:user][:password]&lt;br /&gt;
        gid &amp;quot;admin&amp;quot;&lt;br /&gt;
        home &amp;quot;/home/#{node[:user][:name]}&amp;quot;&lt;br /&gt;
        supports :manage_home =&amp;gt; true&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
This recipe orchestrates the installation of git-core and creates a new user and sets its privileges and password along with the home directory. Similarly, the plan of action is to write recipes for downloading, installing and configuring various components(nginx, unicorn, RMV, Ruby, MYSQL etc.) which will contribute towards building the infrastructure of expertiza.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Deployment==&lt;br /&gt;
&lt;br /&gt;
1. We first created a droplet( virtual private server) using digital ocean&amp;lt;ref&amp;gt;https://www.digitalocean.com/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Drop.png]]&lt;br /&gt;
&lt;br /&gt;
2. We recorded the IP address of the newly created droplet and created the associated &amp;lt;ipaddress&amp;gt;.json file.&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;ipaddress&amp;gt;.json''' : This file holds all the node specific values required to install services and config node.&lt;br /&gt;
We will set node_user , user_hash_password , ruby version , mysql root &amp;amp; password . The main function apart from holding node variables is to run recipes in a specific code.&lt;br /&gt;
&lt;br /&gt;
[[File:New_ip.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following recipes(.rb files), scripts and node specific files were created to achieve automatic deployment. Other pre-installed files and folder for Chef cookbook can be found in the git repository mentioned above.&lt;br /&gt;
&lt;br /&gt;
3. We then run the bash command in following format&amp;lt;code&amp;gt;sh setup_vps.sh &amp;lt;node_username&amp;gt; &amp;lt;node_ip_address&amp;gt; &amp;lt;node_port&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command will run the knife tool that will setup Chef-solo on the node and will execute the recipes.&lt;br /&gt;
This needs to be run from the directory where '''setup_vps.sh''' is present.&lt;br /&gt;
&lt;br /&gt;
[[File:New setup vps.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. '''default.rb''' : This recipe will update the Ubuntu machine packages, install the list of prerequisite packages and set the time zone.&lt;br /&gt;
&lt;br /&gt;
[[File:New default.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. '''expertiza_clone''' : This recipe will create a directory and clone the Expertiza git source code into that directory.&lt;br /&gt;
&lt;br /&gt;
[[File:New expertiza clone.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. '''set_java_home''': This recipe will set the Java configuration. It will then bundle instal all the gems used by the Expertiza.&lt;br /&gt;
&lt;br /&gt;
[[File:New_set_java.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. '''mysql.rb''' : This recipe will install the MySQL server , MySQL client and its associated dependencies. The root password is preloaded and then fetched on installation by setting DEBIAN_FRONTEND environment variable.&lt;br /&gt;
&lt;br /&gt;
[[File:New sql.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. '''database.rb''' : This recipe will execute scrubbed.sql on MySQL, which in turn will create all the Schema for production, development and test environments. It will also populate the database tables with seed (configuration) data.&lt;br /&gt;
&lt;br /&gt;
[[File:New database.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. '''nginx.rb''' : This recipe will install nginx which is a web proxy server that will listen on user defined port and redirect the requests for static content(images, css, javascript) to the public folder of Expertiza rails app.&lt;br /&gt;
&lt;br /&gt;
[[File:New_nginx.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. '''unicorn_conf.rb''' : This recipe will install and configure Unicorn web server used in production environment to handle high traffic and achieve load balancing . All the requests for dynamic content will go through it.&lt;br /&gt;
&lt;br /&gt;
[[File:New_unicorn_corn.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
11. '''start_server.rb''' : This will restart all the installed services, after which Expertiza can start taking requests.&lt;br /&gt;
&lt;br /&gt;
[[File:New start server1.png]]&lt;br /&gt;
&lt;br /&gt;
==Github link==&lt;br /&gt;
https://github.com/amurark/expertiza&lt;br /&gt;
&lt;br /&gt;
==Points for the reviewer==&lt;br /&gt;
&lt;br /&gt;
While reviewing this project, please consider the following points:&lt;br /&gt;
&lt;br /&gt;
*1. There is no scope for testing in our project. This has been discussed and approved by the mentor. &lt;br /&gt;
*2. There is no scope for UML diagrams for this project, as there are no classes/interface involved.&lt;br /&gt;
&lt;br /&gt;
==Future Scope==&lt;br /&gt;
&lt;br /&gt;
The cookbook has been created with the assumption of root user as the administer.For security purposes deployment should be done with another user with sudo privileges, and then root login disabled. Also a new user for MySQL with full database privileges needs to be created. But that hasn't been achieved automatically in the resent cookbook. Further, Unicorn configuration is done with a single Unicorn server in mind. It has to be configured for multiple servers for load balancing in events of heavy traffic. &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100593</id>
		<title>CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100593"/>
		<updated>2015-12-16T17:54:11Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: /* Expertiza Deployment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction to Expertiza==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is a web application to create reusable learning objects through peer review. It supports various features such as team projects and the submission of various documents including URLs and wiki pages. It is being used extensively across various universities for select courses.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Currently, setting up the infrastructure for expertiza is done manually. The task is to write a Chef-solo&amp;lt;ref&amp;gt;[https://docs.chef.io/chef_solo.html Chef Solo]&amp;lt;/ref&amp;gt; recipe which will create a production ready environment for expertiza. Chef-solo recipes are Ruby&amp;lt;ref&amp;gt;[https://www.ruby-lang.org/en/ Ruby]&amp;lt;/ref&amp;gt; code.&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
&lt;br /&gt;
We need to provide a single step setup of expertiza for production.&lt;br /&gt;
&lt;br /&gt;
*It should include setting up the basic environment, application dependency, configuration setup and database setup.&lt;br /&gt;
*It should also include recipe for regular deployment.&lt;br /&gt;
&lt;br /&gt;
==Terminology==&lt;br /&gt;
===Chef Solo&amp;lt;ref&amp;gt;https://docs.chef.io/chef_solo.html&amp;lt;/ref&amp;gt;=== &lt;br /&gt;
Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each organization is comprised of one(or more) workstations, a single server, and every node that will be configured and maintained by the chef-client. Cookbooks (and recipes) are used to tell the chef-client how each node in your organization should be configured. The chef-client(which is installed on every node) does the actual configuration.&lt;br /&gt;
&lt;br /&gt;
*'''Node:'''&lt;br /&gt;
:A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.&lt;br /&gt;
&lt;br /&gt;
*'''Recipe: ''' &lt;br /&gt;
:A recipe specifies the resources to use and the order in which they are to be applied. It is mostly a collection of resources, defined using patterns(resource names, attribute-value pairs, and actions). A recipe       must define everything that is required to configure part of a system.&lt;br /&gt;
&lt;br /&gt;
*'''Cookbook:''' &lt;br /&gt;
:A cookbook is the fundamental unit of configuration and policy distribution. A cookbook defines a scenario and contains everything that is required to support that scenario.&lt;br /&gt;
&lt;br /&gt;
*'''WorkStation:'''&lt;br /&gt;
:A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery. &lt;br /&gt;
:The workstation is the location from which most users do most of their work.&lt;br /&gt;
:One(or more) workstations are configured to allow users to author, test, and maintain cookbooks. Cookbooks are uploaded to the Chef server from the workstation.&lt;br /&gt;
&lt;br /&gt;
*'''Chef Server:'''&lt;br /&gt;
:The Chef server acts as a hub of information. Cookbooks and policy settings are uploaded to the Chef server by users from workstations.&lt;br /&gt;
&lt;br /&gt;
*'''Chef-client:'''&lt;br /&gt;
:The chef-client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL for specific resources&lt;br /&gt;
&lt;br /&gt;
===Nginx===&lt;br /&gt;
&lt;br /&gt;
Nginx is a free, open-source, high-performance [HTTP] server and reverse proxy&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/glossary/reverse-proxy-server/]&amp;lt;/ref&amp;gt;, as well as an IMAP&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol&amp;lt;/ref&amp;gt;/POP3&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Post_Office_Protocol&amp;lt;/ref&amp;gt; proxy server. Nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/wiki/ Nginx Sever]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unicorn===&lt;br /&gt;
&lt;br /&gt;
Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.  Slow clients should only be served by placing a reverse proxy capable of fully buffering both the the request and response in between unicorn and slow clients.&lt;br /&gt;
&amp;lt;ref&amp;gt;[https://github.com/defunkt/unicorn Unicorn Web Server]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Plan of Action==&lt;br /&gt;
===Steps to Implement the Automated Deployment Process===&lt;br /&gt;
&lt;br /&gt;
[[File:Img01ExpInfra.png | frame|none|Expertiza Virtual Infrastructure]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Setup a virtual Vanilla&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Vanilla_software Vanilla]&amp;lt;/ref&amp;gt; Ubuntu&amp;lt;ref&amp;gt;[http://www.ubuntu.com Ubuntu]&amp;lt;/ref&amp;gt; Machine.&lt;br /&gt;
&lt;br /&gt;
2. Update the Ubuntu to the specified version.&lt;br /&gt;
&lt;br /&gt;
3. Clone Expertiza from Github.&lt;br /&gt;
&lt;br /&gt;
4. Install packages for Java, Ruby and all the ruby dependencies.&lt;br /&gt;
&lt;br /&gt;
5. Bundle install for installing all the gems in Gemfile.&lt;br /&gt;
&lt;br /&gt;
6. Install MYSQL&amp;lt;ref&amp;gt;[https://mysql.com Mysql server]&amp;lt;/ref&amp;gt;, configure it and migrate databases.&lt;br /&gt;
&lt;br /&gt;
7. Install Unicorn gem. Unicorn is a Rack&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Rack_%28web_server_interface%29 Rack Server]&amp;lt;/ref&amp;gt; HTTP server that uses forked processes to handle multiple incoming requests concurrently. For expertiza, unicorn is being used as the web server, which will interact with the database servers to fetch the data.&lt;br /&gt;
&lt;br /&gt;
8. Make changes in the nginx configuration.&lt;br /&gt;
&lt;br /&gt;
9. Install nginx. Nginx is a web server. It is being used in the Expertiza architecture as a reverse proxy server. Through nginx, we will also attempt to serve static pages directly.&lt;br /&gt;
&lt;br /&gt;
10. Configure Unicorn and integrate it to work with nginx.&lt;br /&gt;
&lt;br /&gt;
11. Start both Unicorn and Nginx server.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Stack==&lt;br /&gt;
&lt;br /&gt;
[[File:Exp1.png]]&lt;br /&gt;
&lt;br /&gt;
The above visually describes the expertiza stack on the virtual machine. The stack includes nginx as the front end, web server which will redirect the requests to the unicorn server. The scope of the project includes just 1 unicorn server but the recipe will be written in a way that later modifications can be made to add more than 1 unicorn servers under a load balancer. The unicorn server will interact with the database server and write/fetch data into it.&lt;br /&gt;
&lt;br /&gt;
==Chef-Solo Recipe Example==&lt;br /&gt;
Chef solo has cookbooks and recipes. An example of recipes is as follows:&lt;br /&gt;
    package &amp;quot;git-core&amp;quot; #apt-get install git-core&lt;br /&gt;
&lt;br /&gt;
    user node[:user][:name] do&lt;br /&gt;
        password node[:user][:password]&lt;br /&gt;
        gid &amp;quot;admin&amp;quot;&lt;br /&gt;
        home &amp;quot;/home/#{node[:user][:name]}&amp;quot;&lt;br /&gt;
        supports :manage_home =&amp;gt; true&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
This recipe orchestrates the installation of git-core and creates a new user and sets its privileges and password along with the home directory. Similarly, the plan of action is to write recipes for downloading, installing and configuring various components(nginx, unicorn, RMV, Ruby, MYSQL etc.) which will contribute towards building the infrastructure of expertiza.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Deployment==&lt;br /&gt;
&lt;br /&gt;
1. We first created a droplet( virtual private server) using digital ocean&amp;lt;ref&amp;gt;https://www.digitalocean.com/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Drop.png]]&lt;br /&gt;
&lt;br /&gt;
2. We recorded the IP address of the newly created droplet and created the associated &amp;lt;ipaddress&amp;gt;.json file.&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;ipaddress&amp;gt;.json''' : This file holds all the node specific values required to install services and config node.&lt;br /&gt;
We will set node_user , user_hash_password , ruby version , mysql root &amp;amp; password . The main function apart from holding node variables is to run recipes in a specific code.&lt;br /&gt;
&lt;br /&gt;
[[File:New_ip.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following recipes(.rb files), scripts and node specific files were created to achieve automatic deployment. Other pre-installed files and folder for Chef cookbook can be found in the git repository mentioned above.&lt;br /&gt;
&lt;br /&gt;
3. We then run the bash command in following format&amp;lt;code&amp;gt;sh setup_vps.sh &amp;lt;node_username&amp;gt; &amp;lt;node_ip_address&amp;gt; &amp;lt;node_port&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will run the knife tool that will setup Chef-solo on the node and will execute the recipes.&lt;br /&gt;
This needs to be run from the directory where '''setup_vps.sh''' is present.&lt;br /&gt;
&lt;br /&gt;
[[File:New setup vps.png]]&lt;br /&gt;
&lt;br /&gt;
4. '''default.rb''' : This updates the Ubuntu machine packages, installs the list of prerequisite packages and sets the time zone.&lt;br /&gt;
&lt;br /&gt;
[[File:New default.png]]&lt;br /&gt;
&lt;br /&gt;
5. '''expertiza_clone''' : This recipes creates a directory and clones the  Expertiza git source code in that directory.&lt;br /&gt;
&lt;br /&gt;
[[File:New expertiza clone.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''set_java_home''': This recipe sets the Java configuration. It then bundle installs all the gems used by the Expertiza.&lt;br /&gt;
&lt;br /&gt;
[[File:New_set_java.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''mysql.rb''' : It installs the MySQL server , MySQL client and its associated dependencies. The root password is preloaded and then fetched on installation by setting DEBIAN_FRONTEND environment variable.&lt;br /&gt;
&lt;br /&gt;
[[File:New sql.png]]&lt;br /&gt;
&lt;br /&gt;
'''database.rb''' : This recipe will execute scrubbed.sql on MySQL, which in turn will create all the Schema's for production, development and test environment. It will also populate database tables with seed (configuration) data.&lt;br /&gt;
&lt;br /&gt;
[[File:New database.png]]&lt;br /&gt;
&lt;br /&gt;
'''nginx.rb''' : This recipe installs nginx which is web proxy server that will listen on user defined port and redirect the requests for static content (images, css, javascript) to the public folder of Experiza rails app.&lt;br /&gt;
&lt;br /&gt;
[[File:New_nginx.png ]]&lt;br /&gt;
&lt;br /&gt;
'''unicorn.rb''' : It will install and configure Unicorn web server used in production environment to handle high traffic and achieve load balancing . All the requests for dynamic content will go through it.&lt;br /&gt;
&lt;br /&gt;
[[File:New_unicorn_corn.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''start_server.rb''' : This will restart all the installed services , after which Expertiza can start taking requests.&lt;br /&gt;
&lt;br /&gt;
[[File:New start server1.png]]&lt;br /&gt;
&lt;br /&gt;
==Github link==&lt;br /&gt;
https://github.com/amurark/expertiza&lt;br /&gt;
&lt;br /&gt;
==Points for the reviewer==&lt;br /&gt;
&lt;br /&gt;
While reviewing this project, please consider the following points:&lt;br /&gt;
&lt;br /&gt;
*1. There is no scope for testing in our project. This has been discussed and approved by the mentor. &lt;br /&gt;
*2. There is no scope for UML diagrams for this project, as there are no classes/interface involved.&lt;br /&gt;
&lt;br /&gt;
==Future Scope==&lt;br /&gt;
&lt;br /&gt;
The cookbook has been created with the assumption of root user as the administer.For security purposes deployment should be done with another user with sudo privileges, and then root login disabled. Also a new user for MySQL with full database privileges needs to be created. But that hasn't been achieved automatically in the resent cookbook. Further, Unicorn configuration is done with a single Unicorn server in mind. It has to be configured for multiple servers for load balancing in events of heavy traffic. &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_unicorn_corn.png&amp;diff=100564</id>
		<title>File:New unicorn corn.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_unicorn_corn.png&amp;diff=100564"/>
		<updated>2015-12-16T10:37:42Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: uploaded a new version of &amp;amp;quot;File:New unicorn corn.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_database.png&amp;diff=100563</id>
		<title>File:New database.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_database.png&amp;diff=100563"/>
		<updated>2015-12-16T10:37:24Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: uploaded a new version of &amp;amp;quot;File:New database.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_database.png&amp;diff=100562</id>
		<title>File:New database.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_database.png&amp;diff=100562"/>
		<updated>2015-12-16T10:31:36Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: uploaded a new version of &amp;amp;quot;File:New database.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100561</id>
		<title>CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100561"/>
		<updated>2015-12-16T10:30:33Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: /* Expertiza Deployment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction to Expertiza==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is a web application to create reusable learning objects through peer review. It supports various features such as team projects and the submission of various documents including URLs and wiki pages. It is being used extensively across various universities for select courses.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Currently, setting up the infrastructure for expertiza is done manually. The task is to write a Chef-solo&amp;lt;ref&amp;gt;[https://docs.chef.io/chef_solo.html Chef Solo]&amp;lt;/ref&amp;gt; recipe which will create a production ready environment for expertiza. Chef-solo recipes are Ruby&amp;lt;ref&amp;gt;[https://www.ruby-lang.org/en/ Ruby]&amp;lt;/ref&amp;gt; code.&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
&lt;br /&gt;
We need to provide a single step setup of expertiza for production.&lt;br /&gt;
&lt;br /&gt;
*It should include setting up the basic environment, application dependency, configuration setup and database setup.&lt;br /&gt;
*It should also include recipe for regular deployment.&lt;br /&gt;
&lt;br /&gt;
==Some Terminology==&lt;br /&gt;
===Chef Solo&amp;lt;ref&amp;gt;https://docs.chef.io/chef_solo.html&amp;lt;/ref&amp;gt;=== &lt;br /&gt;
Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each organization is comprised of one(or more) workstations, a single server, and every node that will be configured and maintained by the chef-client. Cookbooks (and recipes) are used to tell the chef-client how each node in your organization should be configured. The chef-client(which is installed on every node) does the actual configuration.&lt;br /&gt;
&lt;br /&gt;
*'''Node:'''&lt;br /&gt;
:A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.&lt;br /&gt;
&lt;br /&gt;
*'''Recipe: ''' &lt;br /&gt;
:A recipe specifies the resources to use and the order in which they are to be applied. It is mostly a collection of resources, defined using patterns(resource names, attribute-value pairs, and actions). A recipe       must define everything that is required to configure part of a system.&lt;br /&gt;
&lt;br /&gt;
*'''Cookbook:''' &lt;br /&gt;
:A cookbook is the fundamental unit of configuration and policy distribution. A cookbook defines a scenario and contains everything that is required to support that scenario.&lt;br /&gt;
&lt;br /&gt;
*'''WorkStation:'''&lt;br /&gt;
:A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery. &lt;br /&gt;
:The workstation is the location from which most users do most of their work.&lt;br /&gt;
:One(or more) workstations are configured to allow users to author, test, and maintain cookbooks. Cookbooks are uploaded to the Chef server from the workstation.&lt;br /&gt;
&lt;br /&gt;
*'''Chef Server:'''&lt;br /&gt;
:The Chef server acts as a hub of information. Cookbooks and policy settings are uploaded to the Chef server by users from workstations.&lt;br /&gt;
&lt;br /&gt;
*'''Chef-client:'''&lt;br /&gt;
:The chef-client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL for specific resources&lt;br /&gt;
&lt;br /&gt;
===Nginx===&lt;br /&gt;
&lt;br /&gt;
Nginx is a free, open-source, high-performance [HTTP] server and reverse proxy&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/glossary/reverse-proxy-server/]&amp;lt;/ref&amp;gt;, as well as an IMAP&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol&amp;lt;/ref&amp;gt;/POP3&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Post_Office_Protocol&amp;lt;/ref&amp;gt; proxy server. Nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/wiki/ Nginx Sever]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unicorn===&lt;br /&gt;
&lt;br /&gt;
Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.  Slow clients should only be served by placing a reverse proxy capable of fully buffering both the the request and response in between unicorn and slow clients.&lt;br /&gt;
&amp;lt;ref&amp;gt;[https://github.com/defunkt/unicorn Unicorn Web Server]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Plan of Action==&lt;br /&gt;
===Steps to Implement the Automated Deployment Process===&lt;br /&gt;
&lt;br /&gt;
[[File:Img01ExpInfra.png | frame|none|Expertiza Virtual Infrastructure]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Setup a virtual Vanilla&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Vanilla_software Vanilla]&amp;lt;/ref&amp;gt; Ubuntu&amp;lt;ref&amp;gt;[http://www.ubuntu.com Ubuntu]&amp;lt;/ref&amp;gt; Machine.&lt;br /&gt;
&lt;br /&gt;
2. Update the Ubuntu to the specified version.&lt;br /&gt;
&lt;br /&gt;
3. Clone Expertiza from Github.&lt;br /&gt;
&lt;br /&gt;
4. Install packages for Java, Ruby and all the ruby dependencies.&lt;br /&gt;
&lt;br /&gt;
5. Bundle install, install all gems&lt;br /&gt;
&lt;br /&gt;
6. Install MYSQL&amp;lt;ref&amp;gt;[https://mysql.com Mysql server]&amp;lt;/ref&amp;gt;, configure it and migrate databases.&lt;br /&gt;
&lt;br /&gt;
7. Install Unicorn gem. Unicorn is a Rack&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Rack_%28web_server_interface%29 Rack Server]&amp;lt;/ref&amp;gt; HTTP server that uses forked processes to handle multiple incoming requests concurrently. For expertiza, unicorn is being used as the web server, which will interact with the database servers to fetch the data.&lt;br /&gt;
&lt;br /&gt;
8. Make changes in the nginx configuration.&lt;br /&gt;
&lt;br /&gt;
9. Install nginx. Nginx is a web server. It is being used in the Expertiza architecture as a reverse proxy server. Through nginx, we will also attempt to serve static pages directly.&lt;br /&gt;
&lt;br /&gt;
10. Configure Unicorn and integrate it to work with nginx.&lt;br /&gt;
&lt;br /&gt;
11. Start both Unicorn and Nginx server.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Stack==&lt;br /&gt;
&lt;br /&gt;
[[File:Exp1.png]]&lt;br /&gt;
&lt;br /&gt;
The above visually describes the expertiza stack on the virtual machine. The stack includes nginx as the front end, web server which will redirect the requests to the unicorn server. The scope of the project includes just 1 unicorn server but the recipe will be written in a way that later modifications can be made to add more than 1 unicorn servers under a load balancer. The unicorn server will interact with the database server and write/fetch data into it.&lt;br /&gt;
&lt;br /&gt;
==Chef-Solo Recipe Example==&lt;br /&gt;
Chef solo has cookbooks and recipes. An example of recipes is as follows:&lt;br /&gt;
    package &amp;quot;git-core&amp;quot; #apt-get install git-core&lt;br /&gt;
&lt;br /&gt;
    user node[:user][:name] do&lt;br /&gt;
        password node[:user][:password]&lt;br /&gt;
        gid &amp;quot;admin&amp;quot;&lt;br /&gt;
        home &amp;quot;/home/#{node[:user][:name]}&amp;quot;&lt;br /&gt;
        supports :manage_home =&amp;gt; true&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
This recipe orchestrates the installation of git-core and creates a new user and sets its privileges and password along with the home directory. Similarly, the plan of action is to write recipes for downloading, installing and configuring various components(nginx, unicorn, RMV, Ruby, MYSQL etc.) which will contribute towards building the infrastructure of expertiza.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Deployment==&lt;br /&gt;
&lt;br /&gt;
1. We first created a droplet( virtual private server) using digital ocean&amp;lt;ref&amp;gt;https://www.digitalocean.com/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Drop.png]]&lt;br /&gt;
&lt;br /&gt;
2. We recorded the IP address of the newly created droplet and created the associated &amp;lt;ipaddress&amp;gt;.json file.&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;ipaddress&amp;gt;.json''' : This file holds all the node specific values required to install services and config node.&lt;br /&gt;
We will set node_user , user_hash_password , ruby version , mysql root &amp;amp; password . The main function apart from holding node variables is to run recipes in a specific code.&lt;br /&gt;
&lt;br /&gt;
[[File:New_ip.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following recipes(.rb files), scripts and node specific files were created to achieve automatic deployment. Other pre-installed files and folder for Chef cookbook can be found in the git repository mentioned above.&lt;br /&gt;
&lt;br /&gt;
3. Next, '''setup_vps.sh''' : This will run the knife tool that will setup Chef-solo on the node and  will execute the recipes.&lt;br /&gt;
This needs to be from the directory where it present. The bash command in following format has to be used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sh setup_vps.sh &amp;lt;node_username&amp;gt; &amp;lt;node_ip_address&amp;gt; &amp;lt;node_port&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New setup vps.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''default.rb''' : This updates the Ubuntu machine packages, install the list of prerequisite packages and sets the time zone.&lt;br /&gt;
&lt;br /&gt;
[[File:New default.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''expertiza_clone''' : This recipes creates a directory and clones the  Expertiza git source code in that directory.&lt;br /&gt;
&lt;br /&gt;
[[File:New expertiza clone.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''set_java_home''': This recipe sets the Java configuration. It then bundle installs all the gems used by the Expertiza.&lt;br /&gt;
&lt;br /&gt;
[[File:New_set_java.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''mysql.rb''' : It installs the MySQL server , MySQL client and its associated dependencies. The root password is preloaded and then fetched on installation by setting DEBIAN_FRONTEND environment variable.&lt;br /&gt;
&lt;br /&gt;
[[File:New sql.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''nginx.rb''' : This recipe installs nginx which is web proxy server that will listen on user defined port and redirect the requests for static content (images, css, javascript) to the public folder of Experiza rails app.&lt;br /&gt;
&lt;br /&gt;
[[File:New_nginx.png ]]&lt;br /&gt;
&lt;br /&gt;
'''unicorn.rb''' : It will install and configure Unicorn web server used in production environment to handle high traffic and achieve load balancing . All the requests for dynamic content will go through it.&lt;br /&gt;
&lt;br /&gt;
[[File:New start server1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New database.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New_unicorn_corn.png]]&lt;br /&gt;
&lt;br /&gt;
==Github link==&lt;br /&gt;
https://github.com/amurark/expertiza&lt;br /&gt;
&lt;br /&gt;
==Points for the reviewer==&lt;br /&gt;
&lt;br /&gt;
While reviewing this project, please consider the following points:&lt;br /&gt;
&lt;br /&gt;
*1. There is no scope for testing in our project. This has been discussed and approved by the mentor. &lt;br /&gt;
*2. There is no scope for UML diagrams for this project, as there are no classes/interface involved.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_start_server1.png&amp;diff=100560</id>
		<title>File:New start server1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_start_server1.png&amp;diff=100560"/>
		<updated>2015-12-16T10:29:48Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_ip.png&amp;diff=100559</id>
		<title>File:New ip.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_ip.png&amp;diff=100559"/>
		<updated>2015-12-16T10:27:21Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: uploaded a new version of &amp;amp;quot;File:New ip.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100558</id>
		<title>CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100558"/>
		<updated>2015-12-16T10:26:33Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: /* Expertiza Deployment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction to Expertiza==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is a web application to create reusable learning objects through peer review. It supports various features such as team projects and the submission of various documents including URLs and wiki pages. It is being used extensively across various universities for select courses.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Currently, setting up the infrastructure for expertiza is done manually. The task is to write a Chef-solo&amp;lt;ref&amp;gt;[https://docs.chef.io/chef_solo.html Chef Solo]&amp;lt;/ref&amp;gt; recipe which will create a production ready environment for expertiza. Chef-solo recipes are Ruby&amp;lt;ref&amp;gt;[https://www.ruby-lang.org/en/ Ruby]&amp;lt;/ref&amp;gt; code.&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
&lt;br /&gt;
We need to provide a single step setup of expertiza for production.&lt;br /&gt;
&lt;br /&gt;
*It should include setting up the basic environment, application dependency, configuration setup and database setup.&lt;br /&gt;
*It should also include recipe for regular deployment.&lt;br /&gt;
&lt;br /&gt;
==Some Terminology==&lt;br /&gt;
===Chef Solo&amp;lt;ref&amp;gt;https://docs.chef.io/chef_solo.html&amp;lt;/ref&amp;gt;=== &lt;br /&gt;
Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each organization is comprised of one(or more) workstations, a single server, and every node that will be configured and maintained by the chef-client. Cookbooks (and recipes) are used to tell the chef-client how each node in your organization should be configured. The chef-client(which is installed on every node) does the actual configuration.&lt;br /&gt;
&lt;br /&gt;
*'''Node:'''&lt;br /&gt;
:A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.&lt;br /&gt;
&lt;br /&gt;
*'''Recipe: ''' &lt;br /&gt;
:A recipe specifies the resources to use and the order in which they are to be applied. It is mostly a collection of resources, defined using patterns(resource names, attribute-value pairs, and actions). A recipe       must define everything that is required to configure part of a system.&lt;br /&gt;
&lt;br /&gt;
*'''Cookbook:''' &lt;br /&gt;
:A cookbook is the fundamental unit of configuration and policy distribution. A cookbook defines a scenario and contains everything that is required to support that scenario.&lt;br /&gt;
&lt;br /&gt;
*'''WorkStation:'''&lt;br /&gt;
:A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery. &lt;br /&gt;
:The workstation is the location from which most users do most of their work.&lt;br /&gt;
:One(or more) workstations are configured to allow users to author, test, and maintain cookbooks. Cookbooks are uploaded to the Chef server from the workstation.&lt;br /&gt;
&lt;br /&gt;
*'''Chef Server:'''&lt;br /&gt;
:The Chef server acts as a hub of information. Cookbooks and policy settings are uploaded to the Chef server by users from workstations.&lt;br /&gt;
&lt;br /&gt;
*'''Chef-client:'''&lt;br /&gt;
:The chef-client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL for specific resources&lt;br /&gt;
&lt;br /&gt;
===Nginx===&lt;br /&gt;
&lt;br /&gt;
Nginx is a free, open-source, high-performance [HTTP] server and reverse proxy&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/glossary/reverse-proxy-server/]&amp;lt;/ref&amp;gt;, as well as an IMAP&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol&amp;lt;/ref&amp;gt;/POP3&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Post_Office_Protocol&amp;lt;/ref&amp;gt; proxy server. Nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/wiki/ Nginx Sever]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unicorn===&lt;br /&gt;
&lt;br /&gt;
Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.  Slow clients should only be served by placing a reverse proxy capable of fully buffering both the the request and response in between unicorn and slow clients.&lt;br /&gt;
&amp;lt;ref&amp;gt;[https://github.com/defunkt/unicorn Unicorn Web Server]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Plan of Action==&lt;br /&gt;
===Steps to Implement the Automated Deployment Process===&lt;br /&gt;
&lt;br /&gt;
[[File:Img01ExpInfra.png | frame|none|Expertiza Virtual Infrastructure]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Setup a virtual Vanilla&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Vanilla_software Vanilla]&amp;lt;/ref&amp;gt; Ubuntu&amp;lt;ref&amp;gt;[http://www.ubuntu.com Ubuntu]&amp;lt;/ref&amp;gt; Machine.&lt;br /&gt;
&lt;br /&gt;
2. Update the Ubuntu to the specified version.&lt;br /&gt;
&lt;br /&gt;
3. Clone Expertiza from Github.&lt;br /&gt;
&lt;br /&gt;
4. Install packages for Java, Ruby and all the ruby dependencies.&lt;br /&gt;
&lt;br /&gt;
5. Bundle install, install all gems&lt;br /&gt;
&lt;br /&gt;
6. Install MYSQL&amp;lt;ref&amp;gt;[https://mysql.com Mysql server]&amp;lt;/ref&amp;gt;, configure it and migrate databases.&lt;br /&gt;
&lt;br /&gt;
7. Install Unicorn gem. Unicorn is a Rack&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Rack_%28web_server_interface%29 Rack Server]&amp;lt;/ref&amp;gt; HTTP server that uses forked processes to handle multiple incoming requests concurrently. For expertiza, unicorn is being used as the web server, which will interact with the database servers to fetch the data.&lt;br /&gt;
&lt;br /&gt;
8. Make changes in the nginx configuration.&lt;br /&gt;
&lt;br /&gt;
9. Install nginx. Nginx is a web server. It is being used in the Expertiza architecture as a reverse proxy server. Through nginx, we will also attempt to serve static pages directly.&lt;br /&gt;
&lt;br /&gt;
10. Configure Unicorn and integrate it to work with nginx.&lt;br /&gt;
&lt;br /&gt;
11. Start both Unicorn and Nginx server.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Stack==&lt;br /&gt;
&lt;br /&gt;
[[File:Exp1.png]]&lt;br /&gt;
&lt;br /&gt;
The above visually describes the expertiza stack on the virtual machine. The stack includes nginx as the front end, web server which will redirect the requests to the unicorn server. The scope of the project includes just 1 unicorn server but the recipe will be written in a way that later modifications can be made to add more than 1 unicorn servers under a load balancer. The unicorn server will interact with the database server and write/fetch data into it.&lt;br /&gt;
&lt;br /&gt;
==Chef-Solo Recipe Example==&lt;br /&gt;
Chef solo has cookbooks and recipes. An example of recipes is as follows:&lt;br /&gt;
    package &amp;quot;git-core&amp;quot; #apt-get install git-core&lt;br /&gt;
&lt;br /&gt;
    user node[:user][:name] do&lt;br /&gt;
        password node[:user][:password]&lt;br /&gt;
        gid &amp;quot;admin&amp;quot;&lt;br /&gt;
        home &amp;quot;/home/#{node[:user][:name]}&amp;quot;&lt;br /&gt;
        supports :manage_home =&amp;gt; true&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
This recipe orchestrates the installation of git-core and creates a new user and sets its privileges and password along with the home directory. Similarly, the plan of action is to write recipes for downloading, installing and configuring various components(nginx, unicorn, RMV, Ruby, MYSQL etc.) which will contribute towards building the infrastructure of expertiza.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Deployment==&lt;br /&gt;
&lt;br /&gt;
1. We first created a droplet( virtual private server) using digital ocean&amp;lt;ref&amp;gt;https://www.digitalocean.com/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Drop.png]]&lt;br /&gt;
&lt;br /&gt;
2. We recorded the IP address of the newly created droplet and created the associated &amp;lt;ipaddress&amp;gt;.json file.&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;ipaddress&amp;gt;.json''' : This file holds all the node specific values required to install services and config node.&lt;br /&gt;
We will set node_user , user_hash_password , ruby version , mysql root &amp;amp; password . The main function apart from holding node variables is to run recipes in a specific code.&lt;br /&gt;
&lt;br /&gt;
[[File:New_ip.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following recipes(.rb files), scripts and node specific files were created to achieve automatic deployment. Other pre-installed files and folder for Chef cookbook can be found in the git repository mentioned above.&lt;br /&gt;
&lt;br /&gt;
3. Next, '''setup_vps.sh''' : This will run the knife tool that will setup Chef-solo on the node and  will execute the recipes.&lt;br /&gt;
This needs to be from the directory where it present. The bash command in following format has to be used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sh setup_vps.sh &amp;lt;node_username&amp;gt; &amp;lt;node_ip_address&amp;gt; &amp;lt;node_port&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New setup vps.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''default.rb''' : This updates the Ubuntu machine packages, install the list of prerequisite packages and sets the time zone.&lt;br /&gt;
&lt;br /&gt;
[[File:New default.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''expertiza_clone''' : This recipes creates a directory and clones the  Expertiza git source code in that directory.&lt;br /&gt;
&lt;br /&gt;
[[File:New expertiza clone.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''set_java_home''': This recipe sets the Java configuration. It then bundle installs all the gems used by the Expertiza.&lt;br /&gt;
&lt;br /&gt;
[[File:New_set_java.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''mysql.rb''' : It installs the MySQL server , MySQL client and its associated dependencies. The root password is preloaded and then fetched on installation by setting DEBIAN_FRONTEND environment variable.&lt;br /&gt;
&lt;br /&gt;
[[File:New sql.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''nginx.rb''' : This recipe installs nginx which is web proxy server that will listen on user defined port and redirect the requests for static content (images, css, javascript) to the public folder of Experiza rails app.&lt;br /&gt;
&lt;br /&gt;
[[File:New_nginx.png ]]&lt;br /&gt;
&lt;br /&gt;
'''unicorn.rb''' : It will install and configure Unicorn web server used in production environment to handle high traffic and achieve load balancing . All the requests for dynamic content will go through it.&lt;br /&gt;
&lt;br /&gt;
[[File:New start server.png.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New database.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New_unicorn_corn.png]]&lt;br /&gt;
&lt;br /&gt;
==Github link==&lt;br /&gt;
https://github.com/amurark/expertiza&lt;br /&gt;
&lt;br /&gt;
==Points for the reviewer==&lt;br /&gt;
&lt;br /&gt;
While reviewing this project, please consider the following points:&lt;br /&gt;
&lt;br /&gt;
*1. There is no scope for testing in our project. This has been discussed and approved by the mentor. &lt;br /&gt;
*2. There is no scope for UML diagrams for this project, as there are no classes/interface involved.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_unicorn_corn.png&amp;diff=100557</id>
		<title>File:New unicorn corn.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_unicorn_corn.png&amp;diff=100557"/>
		<updated>2015-12-16T10:24:15Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: uploaded a new version of &amp;amp;quot;File:New unicorn corn.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_start_server.png&amp;diff=100556</id>
		<title>File:New start server.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_start_server.png&amp;diff=100556"/>
		<updated>2015-12-16T10:24:04Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: uploaded a new version of &amp;amp;quot;File:New start server.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_sql.png&amp;diff=100555</id>
		<title>File:New sql.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_sql.png&amp;diff=100555"/>
		<updated>2015-12-16T10:23:53Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: uploaded a new version of &amp;amp;quot;File:New sql.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_setup_vps.png&amp;diff=100554</id>
		<title>File:New setup vps.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_setup_vps.png&amp;diff=100554"/>
		<updated>2015-12-16T10:23:40Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: uploaded a new version of &amp;amp;quot;File:New setup vps.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_set_java.png&amp;diff=100553</id>
		<title>File:New set java.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_set_java.png&amp;diff=100553"/>
		<updated>2015-12-16T10:23:26Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: uploaded a new version of &amp;amp;quot;File:New set java.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_nginx.png&amp;diff=100552</id>
		<title>File:New nginx.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_nginx.png&amp;diff=100552"/>
		<updated>2015-12-16T10:23:15Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: uploaded a new version of &amp;amp;quot;File:New nginx.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_expertiza_clone.png&amp;diff=100551</id>
		<title>File:New expertiza clone.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_expertiza_clone.png&amp;diff=100551"/>
		<updated>2015-12-16T10:23:04Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: uploaded a new version of &amp;amp;quot;File:New expertiza clone.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_ip.png&amp;diff=100550</id>
		<title>File:New ip.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_ip.png&amp;diff=100550"/>
		<updated>2015-12-16T10:22:33Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: uploaded a new version of &amp;amp;quot;File:New ip.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_expertiza_clone.png&amp;diff=100549</id>
		<title>File:New expertiza clone.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_expertiza_clone.png&amp;diff=100549"/>
		<updated>2015-12-16T10:22:14Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: uploaded a new version of &amp;amp;quot;File:New expertiza clone.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_default.png&amp;diff=100548</id>
		<title>File:New default.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_default.png&amp;diff=100548"/>
		<updated>2015-12-16T10:22:01Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: uploaded a new version of &amp;amp;quot;File:New default.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_database.png&amp;diff=100547</id>
		<title>File:New database.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_database.png&amp;diff=100547"/>
		<updated>2015-12-16T10:21:45Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: uploaded a new version of &amp;amp;quot;File:New database.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100546</id>
		<title>CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100546"/>
		<updated>2015-12-16T10:15:18Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: /* Expertiza Deployment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction to Expertiza==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is a web application to create reusable learning objects through peer review. It supports various features such as team projects and the submission of various documents including URLs and wiki pages. It is being used extensively across various universities for select courses.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Currently, setting up the infrastructure for expertiza is done manually. The task is to write a Chef-solo&amp;lt;ref&amp;gt;[https://docs.chef.io/chef_solo.html Chef Solo]&amp;lt;/ref&amp;gt; recipe which will create a production ready environment for expertiza. Chef-solo recipes are Ruby&amp;lt;ref&amp;gt;[https://www.ruby-lang.org/en/ Ruby]&amp;lt;/ref&amp;gt; code.&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
&lt;br /&gt;
We need to provide a single step setup of expertiza for production.&lt;br /&gt;
&lt;br /&gt;
*It should include setting up the basic environment, application dependency, configuration setup and database setup.&lt;br /&gt;
*It should also include recipe for regular deployment.&lt;br /&gt;
&lt;br /&gt;
==Some Terminology==&lt;br /&gt;
===Chef Solo&amp;lt;ref&amp;gt;https://docs.chef.io/chef_solo.html&amp;lt;/ref&amp;gt;=== &lt;br /&gt;
Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each organization is comprised of one(or more) workstations, a single server, and every node that will be configured and maintained by the chef-client. Cookbooks (and recipes) are used to tell the chef-client how each node in your organization should be configured. The chef-client(which is installed on every node) does the actual configuration.&lt;br /&gt;
&lt;br /&gt;
*'''Node:'''&lt;br /&gt;
:A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.&lt;br /&gt;
&lt;br /&gt;
*'''Recipe: ''' &lt;br /&gt;
:A recipe specifies the resources to use and the order in which they are to be applied. It is mostly a collection of resources, defined using patterns(resource names, attribute-value pairs, and actions). A recipe       must define everything that is required to configure part of a system.&lt;br /&gt;
&lt;br /&gt;
*'''Cookbook:''' &lt;br /&gt;
:A cookbook is the fundamental unit of configuration and policy distribution. A cookbook defines a scenario and contains everything that is required to support that scenario.&lt;br /&gt;
&lt;br /&gt;
*'''WorkStation:'''&lt;br /&gt;
:A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery. &lt;br /&gt;
:The workstation is the location from which most users do most of their work.&lt;br /&gt;
:One(or more) workstations are configured to allow users to author, test, and maintain cookbooks. Cookbooks are uploaded to the Chef server from the workstation.&lt;br /&gt;
&lt;br /&gt;
*'''Chef Server:'''&lt;br /&gt;
:The Chef server acts as a hub of information. Cookbooks and policy settings are uploaded to the Chef server by users from workstations.&lt;br /&gt;
&lt;br /&gt;
*'''Chef-client:'''&lt;br /&gt;
:The chef-client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL for specific resources&lt;br /&gt;
&lt;br /&gt;
===Nginx===&lt;br /&gt;
&lt;br /&gt;
Nginx is a free, open-source, high-performance [HTTP] server and reverse proxy&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/glossary/reverse-proxy-server/]&amp;lt;/ref&amp;gt;, as well as an IMAP&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol&amp;lt;/ref&amp;gt;/POP3&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Post_Office_Protocol&amp;lt;/ref&amp;gt; proxy server. Nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/wiki/ Nginx Sever]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unicorn===&lt;br /&gt;
&lt;br /&gt;
Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.  Slow clients should only be served by placing a reverse proxy capable of fully buffering both the the request and response in between unicorn and slow clients.&lt;br /&gt;
&amp;lt;ref&amp;gt;[https://github.com/defunkt/unicorn Unicorn Web Server]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Plan of Action==&lt;br /&gt;
===Steps to Implement the Automated Deployment Process===&lt;br /&gt;
&lt;br /&gt;
[[File:Img01ExpInfra.png | frame|none|Expertiza Virtual Infrastructure]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Setup a virtual Vanilla&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Vanilla_software Vanilla]&amp;lt;/ref&amp;gt; Ubuntu&amp;lt;ref&amp;gt;[http://www.ubuntu.com Ubuntu]&amp;lt;/ref&amp;gt; Machine.&lt;br /&gt;
&lt;br /&gt;
2. Update the Ubuntu to the specified version.&lt;br /&gt;
&lt;br /&gt;
3. Clone Expertiza from Github.&lt;br /&gt;
&lt;br /&gt;
4. Install packages for Java, Ruby and all the ruby dependencies.&lt;br /&gt;
&lt;br /&gt;
5. Bundle install, install all gems&lt;br /&gt;
&lt;br /&gt;
6. Install MYSQL&amp;lt;ref&amp;gt;[https://mysql.com Mysql server]&amp;lt;/ref&amp;gt;, configure it and migrate databases.&lt;br /&gt;
&lt;br /&gt;
7. Install Unicorn gem. Unicorn is a Rack&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Rack_%28web_server_interface%29 Rack Server]&amp;lt;/ref&amp;gt; HTTP server that uses forked processes to handle multiple incoming requests concurrently. For expertiza, unicorn is being used as the web server, which will interact with the database servers to fetch the data.&lt;br /&gt;
&lt;br /&gt;
8. Make changes in the nginx configuration.&lt;br /&gt;
&lt;br /&gt;
9. Install nginx. Nginx is a web server. It is being used in the Expertiza architecture as a reverse proxy server. Through nginx, we will also attempt to serve static pages directly.&lt;br /&gt;
&lt;br /&gt;
10. Configure Unicorn and integrate it to work with nginx.&lt;br /&gt;
&lt;br /&gt;
11. Start both Unicorn and Nginx server.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Stack==&lt;br /&gt;
&lt;br /&gt;
[[File:Exp1.png]]&lt;br /&gt;
&lt;br /&gt;
The above visually describes the expertiza stack on the virtual machine. The stack includes nginx as the front end, web server which will redirect the requests to the unicorn server. The scope of the project includes just 1 unicorn server but the recipe will be written in a way that later modifications can be made to add more than 1 unicorn servers under a load balancer. The unicorn server will interact with the database server and write/fetch data into it.&lt;br /&gt;
&lt;br /&gt;
==Chef-Solo Recipe Example==&lt;br /&gt;
Chef solo has cookbooks and recipes. An example of recipes is as follows:&lt;br /&gt;
    package &amp;quot;git-core&amp;quot; #apt-get install git-core&lt;br /&gt;
&lt;br /&gt;
    user node[:user][:name] do&lt;br /&gt;
        password node[:user][:password]&lt;br /&gt;
        gid &amp;quot;admin&amp;quot;&lt;br /&gt;
        home &amp;quot;/home/#{node[:user][:name]}&amp;quot;&lt;br /&gt;
        supports :manage_home =&amp;gt; true&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
This recipe orchestrates the installation of git-core and creates a new user and sets its privileges and password along with the home directory. Similarly, the plan of action is to write recipes for downloading, installing and configuring various components(nginx, unicorn, RMV, Ruby, MYSQL etc.) which will contribute towards building the infrastructure of expertiza.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Deployment==&lt;br /&gt;
&lt;br /&gt;
1. We first created a droplet( virtual private server) using digital ocean&amp;lt;ref&amp;gt;https://www.digitalocean.com/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Drop.png]]&lt;br /&gt;
&lt;br /&gt;
2. We recorded the IP address of the newly created droplet and created the associated &amp;lt;ipaddress&amp;gt;.json file.&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;ipaddress&amp;gt;.json''' : This file holds all the node specific values required to install services and config node.&lt;br /&gt;
We will set node_user , user_hash_password , ruby version , mysql root &amp;amp; password . The main function apart from holding node variables is to run recipes in a specific code.&lt;br /&gt;
[[File:New_ip.png]]&lt;br /&gt;
&lt;br /&gt;
The following recipes(.rb files), scripts and node specific files were created to achieve automatic deployment. Other pre-installed files and folder for Chef cookbook can be found in the git repository mentioned above.&lt;br /&gt;
&lt;br /&gt;
3. Next, &lt;br /&gt;
&lt;br /&gt;
'''setup_vps.sh''' : This will run the knife tool that will setup Chef-solo on the node and  will execute the recipes.&lt;br /&gt;
This needs to be from the directory where it present. The bash command in following format has to be used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sh setup_vps.sh &amp;lt;node_username&amp;gt; &amp;lt;node_ip_address&amp;gt; &amp;lt;node_port&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:New setup vps.png]]&lt;br /&gt;
&lt;br /&gt;
'''default.rb''' : This updates the Ubuntu machine packages, install the list of prerequisite packages and sets the time zone.&lt;br /&gt;
[[File:New default.png]]&lt;br /&gt;
&lt;br /&gt;
'''expertiza_clone''' : This recipes creates a directory and clones the  Expertiza git source code in that directory.&lt;br /&gt;
[[File:New expertiza clone.png ]]&lt;br /&gt;
&lt;br /&gt;
'''set_java_home''': This recipe sets the Java configuration. It then bundle installs all the gems used by the Expertiza.&lt;br /&gt;
[[File:New_set_java.png]]&lt;br /&gt;
&lt;br /&gt;
'''mysql.rb''' : It installs the MySQL server , MySQL client and its associated dependencies. The root password is preloaded and then fetched on installation by setting DEBIAN_FRONTEND environment variable.&lt;br /&gt;
[[File:New sql.png]]&lt;br /&gt;
'''nginx.rb''' : This recipe installs nginx which is web proxy server that will listen on user defined port and redirect the requests for static content (images, css, javascript) to the public folder of Experiza rails app.&lt;br /&gt;
[[File:New_nginx.png ]]&lt;br /&gt;
'''unicorn.rb''' : It will install and configure Unicorn web server used in production environment to handle high traffic and achieve load balancing . All the requests for dynamic content will go through it.&lt;br /&gt;
&lt;br /&gt;
[[File:New start server.png.JPG]]&lt;br /&gt;
&lt;br /&gt;
[[File:New database.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New_unicorn_corn.png]]&lt;br /&gt;
&lt;br /&gt;
==Github link==&lt;br /&gt;
https://github.com/amurark/expertiza&lt;br /&gt;
&lt;br /&gt;
==Points for the reviewer==&lt;br /&gt;
&lt;br /&gt;
While reviewing this project, please consider the following points:&lt;br /&gt;
&lt;br /&gt;
*1. There is no scope for testing in our project. This has been discussed and approved by the mentor. &lt;br /&gt;
*2. There is no scope for UML diagrams for this project, as there are no classes/interface involved.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100545</id>
		<title>CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100545"/>
		<updated>2015-12-16T10:13:48Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: /* Expertiza Deployment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction to Expertiza==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is a web application to create reusable learning objects through peer review. It supports various features such as team projects and the submission of various documents including URLs and wiki pages. It is being used extensively across various universities for select courses.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Currently, setting up the infrastructure for expertiza is done manually. The task is to write a Chef-solo&amp;lt;ref&amp;gt;[https://docs.chef.io/chef_solo.html Chef Solo]&amp;lt;/ref&amp;gt; recipe which will create a production ready environment for expertiza. Chef-solo recipes are Ruby&amp;lt;ref&amp;gt;[https://www.ruby-lang.org/en/ Ruby]&amp;lt;/ref&amp;gt; code.&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
&lt;br /&gt;
We need to provide a single step setup of expertiza for production.&lt;br /&gt;
&lt;br /&gt;
*It should include setting up the basic environment, application dependency, configuration setup and database setup.&lt;br /&gt;
*It should also include recipe for regular deployment.&lt;br /&gt;
&lt;br /&gt;
==Some Terminology==&lt;br /&gt;
===Chef Solo&amp;lt;ref&amp;gt;https://docs.chef.io/chef_solo.html&amp;lt;/ref&amp;gt;=== &lt;br /&gt;
Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each organization is comprised of one(or more) workstations, a single server, and every node that will be configured and maintained by the chef-client. Cookbooks (and recipes) are used to tell the chef-client how each node in your organization should be configured. The chef-client(which is installed on every node) does the actual configuration.&lt;br /&gt;
&lt;br /&gt;
*'''Node:'''&lt;br /&gt;
:A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.&lt;br /&gt;
&lt;br /&gt;
*'''Recipe: ''' &lt;br /&gt;
:A recipe specifies the resources to use and the order in which they are to be applied. It is mostly a collection of resources, defined using patterns(resource names, attribute-value pairs, and actions). A recipe       must define everything that is required to configure part of a system.&lt;br /&gt;
&lt;br /&gt;
*'''Cookbook:''' &lt;br /&gt;
:A cookbook is the fundamental unit of configuration and policy distribution. A cookbook defines a scenario and contains everything that is required to support that scenario.&lt;br /&gt;
&lt;br /&gt;
*'''WorkStation:'''&lt;br /&gt;
:A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery. &lt;br /&gt;
:The workstation is the location from which most users do most of their work.&lt;br /&gt;
:One(or more) workstations are configured to allow users to author, test, and maintain cookbooks. Cookbooks are uploaded to the Chef server from the workstation.&lt;br /&gt;
&lt;br /&gt;
*'''Chef Server:'''&lt;br /&gt;
:The Chef server acts as a hub of information. Cookbooks and policy settings are uploaded to the Chef server by users from workstations.&lt;br /&gt;
&lt;br /&gt;
*'''Chef-client:'''&lt;br /&gt;
:The chef-client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL for specific resources&lt;br /&gt;
&lt;br /&gt;
===Nginx===&lt;br /&gt;
&lt;br /&gt;
Nginx is a free, open-source, high-performance [HTTP] server and reverse proxy&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/glossary/reverse-proxy-server/]&amp;lt;/ref&amp;gt;, as well as an IMAP&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol&amp;lt;/ref&amp;gt;/POP3&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Post_Office_Protocol&amp;lt;/ref&amp;gt; proxy server. Nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/wiki/ Nginx Sever]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unicorn===&lt;br /&gt;
&lt;br /&gt;
Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.  Slow clients should only be served by placing a reverse proxy capable of fully buffering both the the request and response in between unicorn and slow clients.&lt;br /&gt;
&amp;lt;ref&amp;gt;[https://github.com/defunkt/unicorn Unicorn Web Server]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Plan of Action==&lt;br /&gt;
===Steps to Implement the Automated Deployment Process===&lt;br /&gt;
&lt;br /&gt;
[[File:Img01ExpInfra.png | frame|none|Expertiza Virtual Infrastructure]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Setup a virtual Vanilla&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Vanilla_software Vanilla]&amp;lt;/ref&amp;gt; Ubuntu&amp;lt;ref&amp;gt;[http://www.ubuntu.com Ubuntu]&amp;lt;/ref&amp;gt; Machine.&lt;br /&gt;
&lt;br /&gt;
2. Update the Ubuntu to the specified version.&lt;br /&gt;
&lt;br /&gt;
3. Clone Expertiza from Github.&lt;br /&gt;
&lt;br /&gt;
4. Install packages for Java, Ruby and all the ruby dependencies.&lt;br /&gt;
&lt;br /&gt;
5. Bundle install, install all gems&lt;br /&gt;
&lt;br /&gt;
6. Install MYSQL&amp;lt;ref&amp;gt;[https://mysql.com Mysql server]&amp;lt;/ref&amp;gt;, configure it and migrate databases.&lt;br /&gt;
&lt;br /&gt;
7. Install Unicorn gem. Unicorn is a Rack&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Rack_%28web_server_interface%29 Rack Server]&amp;lt;/ref&amp;gt; HTTP server that uses forked processes to handle multiple incoming requests concurrently. For expertiza, unicorn is being used as the web server, which will interact with the database servers to fetch the data.&lt;br /&gt;
&lt;br /&gt;
8. Make changes in the nginx configuration.&lt;br /&gt;
&lt;br /&gt;
9. Install nginx. Nginx is a web server. It is being used in the Expertiza architecture as a reverse proxy server. Through nginx, we will also attempt to serve static pages directly.&lt;br /&gt;
&lt;br /&gt;
10. Configure Unicorn and integrate it to work with nginx.&lt;br /&gt;
&lt;br /&gt;
11. Start both Unicorn and Nginx server.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Stack==&lt;br /&gt;
&lt;br /&gt;
[[File:Exp1.png]]&lt;br /&gt;
&lt;br /&gt;
The above visually describes the expertiza stack on the virtual machine. The stack includes nginx as the front end, web server which will redirect the requests to the unicorn server. The scope of the project includes just 1 unicorn server but the recipe will be written in a way that later modifications can be made to add more than 1 unicorn servers under a load balancer. The unicorn server will interact with the database server and write/fetch data into it.&lt;br /&gt;
&lt;br /&gt;
==Chef-Solo Recipe Example==&lt;br /&gt;
Chef solo has cookbooks and recipes. An example of recipes is as follows:&lt;br /&gt;
    package &amp;quot;git-core&amp;quot; #apt-get install git-core&lt;br /&gt;
&lt;br /&gt;
    user node[:user][:name] do&lt;br /&gt;
        password node[:user][:password]&lt;br /&gt;
        gid &amp;quot;admin&amp;quot;&lt;br /&gt;
        home &amp;quot;/home/#{node[:user][:name]}&amp;quot;&lt;br /&gt;
        supports :manage_home =&amp;gt; true&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
This recipe orchestrates the installation of git-core and creates a new user and sets its privileges and password along with the home directory. Similarly, the plan of action is to write recipes for downloading, installing and configuring various components(nginx, unicorn, RMV, Ruby, MYSQL etc.) which will contribute towards building the infrastructure of expertiza.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Deployment==&lt;br /&gt;
&lt;br /&gt;
1. We first created a droplet( virtual private server) using digital ocean&amp;lt;ref&amp;gt;https://www.digitalocean.com/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Drop.png]]&lt;br /&gt;
&lt;br /&gt;
2. We recorded the IP address of the newly created droplet and created the associated &amp;lt;ipaddress&amp;gt;.json file.&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;ipaddress&amp;gt;.json''' : This file holds all the node specific values required to install services and config node.&lt;br /&gt;
We will set node_user , user_hash_password , ruby version , mysql root &amp;amp; password . The main function apart from holding node variables is to run recipes in a specific code.&lt;br /&gt;
&lt;br /&gt;
[[File:New_ip.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following recipes(.rb files), scripts and node specific files were created to achieve automatic deployment. Other pre-installed files and folder for Chef cookbook can be found in the git repository mentioned above.&lt;br /&gt;
&lt;br /&gt;
3. Next, &lt;br /&gt;
&lt;br /&gt;
'''setup_vps.sh''' : This will run the knife tool that will setup Chef-solo on the node and  will execute the recipes.&lt;br /&gt;
This needs to be from the directory where it present. The bash command in following format has to be used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sh setup_vps.sh &amp;lt;node_username&amp;gt; &amp;lt;node_ip_address&amp;gt; &amp;lt;node_port&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New setup vps.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''default.rb''' : This updates the Ubuntu machine packages, install the list of prerequisite packages and sets the time zone.&lt;br /&gt;
[[File:New default.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''expertiza_clone''' : This recipes creates a directory and clones the  Expertiza git source code in that directory.&lt;br /&gt;
[[File:New expertiza clone.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''set_java_home''': This recipe sets the Java configuration. It then bundle installs all the gems used by the Expertiza.&lt;br /&gt;
[[File:New_set_java.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''mysql.rb''' : It installs the MySQL server , MySQL client and its associated dependencies. The root password is preloaded and then fetched on installation by setting DEBIAN_FRONTEND environment variable.&lt;br /&gt;
&lt;br /&gt;
[[File:New sql.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''nginx.rb''' : This recipe installs nginx which is web proxy server that will listen on user defined port and redirect the requests for static content (images, css, javascript) to the public folder of Experiza rails app.&lt;br /&gt;
&lt;br /&gt;
[[File:New_nginx.png ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''unicorn.rb''' : It will install and configure Unicorn web server used in production environment to handle high traffic and achieve load balancing . All the requests for dynamic content will go through it.&lt;br /&gt;
[[File:New start server.png.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New database.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New_unicorn_corn.png]]&lt;br /&gt;
&lt;br /&gt;
==Github link==&lt;br /&gt;
https://github.com/amurark/expertiza&lt;br /&gt;
&lt;br /&gt;
==Points for the reviewer==&lt;br /&gt;
&lt;br /&gt;
While reviewing this project, please consider the following points:&lt;br /&gt;
&lt;br /&gt;
*1. There is no scope for testing in our project. This has been discussed and approved by the mentor. &lt;br /&gt;
*2. There is no scope for UML diagrams for this project, as there are no classes/interface involved.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_sql.png&amp;diff=100544</id>
		<title>File:New sql.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_sql.png&amp;diff=100544"/>
		<updated>2015-12-16T10:13:22Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_unicorn_corn.png&amp;diff=100543</id>
		<title>File:New unicorn corn.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_unicorn_corn.png&amp;diff=100543"/>
		<updated>2015-12-16T10:12:10Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_start_server.png&amp;diff=100542</id>
		<title>File:New start server.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_start_server.png&amp;diff=100542"/>
		<updated>2015-12-16T10:08:54Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_setup_vps.png&amp;diff=100541</id>
		<title>File:New setup vps.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_setup_vps.png&amp;diff=100541"/>
		<updated>2015-12-16T10:08:21Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_set_java.png&amp;diff=100540</id>
		<title>File:New set java.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_set_java.png&amp;diff=100540"/>
		<updated>2015-12-16T10:07:31Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_nginx.png&amp;diff=100539</id>
		<title>File:New nginx.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_nginx.png&amp;diff=100539"/>
		<updated>2015-12-16T10:06:55Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_ip.png&amp;diff=100538</id>
		<title>File:New ip.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_ip.png&amp;diff=100538"/>
		<updated>2015-12-16T10:06:27Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_expertiza_clone.png&amp;diff=100537</id>
		<title>File:New expertiza clone.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_expertiza_clone.png&amp;diff=100537"/>
		<updated>2015-12-16T10:05:42Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100536</id>
		<title>CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100536"/>
		<updated>2015-12-16T10:04:15Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: /* Expertiza Deployment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction to Expertiza==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is a web application to create reusable learning objects through peer review. It supports various features such as team projects and the submission of various documents including URLs and wiki pages. It is being used extensively across various universities for select courses.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Currently, setting up the infrastructure for expertiza is done manually. The task is to write a Chef-solo&amp;lt;ref&amp;gt;[https://docs.chef.io/chef_solo.html Chef Solo]&amp;lt;/ref&amp;gt; recipe which will create a production ready environment for expertiza. Chef-solo recipes are Ruby&amp;lt;ref&amp;gt;[https://www.ruby-lang.org/en/ Ruby]&amp;lt;/ref&amp;gt; code.&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
&lt;br /&gt;
We need to provide a single step setup of expertiza for production.&lt;br /&gt;
&lt;br /&gt;
*It should include setting up the basic environment, application dependency, configuration setup and database setup.&lt;br /&gt;
*It should also include recipe for regular deployment.&lt;br /&gt;
&lt;br /&gt;
==Some Terminology==&lt;br /&gt;
===Chef Solo&amp;lt;ref&amp;gt;https://docs.chef.io/chef_solo.html&amp;lt;/ref&amp;gt;=== &lt;br /&gt;
Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each organization is comprised of one(or more) workstations, a single server, and every node that will be configured and maintained by the chef-client. Cookbooks (and recipes) are used to tell the chef-client how each node in your organization should be configured. The chef-client(which is installed on every node) does the actual configuration.&lt;br /&gt;
&lt;br /&gt;
*'''Node:'''&lt;br /&gt;
:A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.&lt;br /&gt;
&lt;br /&gt;
*'''Recipe: ''' &lt;br /&gt;
:A recipe specifies the resources to use and the order in which they are to be applied. It is mostly a collection of resources, defined using patterns(resource names, attribute-value pairs, and actions). A recipe       must define everything that is required to configure part of a system.&lt;br /&gt;
&lt;br /&gt;
*'''Cookbook:''' &lt;br /&gt;
:A cookbook is the fundamental unit of configuration and policy distribution. A cookbook defines a scenario and contains everything that is required to support that scenario.&lt;br /&gt;
&lt;br /&gt;
*'''WorkStation:'''&lt;br /&gt;
:A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery. &lt;br /&gt;
:The workstation is the location from which most users do most of their work.&lt;br /&gt;
:One(or more) workstations are configured to allow users to author, test, and maintain cookbooks. Cookbooks are uploaded to the Chef server from the workstation.&lt;br /&gt;
&lt;br /&gt;
*'''Chef Server:'''&lt;br /&gt;
:The Chef server acts as a hub of information. Cookbooks and policy settings are uploaded to the Chef server by users from workstations.&lt;br /&gt;
&lt;br /&gt;
*'''Chef-client:'''&lt;br /&gt;
:The chef-client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL for specific resources&lt;br /&gt;
&lt;br /&gt;
===Nginx===&lt;br /&gt;
&lt;br /&gt;
Nginx is a free, open-source, high-performance [HTTP] server and reverse proxy&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/glossary/reverse-proxy-server/]&amp;lt;/ref&amp;gt;, as well as an IMAP&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol&amp;lt;/ref&amp;gt;/POP3&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Post_Office_Protocol&amp;lt;/ref&amp;gt; proxy server. Nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/wiki/ Nginx Sever]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unicorn===&lt;br /&gt;
&lt;br /&gt;
Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.  Slow clients should only be served by placing a reverse proxy capable of fully buffering both the the request and response in between unicorn and slow clients.&lt;br /&gt;
&amp;lt;ref&amp;gt;[https://github.com/defunkt/unicorn Unicorn Web Server]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Plan of Action==&lt;br /&gt;
===Steps to Implement the Automated Deployment Process===&lt;br /&gt;
&lt;br /&gt;
[[File:Img01ExpInfra.png | frame|none|Expertiza Virtual Infrastructure]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Setup a virtual Vanilla&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Vanilla_software Vanilla]&amp;lt;/ref&amp;gt; Ubuntu&amp;lt;ref&amp;gt;[http://www.ubuntu.com Ubuntu]&amp;lt;/ref&amp;gt; Machine.&lt;br /&gt;
&lt;br /&gt;
2. Update the Ubuntu to the specified version.&lt;br /&gt;
&lt;br /&gt;
3. Clone Expertiza from Github.&lt;br /&gt;
&lt;br /&gt;
4. Install packages for Java, Ruby and all the ruby dependencies.&lt;br /&gt;
&lt;br /&gt;
5. Bundle install, install all gems&lt;br /&gt;
&lt;br /&gt;
6. Install MYSQL&amp;lt;ref&amp;gt;[https://mysql.com Mysql server]&amp;lt;/ref&amp;gt;, configure it and migrate databases.&lt;br /&gt;
&lt;br /&gt;
7. Install Unicorn gem. Unicorn is a Rack&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Rack_%28web_server_interface%29 Rack Server]&amp;lt;/ref&amp;gt; HTTP server that uses forked processes to handle multiple incoming requests concurrently. For expertiza, unicorn is being used as the web server, which will interact with the database servers to fetch the data.&lt;br /&gt;
&lt;br /&gt;
8. Make changes in the nginx configuration.&lt;br /&gt;
&lt;br /&gt;
9. Install nginx. Nginx is a web server. It is being used in the Expertiza architecture as a reverse proxy server. Through nginx, we will also attempt to serve static pages directly.&lt;br /&gt;
&lt;br /&gt;
10. Configure Unicorn and integrate it to work with nginx.&lt;br /&gt;
&lt;br /&gt;
11. Start both Unicorn and Nginx server.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Stack==&lt;br /&gt;
&lt;br /&gt;
[[File:Exp1.png]]&lt;br /&gt;
&lt;br /&gt;
The above visually describes the expertiza stack on the virtual machine. The stack includes nginx as the front end, web server which will redirect the requests to the unicorn server. The scope of the project includes just 1 unicorn server but the recipe will be written in a way that later modifications can be made to add more than 1 unicorn servers under a load balancer. The unicorn server will interact with the database server and write/fetch data into it.&lt;br /&gt;
&lt;br /&gt;
==Chef-Solo Recipe Example==&lt;br /&gt;
Chef solo has cookbooks and recipes. An example of recipes is as follows:&lt;br /&gt;
    package &amp;quot;git-core&amp;quot; #apt-get install git-core&lt;br /&gt;
&lt;br /&gt;
    user node[:user][:name] do&lt;br /&gt;
        password node[:user][:password]&lt;br /&gt;
        gid &amp;quot;admin&amp;quot;&lt;br /&gt;
        home &amp;quot;/home/#{node[:user][:name]}&amp;quot;&lt;br /&gt;
        supports :manage_home =&amp;gt; true&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
This recipe orchestrates the installation of git-core and creates a new user and sets its privileges and password along with the home directory. Similarly, the plan of action is to write recipes for downloading, installing and configuring various components(nginx, unicorn, RMV, Ruby, MYSQL etc.) which will contribute towards building the infrastructure of expertiza.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Deployment==&lt;br /&gt;
&lt;br /&gt;
1. We first created a droplet( virtual private server) using digital ocean&amp;lt;ref&amp;gt;https://www.digitalocean.com/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Drop.png]]&lt;br /&gt;
&lt;br /&gt;
2. We recorded the IP address of the newly created droplet and created the associated &amp;lt;ipaddress&amp;gt;.json file.&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;ipaddress&amp;gt;.json''' : This file holds all the node specific values required to install services and config node.&lt;br /&gt;
We will set node_user , user_hash_password , ruby version , mysql root &amp;amp; password . The main function apart from holding node variables is to run recipes in a specific code.&lt;br /&gt;
&lt;br /&gt;
[[File:Ipjson.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following recipes(.rb files), scripts and node specific files were created to achieve automatic deployment. Other pre-installed files and folder for Chef cookbook can be found in the git repository mentioned above.&lt;br /&gt;
&lt;br /&gt;
3. Next, &lt;br /&gt;
&lt;br /&gt;
'''setup_vps.sh''' : This will run the knife tool that will setup Chef-solo on the node and  will execute the recipes.&lt;br /&gt;
This needs to be from the directory where it present. The bash command in following format has to be used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sh setup_vps.sh &amp;lt;node_username&amp;gt; &amp;lt;node_ip_address&amp;gt; &amp;lt;node_port&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Setup vps sh.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''default.rb''' : This updates the Ubuntu machine packages, install the list of prerequisite packages and sets the time zone.&lt;br /&gt;
[[File:New default.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''expertiza_clone''' : This recipes creates a directory and clones the  Expertiza git source code in that directory.&lt;br /&gt;
[[File:Expertiza clone rb.JPG ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''set_java_home''': This recipe sets the Java configuration. It then bundle installs all the gems used by the Expertiza.&lt;br /&gt;
[[File:Set java home rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''mysql.rb''' : It installs the MySQL server , MySQL client and its associated dependencies. The root password is preloaded and then fetched on installation by setting DEBIAN_FRONTEND environment variable.&lt;br /&gt;
&lt;br /&gt;
[[File:Mysql rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''nginx.rb''' : This recipe installs nginx which is web proxy server that will listen on user defined port and redirect the requests for static content (images, css, javascript) to the public folder of Experiza rails app.&lt;br /&gt;
&lt;br /&gt;
[[File:NGINX rb.JPG ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''unicorn.rb''' : It will install and configure Unicorn web server used in production environment to handle high traffic and achieve load balancing . All the requests for dynamic content will go through it.&lt;br /&gt;
[[File:Start server rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:New database.png]]&lt;br /&gt;
&lt;br /&gt;
==Github link==&lt;br /&gt;
https://github.com/amurark/expertiza&lt;br /&gt;
&lt;br /&gt;
==Points for the reviewer==&lt;br /&gt;
&lt;br /&gt;
While reviewing this project, please consider the following points:&lt;br /&gt;
&lt;br /&gt;
*1. There is no scope for testing in our project. This has been discussed and approved by the mentor. &lt;br /&gt;
*2. There is no scope for UML diagrams for this project, as there are no classes/interface involved.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_database.png&amp;diff=100535</id>
		<title>File:New database.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_database.png&amp;diff=100535"/>
		<updated>2015-12-16T10:03:20Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100533</id>
		<title>CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100533"/>
		<updated>2015-12-16T09:47:23Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: /* Expertiza Deployment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction to Expertiza==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is a web application to create reusable learning objects through peer review. It supports various features such as team projects and the submission of various documents including URLs and wiki pages. It is being used extensively across various universities for select courses.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Currently, setting up the infrastructure for expertiza is done manually. The task is to write a Chef-solo&amp;lt;ref&amp;gt;[https://docs.chef.io/chef_solo.html Chef Solo]&amp;lt;/ref&amp;gt; recipe which will create a production ready environment for expertiza. Chef-solo recipes are Ruby&amp;lt;ref&amp;gt;[https://www.ruby-lang.org/en/ Ruby]&amp;lt;/ref&amp;gt; code.&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
&lt;br /&gt;
We need to provide a single step setup of expertiza for production.&lt;br /&gt;
&lt;br /&gt;
*It should include setting up the basic environment, application dependency, configuration setup and database setup.&lt;br /&gt;
*It should also include recipe for regular deployment.&lt;br /&gt;
&lt;br /&gt;
==Some Terminology==&lt;br /&gt;
===Chef Solo&amp;lt;ref&amp;gt;https://docs.chef.io/chef_solo.html&amp;lt;/ref&amp;gt;=== &lt;br /&gt;
Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each organization is comprised of one(or more) workstations, a single server, and every node that will be configured and maintained by the chef-client. Cookbooks (and recipes) are used to tell the chef-client how each node in your organization should be configured. The chef-client(which is installed on every node) does the actual configuration.&lt;br /&gt;
&lt;br /&gt;
*'''Node:'''&lt;br /&gt;
:A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.&lt;br /&gt;
&lt;br /&gt;
*'''Recipe: ''' &lt;br /&gt;
:A recipe specifies the resources to use and the order in which they are to be applied. It is mostly a collection of resources, defined using patterns(resource names, attribute-value pairs, and actions). A recipe       must define everything that is required to configure part of a system.&lt;br /&gt;
&lt;br /&gt;
*'''Cookbook:''' &lt;br /&gt;
:A cookbook is the fundamental unit of configuration and policy distribution. A cookbook defines a scenario and contains everything that is required to support that scenario.&lt;br /&gt;
&lt;br /&gt;
*'''WorkStation:'''&lt;br /&gt;
:A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery. &lt;br /&gt;
:The workstation is the location from which most users do most of their work.&lt;br /&gt;
:One(or more) workstations are configured to allow users to author, test, and maintain cookbooks. Cookbooks are uploaded to the Chef server from the workstation.&lt;br /&gt;
&lt;br /&gt;
*'''Chef Server:'''&lt;br /&gt;
:The Chef server acts as a hub of information. Cookbooks and policy settings are uploaded to the Chef server by users from workstations.&lt;br /&gt;
&lt;br /&gt;
*'''Chef-client:'''&lt;br /&gt;
:The chef-client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL for specific resources&lt;br /&gt;
&lt;br /&gt;
===Nginx===&lt;br /&gt;
&lt;br /&gt;
Nginx is a free, open-source, high-performance [HTTP] server and reverse proxy&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/glossary/reverse-proxy-server/]&amp;lt;/ref&amp;gt;, as well as an IMAP&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol&amp;lt;/ref&amp;gt;/POP3&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Post_Office_Protocol&amp;lt;/ref&amp;gt; proxy server. Nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/wiki/ Nginx Sever]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unicorn===&lt;br /&gt;
&lt;br /&gt;
Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.  Slow clients should only be served by placing a reverse proxy capable of fully buffering both the the request and response in between unicorn and slow clients.&lt;br /&gt;
&amp;lt;ref&amp;gt;[https://github.com/defunkt/unicorn Unicorn Web Server]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Plan of Action==&lt;br /&gt;
===Steps to Implement the Automated Deployment Process===&lt;br /&gt;
&lt;br /&gt;
[[File:Img01ExpInfra.png | frame|none|Expertiza Virtual Infrastructure]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Setup a virtual Vanilla&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Vanilla_software Vanilla]&amp;lt;/ref&amp;gt; Ubuntu&amp;lt;ref&amp;gt;[http://www.ubuntu.com Ubuntu]&amp;lt;/ref&amp;gt; Machine.&lt;br /&gt;
&lt;br /&gt;
2. Update the ubuntu to the specified version.&lt;br /&gt;
&lt;br /&gt;
3. Install packages for Ruby and all the ruby dependencies.&lt;br /&gt;
&lt;br /&gt;
4. Install MYSQL&amp;lt;ref&amp;gt;[https://mysql.com Mysql server]&amp;lt;/ref&amp;gt; and configure it.&lt;br /&gt;
&lt;br /&gt;
5. Install Unicorn gem. Unicorn is a Rack&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Rack_%28web_server_interface%29 Rack Server]&amp;lt;/ref&amp;gt; HTTP server that uses forked processes to handle multiple incoming requests concurrently. For expertiza, unicorn is being used as the web server, which will interact with the database servers to fetch the data.&lt;br /&gt;
&lt;br /&gt;
6. Bundle install, install gems and migrate databases.&lt;br /&gt;
&lt;br /&gt;
7. Install nginx. Nginx is a web server. It is being used in the Expertiza architecture as a reverse proxy server. Through nginx, we will also attempt to serve static pages directly.&lt;br /&gt;
&lt;br /&gt;
8. Make changes in the nginx configuration.&lt;br /&gt;
&lt;br /&gt;
9. Configure Unicorn and integrate it to work with nginx.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Stack==&lt;br /&gt;
&lt;br /&gt;
[[File:Exp1.png]]&lt;br /&gt;
&lt;br /&gt;
The above visually describes the expertiza stack on the virtual machine. The stack includes nginx as the front end, web server which will redirect the requests to the unicorn server. The scope of the project includes just 1 unicorn server but the recipe will be written in a way that later modifications can be made to add more than 1 unicorn servers under a load balancer. The unicorn server will interact with the database server and write/fetch data into it.&lt;br /&gt;
&lt;br /&gt;
==Chef-Solo Recipe Example==&lt;br /&gt;
Chef solo has cookbooks and recipes. An example of recipes is as follows:&lt;br /&gt;
    package &amp;quot;git-core&amp;quot; #apt-get install git-core&lt;br /&gt;
&lt;br /&gt;
    user node[:user][:name] do&lt;br /&gt;
        password node[:user][:password]&lt;br /&gt;
        gid &amp;quot;admin&amp;quot;&lt;br /&gt;
        home &amp;quot;/home/#{node[:user][:name]}&amp;quot;&lt;br /&gt;
        supports :manage_home =&amp;gt; true&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
This recipe orchestrates the installation of git-core and creates a new user and sets its privileges and password along with the home directory. Similarly, the plan of action is to write recipes for downloading, installing and configuring various components(nginx, unicorn, RMV, Ruby, MYSQL etc.) which will contribute towards building the infrastructure of expertiza.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Deployment==&lt;br /&gt;
&lt;br /&gt;
1. We first created a droplet( virtual private server) using digital ocean&amp;lt;ref&amp;gt;https://www.digitalocean.com/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Drop.png]]&lt;br /&gt;
&lt;br /&gt;
2. We recorded the IP address of the newly created droplet and created the associated &amp;lt;ipaddress&amp;gt;.json file.&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;ipaddress&amp;gt;.json''' : This file holds all the node specific values required to install services and config node.&lt;br /&gt;
We will set node_user , user_hash_password , ruby version , mysql root &amp;amp; password . The main function apart from holding node variables is to run recipes in a specific code.&lt;br /&gt;
&lt;br /&gt;
[[File:Ipjson.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following recipes(.rb files), scripts and node specific files were created to achieve automatic deployment. Other pre-installed files and folder for Chef cookbook can be found in the git repository mentioned above.&lt;br /&gt;
&lt;br /&gt;
3. Next, &lt;br /&gt;
&lt;br /&gt;
'''setup_vps.sh''' : This will run the knife tool that will setup Chef-solo on the node and  will execute the recipes.&lt;br /&gt;
This needs to be from the directory where it present. The bash command in following format has to be used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sh setup_vps.sh &amp;lt;node_username&amp;gt; &amp;lt;node_ip_address&amp;gt; &amp;lt;node_port&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Setup vps sh.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''default.rb''' : This updates the Ubuntu machine packages, install the list of prerequisite packages and sets the time zone.&lt;br /&gt;
[[File:New default.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''expertiza_clone''' : This recipes creates a directory and clones the  Expertiza git source code in that directory.&lt;br /&gt;
[[File:Expertiza clone rb.JPG ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''set_java_home''': This recipe sets the Java configuration. It then bundle installs all the gems used by the Expertiza.&lt;br /&gt;
[[File:Set java home rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''mysql.rb''' : It installs the MySQL server , MySQL client and its associated dependencies. The root password is preloaded and then fetched on installation by setting DEBIAN_FRONTEND environment variable.&lt;br /&gt;
&lt;br /&gt;
[[File:Mysql rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''nginx.rb''' : This recipe installs nginx which is web proxy server that will listen on user defined port and redirect the requests for static content (images, css, javascript) to the public folder of Experiza rails app.&lt;br /&gt;
&lt;br /&gt;
[[File:NGINX rb.JPG ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''unicorn.rb''' : It will install and configure Unicorn web server used in production environment to handle high traffic and achieve load balancing . All the requests for dynamic content will go through it.&lt;br /&gt;
[[File:Start server rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
==Github link==&lt;br /&gt;
https://github.com/amurark/expertiza&lt;br /&gt;
&lt;br /&gt;
==Points for the reviewer==&lt;br /&gt;
&lt;br /&gt;
While reviewing this project, please consider the following points:&lt;br /&gt;
&lt;br /&gt;
*1. There is no scope for testing in our project. This has been discussed and approved by the mentor. &lt;br /&gt;
*2. There is no scope for UML diagrams for this project, as there are no classes/interface involved.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_default.png&amp;diff=100532</id>
		<title>File:New default.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_default.png&amp;diff=100532"/>
		<updated>2015-12-16T09:46:33Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100529</id>
		<title>CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100529"/>
		<updated>2015-12-16T09:03:05Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: /* Expertiza Deployment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction to Expertiza==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is a web application to create reusable learning objects through peer review. It supports various features such as team projects and the submission of various documents including URLs and wiki pages. It is being used extensively across various universities for select courses.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Currently, setting up the infrastructure for expertiza is done manually. The task is to write a Chef-solo&amp;lt;ref&amp;gt;[https://docs.chef.io/chef_solo.html Chef Solo]&amp;lt;/ref&amp;gt; recipe which will create a production ready environment for expertiza. Chef-solo recipes are Ruby&amp;lt;ref&amp;gt;[https://www.ruby-lang.org/en/ Ruby]&amp;lt;/ref&amp;gt; code.&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
&lt;br /&gt;
We need to provide a single step setup of expertiza for production.&lt;br /&gt;
&lt;br /&gt;
*It should include setting up the basic environment, application dependency, configuration setup and database setup.&lt;br /&gt;
*It should also include recipe for regular deployment.&lt;br /&gt;
&lt;br /&gt;
==Some Terminology==&lt;br /&gt;
===Chef Solo&amp;lt;ref&amp;gt;https://docs.chef.io/chef_solo.html&amp;lt;/ref&amp;gt;=== &lt;br /&gt;
Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each organization is comprised of one(or more) workstations, a single server, and every node that will be configured and maintained by the chef-client. Cookbooks (and recipes) are used to tell the chef-client how each node in your organization should be configured. The chef-client(which is installed on every node) does the actual configuration.&lt;br /&gt;
&lt;br /&gt;
*'''Node:'''&lt;br /&gt;
:A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.&lt;br /&gt;
&lt;br /&gt;
*'''Recipe: ''' &lt;br /&gt;
:A recipe specifies the resources to use and the order in which they are to be applied. It is mostly a collection of resources, defined using patterns(resource names, attribute-value pairs, and actions). A recipe       must define everything that is required to configure part of a system.&lt;br /&gt;
&lt;br /&gt;
*'''Cookbook:''' &lt;br /&gt;
:A cookbook is the fundamental unit of configuration and policy distribution. A cookbook defines a scenario and contains everything that is required to support that scenario.&lt;br /&gt;
&lt;br /&gt;
*'''WorkStation:'''&lt;br /&gt;
:A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery. &lt;br /&gt;
:The workstation is the location from which most users do most of their work.&lt;br /&gt;
:One(or more) workstations are configured to allow users to author, test, and maintain cookbooks. Cookbooks are uploaded to the Chef server from the workstation.&lt;br /&gt;
&lt;br /&gt;
*'''Chef Server:'''&lt;br /&gt;
:The Chef server acts as a hub of information. Cookbooks and policy settings are uploaded to the Chef server by users from workstations.&lt;br /&gt;
&lt;br /&gt;
*'''Chef-client:'''&lt;br /&gt;
:The chef-client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL for specific resources&lt;br /&gt;
&lt;br /&gt;
===Nginx===&lt;br /&gt;
&lt;br /&gt;
Nginx is a free, open-source, high-performance [HTTP] server and reverse proxy&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/glossary/reverse-proxy-server/]&amp;lt;/ref&amp;gt;, as well as an IMAP&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol&amp;lt;/ref&amp;gt;/POP3&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Post_Office_Protocol&amp;lt;/ref&amp;gt; proxy server. Nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/wiki/ Nginx Sever]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unicorn===&lt;br /&gt;
&lt;br /&gt;
Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.  Slow clients should only be served by placing a reverse proxy capable of fully buffering both the the request and response in between unicorn and slow clients.&lt;br /&gt;
&amp;lt;ref&amp;gt;[https://github.com/defunkt/unicorn Unicorn Web Server]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Plan of Action==&lt;br /&gt;
===Steps to Implement the Automated Deployment Process===&lt;br /&gt;
&lt;br /&gt;
[[File:Img01ExpInfra.png | frame|none|Expertiza Virtual Infrastructure]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Setup a virtual Vanilla&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Vanilla_software Vanilla]&amp;lt;/ref&amp;gt; Ubuntu&amp;lt;ref&amp;gt;[http://www.ubuntu.com Ubuntu]&amp;lt;/ref&amp;gt; Machine.&lt;br /&gt;
&lt;br /&gt;
2. Update the ubuntu to the specified version.&lt;br /&gt;
&lt;br /&gt;
3. Install nginx. Nginx is a web server. It is being used in the Expertiza architecture as a reverse proxy server. Through nginx, we will also attempt to serve static pages directly.&lt;br /&gt;
&lt;br /&gt;
4. Make changes in the nginx configuration.&lt;br /&gt;
&lt;br /&gt;
5. Install Ruby, RVM&amp;lt;ref&amp;gt;[https://rvm.io/ Ruby Virtual Machine]&amp;lt;/ref&amp;gt; and all the ruby dependencies.&lt;br /&gt;
&lt;br /&gt;
6. Install MYSQL&amp;lt;ref&amp;gt;[https://mysql.com Mysql server]&amp;lt;/ref&amp;gt; and configure it.&lt;br /&gt;
&lt;br /&gt;
7. Install Unicorn gem. Unicorn is a Rack&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Rack_%28web_server_interface%29 Rack Server]&amp;lt;/ref&amp;gt; HTTP server that uses forked processes to handle multiple incoming requests concurrently. For expertiza, unicorn is being used as the web server, which will interact with the database servers to fetch the data.&lt;br /&gt;
&lt;br /&gt;
8. Configure Unicorn and integrate it to work with nginx.&lt;br /&gt;
&lt;br /&gt;
9. Bundle install, install gems and migrate databases.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Stack==&lt;br /&gt;
&lt;br /&gt;
[[File:Exp1.png]]&lt;br /&gt;
&lt;br /&gt;
The above visually describes the expertiza stack on the virtual machine. The stack includes nginx as the front end, web server which will redirect the requests to the unicorn server. The scope of the project includes just 1 unicorn server but the recipe will be written in a way that later modifications can be made to add more than 1 unicorn servers under a load balancer. The unicorn server will interact with the database server and write/fetch data into it.&lt;br /&gt;
&lt;br /&gt;
==Chef-Solo Recipe Example==&lt;br /&gt;
Chef solo has cookbooks and recipes. An example of recipes is as follows:&lt;br /&gt;
    package &amp;quot;git-core&amp;quot; #apt-get install git-core&lt;br /&gt;
&lt;br /&gt;
    user node[:user][:name] do&lt;br /&gt;
        password node[:user][:password]&lt;br /&gt;
        gid &amp;quot;admin&amp;quot;&lt;br /&gt;
        home &amp;quot;/home/#{node[:user][:name]}&amp;quot;&lt;br /&gt;
        supports :manage_home =&amp;gt; true&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
This recipe orchestrates the installation of git-core and creates a new user and sets its privileges and password along with the home directory. Similarly, the plan of action is to write recipes for downloading, installing and configuring various components(nginx, unicorn, RMV, Ruby, MYSQL etc.) which will contribute towards building the infrastructure of expertiza.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Deployment==&lt;br /&gt;
&lt;br /&gt;
1. We first created a droplet( virtual private server) using digital ocean&amp;lt;ref&amp;gt;https://www.digitalocean.com/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Drop.png]]&lt;br /&gt;
&lt;br /&gt;
2. We recorded the IP address of the newly created droplet and created the associated &amp;lt;ipaddress&amp;gt;.json file.&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;ipaddress&amp;gt;.json''' : This file holds all the node specific values required to install services and config node.&lt;br /&gt;
We will set node_user , user_hash_password , ruby version , mysql root &amp;amp; password . The main function apart from holding node variables is to run recipes in a specific code.&lt;br /&gt;
&lt;br /&gt;
[[File:Ipjson.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following recipes(.rb files), scripts and node specific files were created to achieve automatic deployment. Other pre-installed files and folder for Chef cookbook can be found in the git repository mentioned above.&lt;br /&gt;
&lt;br /&gt;
3. Next, &lt;br /&gt;
&lt;br /&gt;
'''setup_vps.sh''' : This will run the knife tool that will setup Chef-solo on the node and  will execute the recipes.&lt;br /&gt;
This needs to be from the directory where it present. The bash command in following format has to be used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sh setup_vps.sh &amp;lt;node_username&amp;gt; &amp;lt;node_ip_address&amp;gt; &amp;lt;node_port&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Setup vps sh.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''default.rb''' : This updates the Ubuntu machine packages, install the list of prerequisite packages and sets the time zone.&lt;br /&gt;
[[File:Default rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''expertiza_clone''' : This recipes creates a directory and clones the  Expertiza git source code in that directory.&lt;br /&gt;
[[File:Expertiza clone rb.JPG ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''set_java_home''': This recipe sets the Java configuration. It then bundle installs all the gems used by the Expertiza.&lt;br /&gt;
[[File:Set java home rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''mysql.rb''' : It installs the MySQL server , MySQL client and its associated dependencies. The root password is preloaded and then fetched on installation by setting DEBIAN_FRONTEND environment variable.&lt;br /&gt;
&lt;br /&gt;
[[File:Mysql rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''nginx.rb''' : This recipe installs nginx which is web proxy server that will listen on user defined port and redirect the requests for static content (images, css, javascript) to the public folder of Experiza rails app.&lt;br /&gt;
&lt;br /&gt;
[[File:NGINX rb.JPG ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''unicorn.rb''' : It will install and configure Unicorn web server used in production environment to handle high traffic and achieve load balancing . All the requests for dynamic content will go through it.&lt;br /&gt;
[[File:Start server rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
==Github link==&lt;br /&gt;
https://github.com/amurark/expertiza&lt;br /&gt;
&lt;br /&gt;
==Points for the reviewer==&lt;br /&gt;
&lt;br /&gt;
While reviewing this project, please consider the following points:&lt;br /&gt;
&lt;br /&gt;
*1. There is no scope for testing in our project. This has been discussed and approved by the mentor. &lt;br /&gt;
*2. There is no scope for UML diagrams for this project, as there are no classes/interface involved.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100528</id>
		<title>CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100528"/>
		<updated>2015-12-16T08:38:15Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: /* Expertiza Deployment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction to Expertiza==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is a web application to create reusable learning objects through peer review. It supports various features such as team projects and the submission of various documents including URLs and wiki pages. It is being used extensively across various universities for select courses.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Currently, setting up the infrastructure for expertiza is done manually. The task is to write a Chef-solo&amp;lt;ref&amp;gt;[https://docs.chef.io/chef_solo.html Chef Solo]&amp;lt;/ref&amp;gt; recipe which will create a production ready environment for expertiza. Chef-solo recipes are Ruby&amp;lt;ref&amp;gt;[https://www.ruby-lang.org/en/ Ruby]&amp;lt;/ref&amp;gt; code.&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
&lt;br /&gt;
We need to provide a single step setup of expertiza for production.&lt;br /&gt;
&lt;br /&gt;
*It should include setting up the basic environment, application dependency, configuration setup and database setup.&lt;br /&gt;
*It should also include recipe for regular deployment.&lt;br /&gt;
&lt;br /&gt;
==Some Terminology==&lt;br /&gt;
===Chef Solo&amp;lt;ref&amp;gt;https://docs.chef.io/chef_solo.html&amp;lt;/ref&amp;gt;=== &lt;br /&gt;
Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each organization is comprised of one(or more) workstations, a single server, and every node that will be configured and maintained by the chef-client. Cookbooks (and recipes) are used to tell the chef-client how each node in your organization should be configured. The chef-client(which is installed on every node) does the actual configuration.&lt;br /&gt;
&lt;br /&gt;
*'''Node:'''&lt;br /&gt;
:A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.&lt;br /&gt;
&lt;br /&gt;
*'''Recipe: ''' &lt;br /&gt;
:A recipe specifies the resources to use and the order in which they are to be applied. It is mostly a collection of resources, defined using patterns(resource names, attribute-value pairs, and actions). A recipe       must define everything that is required to configure part of a system.&lt;br /&gt;
&lt;br /&gt;
*'''Cookbook:''' &lt;br /&gt;
:A cookbook is the fundamental unit of configuration and policy distribution. A cookbook defines a scenario and contains everything that is required to support that scenario.&lt;br /&gt;
&lt;br /&gt;
*'''WorkStation:'''&lt;br /&gt;
:A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery. &lt;br /&gt;
:The workstation is the location from which most users do most of their work.&lt;br /&gt;
:One(or more) workstations are configured to allow users to author, test, and maintain cookbooks. Cookbooks are uploaded to the Chef server from the workstation.&lt;br /&gt;
&lt;br /&gt;
*'''Chef Server:'''&lt;br /&gt;
:The Chef server acts as a hub of information. Cookbooks and policy settings are uploaded to the Chef server by users from workstations.&lt;br /&gt;
&lt;br /&gt;
*'''Chef-client:'''&lt;br /&gt;
:The chef-client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL for specific resources&lt;br /&gt;
&lt;br /&gt;
===Nginx===&lt;br /&gt;
&lt;br /&gt;
Nginx is a free, open-source, high-performance [HTTP] server and reverse proxy&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/glossary/reverse-proxy-server/]&amp;lt;/ref&amp;gt;, as well as an IMAP&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol&amp;lt;/ref&amp;gt;/POP3&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Post_Office_Protocol&amp;lt;/ref&amp;gt; proxy server. Nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/wiki/ Nginx Sever]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unicorn===&lt;br /&gt;
&lt;br /&gt;
Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.  Slow clients should only be served by placing a reverse proxy capable of fully buffering both the the request and response in between unicorn and slow clients.&lt;br /&gt;
&amp;lt;ref&amp;gt;[https://github.com/defunkt/unicorn Unicorn Web Server]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Plan of Action==&lt;br /&gt;
===Steps to Implement the Automated Deployment Process===&lt;br /&gt;
&lt;br /&gt;
[[File:Img01ExpInfra.png | frame|none|Expertiza Virtual Infrastructure]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Setup a virtual Vanilla&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Vanilla_software Vanilla]&amp;lt;/ref&amp;gt; Ubuntu&amp;lt;ref&amp;gt;[http://www.ubuntu.com Ubuntu]&amp;lt;/ref&amp;gt; Machine.&lt;br /&gt;
&lt;br /&gt;
2. Update the ubuntu to the specified version.&lt;br /&gt;
&lt;br /&gt;
3. Install nginx. Nginx is a web server. It is being used in the Expertiza architecture as a reverse proxy server. Through nginx, we will also attempt to serve static pages directly.&lt;br /&gt;
&lt;br /&gt;
4. Make changes in the nginx configuration.&lt;br /&gt;
&lt;br /&gt;
5. Install Ruby, RVM&amp;lt;ref&amp;gt;[https://rvm.io/ Ruby Virtual Machine]&amp;lt;/ref&amp;gt; and all the ruby dependencies.&lt;br /&gt;
&lt;br /&gt;
6. Install MYSQL&amp;lt;ref&amp;gt;[https://mysql.com Mysql server]&amp;lt;/ref&amp;gt; and configure it.&lt;br /&gt;
&lt;br /&gt;
7. Install Unicorn gem. Unicorn is a Rack&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Rack_%28web_server_interface%29 Rack Server]&amp;lt;/ref&amp;gt; HTTP server that uses forked processes to handle multiple incoming requests concurrently. For expertiza, unicorn is being used as the web server, which will interact with the database servers to fetch the data.&lt;br /&gt;
&lt;br /&gt;
8. Configure Unicorn and integrate it to work with nginx.&lt;br /&gt;
&lt;br /&gt;
9. Bundle install, install gems and migrate databases.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Stack==&lt;br /&gt;
&lt;br /&gt;
[[File:Exp1.png]]&lt;br /&gt;
&lt;br /&gt;
The above visually describes the expertiza stack on the virtual machine. The stack includes nginx as the front end, web server which will redirect the requests to the unicorn server. The scope of the project includes just 1 unicorn server but the recipe will be written in a way that later modifications can be made to add more than 1 unicorn servers under a load balancer. The unicorn server will interact with the database server and write/fetch data into it.&lt;br /&gt;
&lt;br /&gt;
==Chef-Solo Recipe Example==&lt;br /&gt;
Chef solo has cookbooks and recipes. An example of recipes is as follows:&lt;br /&gt;
    package &amp;quot;git-core&amp;quot; #apt-get install git-core&lt;br /&gt;
&lt;br /&gt;
    user node[:user][:name] do&lt;br /&gt;
        password node[:user][:password]&lt;br /&gt;
        gid &amp;quot;admin&amp;quot;&lt;br /&gt;
        home &amp;quot;/home/#{node[:user][:name]}&amp;quot;&lt;br /&gt;
        supports :manage_home =&amp;gt; true&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
This recipe orchestrates the installation of git-core and creates a new user and sets its privileges and password along with the home directory. Similarly, the plan of action is to write recipes for downloading, installing and configuring various components(nginx, unicorn, RMV, Ruby, MYSQL etc.) which will contribute towards building the infrastructure of expertiza.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Deployment==&lt;br /&gt;
&lt;br /&gt;
1. We first create a droplet( virtual private server) using digital ocean&amp;lt;ref&amp;gt;https://www.digitalocean.com/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Drop.png]]&lt;br /&gt;
&lt;br /&gt;
2. We record the IP address of the newly created droplet and create the &amp;lt;ipaddress&amp;gt;.json file.&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;ipaddress&amp;gt;.json''' : This file holds all the node specific values required to install services and config node.&lt;br /&gt;
We will set node_user , user_hash_password , ruby version , mysql root &amp;amp; password . The main function apart from holding node variables is to run recipes in a specific code.&lt;br /&gt;
&lt;br /&gt;
[[File:Ipjson.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following recipes(.rb files), scripts and node specific files were created to achieve automatic deployment. Other pre-installed files and folder for Chef cookbook can be found in the git repository mentioned above.&lt;br /&gt;
&lt;br /&gt;
3. Next &lt;br /&gt;
&lt;br /&gt;
'''setup_vps.sh''' : This will run the knife tool that will setup Chef-solo on the node and  will execute the recipes.&lt;br /&gt;
This needs to be from the directory where it present. The bash command in following format has to be used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sh setup_vps.sh &amp;lt;node_username&amp;gt; &amp;lt;node_ip_address&amp;gt; &amp;lt;node_port&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Setup vps sh.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''default.rb''' : This updates the Ubuntu machine packages, install the list of prerequisite packages and sets the time zone.&lt;br /&gt;
[[File:Default rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''expertiza_clone''' : This recipes creates a directory and clones the  Expertiza git source code in that directory.&lt;br /&gt;
[[File:Expertiza clone rb.JPG ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''set_java_home''': This recipe sets the Java configuration. It then bundle installs all the gems used by the Expertiza.&lt;br /&gt;
[[File:Set java home rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''mysql.rb''' : It installs the MySQL server , MySQL client and its associated dependencies. The root password is preloaded and then fetched on installation by setting DEBIAN_FRONTEND environment variable.&lt;br /&gt;
&lt;br /&gt;
[[File:Mysql rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''nginx.rb''' : This recipe installs nginx which is web proxy server that will listen on user defined port and redirect the requests for static content (images, css, javascript) to the public folder of Experiza rails app.&lt;br /&gt;
&lt;br /&gt;
[[File:NGINX rb.JPG ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''unicorn.rb''' : It will install and configure Unicorn web server used in production environment to handle high traffic and achieve load balancing . All the requests for dynamic content will go through it.&lt;br /&gt;
[[File:Start server rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
==Github link==&lt;br /&gt;
https://github.com/amurark/expertiza&lt;br /&gt;
&lt;br /&gt;
==Points for the reviewer==&lt;br /&gt;
&lt;br /&gt;
While reviewing this project, please consider the following points:&lt;br /&gt;
&lt;br /&gt;
*1. There is no scope for testing in our project. This has been discussed and approved by the mentor. &lt;br /&gt;
*2. There is no scope for UML diagrams for this project, as there are no classes/interface involved.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100527</id>
		<title>CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100527"/>
		<updated>2015-12-16T08:37:37Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: /* Expertiza Deployment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction to Expertiza==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is a web application to create reusable learning objects through peer review. It supports various features such as team projects and the submission of various documents including URLs and wiki pages. It is being used extensively across various universities for select courses.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Currently, setting up the infrastructure for expertiza is done manually. The task is to write a Chef-solo&amp;lt;ref&amp;gt;[https://docs.chef.io/chef_solo.html Chef Solo]&amp;lt;/ref&amp;gt; recipe which will create a production ready environment for expertiza. Chef-solo recipes are Ruby&amp;lt;ref&amp;gt;[https://www.ruby-lang.org/en/ Ruby]&amp;lt;/ref&amp;gt; code.&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
&lt;br /&gt;
We need to provide a single step setup of expertiza for production.&lt;br /&gt;
&lt;br /&gt;
*It should include setting up the basic environment, application dependency, configuration setup and database setup.&lt;br /&gt;
*It should also include recipe for regular deployment.&lt;br /&gt;
&lt;br /&gt;
==Some Terminology==&lt;br /&gt;
===Chef Solo&amp;lt;ref&amp;gt;https://docs.chef.io/chef_solo.html&amp;lt;/ref&amp;gt;=== &lt;br /&gt;
Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each organization is comprised of one(or more) workstations, a single server, and every node that will be configured and maintained by the chef-client. Cookbooks (and recipes) are used to tell the chef-client how each node in your organization should be configured. The chef-client(which is installed on every node) does the actual configuration.&lt;br /&gt;
&lt;br /&gt;
*'''Node:'''&lt;br /&gt;
:A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.&lt;br /&gt;
&lt;br /&gt;
*'''Recipe: ''' &lt;br /&gt;
:A recipe specifies the resources to use and the order in which they are to be applied. It is mostly a collection of resources, defined using patterns(resource names, attribute-value pairs, and actions). A recipe       must define everything that is required to configure part of a system.&lt;br /&gt;
&lt;br /&gt;
*'''Cookbook:''' &lt;br /&gt;
:A cookbook is the fundamental unit of configuration and policy distribution. A cookbook defines a scenario and contains everything that is required to support that scenario.&lt;br /&gt;
&lt;br /&gt;
*'''WorkStation:'''&lt;br /&gt;
:A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery. &lt;br /&gt;
:The workstation is the location from which most users do most of their work.&lt;br /&gt;
:One(or more) workstations are configured to allow users to author, test, and maintain cookbooks. Cookbooks are uploaded to the Chef server from the workstation.&lt;br /&gt;
&lt;br /&gt;
*'''Chef Server:'''&lt;br /&gt;
:The Chef server acts as a hub of information. Cookbooks and policy settings are uploaded to the Chef server by users from workstations.&lt;br /&gt;
&lt;br /&gt;
*'''Chef-client:'''&lt;br /&gt;
:The chef-client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL for specific resources&lt;br /&gt;
&lt;br /&gt;
===Nginx===&lt;br /&gt;
&lt;br /&gt;
Nginx is a free, open-source, high-performance [HTTP] server and reverse proxy&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/glossary/reverse-proxy-server/]&amp;lt;/ref&amp;gt;, as well as an IMAP&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol&amp;lt;/ref&amp;gt;/POP3&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Post_Office_Protocol&amp;lt;/ref&amp;gt; proxy server. Nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/wiki/ Nginx Sever]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unicorn===&lt;br /&gt;
&lt;br /&gt;
Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.  Slow clients should only be served by placing a reverse proxy capable of fully buffering both the the request and response in between unicorn and slow clients.&lt;br /&gt;
&amp;lt;ref&amp;gt;[https://github.com/defunkt/unicorn Unicorn Web Server]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Plan of Action==&lt;br /&gt;
===Steps to Implement the Automated Deployment Process===&lt;br /&gt;
&lt;br /&gt;
[[File:Img01ExpInfra.png | frame|none|Expertiza Virtual Infrastructure]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Setup a virtual Vanilla&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Vanilla_software Vanilla]&amp;lt;/ref&amp;gt; Ubuntu&amp;lt;ref&amp;gt;[http://www.ubuntu.com Ubuntu]&amp;lt;/ref&amp;gt; Machine.&lt;br /&gt;
&lt;br /&gt;
2. Update the ubuntu to the specified version.&lt;br /&gt;
&lt;br /&gt;
3. Install nginx. Nginx is a web server. It is being used in the Expertiza architecture as a reverse proxy server. Through nginx, we will also attempt to serve static pages directly.&lt;br /&gt;
&lt;br /&gt;
4. Make changes in the nginx configuration.&lt;br /&gt;
&lt;br /&gt;
5. Install Ruby, RVM&amp;lt;ref&amp;gt;[https://rvm.io/ Ruby Virtual Machine]&amp;lt;/ref&amp;gt; and all the ruby dependencies.&lt;br /&gt;
&lt;br /&gt;
6. Install MYSQL&amp;lt;ref&amp;gt;[https://mysql.com Mysql server]&amp;lt;/ref&amp;gt; and configure it.&lt;br /&gt;
&lt;br /&gt;
7. Install Unicorn gem. Unicorn is a Rack&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Rack_%28web_server_interface%29 Rack Server]&amp;lt;/ref&amp;gt; HTTP server that uses forked processes to handle multiple incoming requests concurrently. For expertiza, unicorn is being used as the web server, which will interact with the database servers to fetch the data.&lt;br /&gt;
&lt;br /&gt;
8. Configure Unicorn and integrate it to work with nginx.&lt;br /&gt;
&lt;br /&gt;
9. Bundle install, install gems and migrate databases.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Stack==&lt;br /&gt;
&lt;br /&gt;
[[File:Exp1.png]]&lt;br /&gt;
&lt;br /&gt;
The above visually describes the expertiza stack on the virtual machine. The stack includes nginx as the front end, web server which will redirect the requests to the unicorn server. The scope of the project includes just 1 unicorn server but the recipe will be written in a way that later modifications can be made to add more than 1 unicorn servers under a load balancer. The unicorn server will interact with the database server and write/fetch data into it.&lt;br /&gt;
&lt;br /&gt;
==Chef-Solo Recipe Example==&lt;br /&gt;
Chef solo has cookbooks and recipes. An example of recipes is as follows:&lt;br /&gt;
    package &amp;quot;git-core&amp;quot; #apt-get install git-core&lt;br /&gt;
&lt;br /&gt;
    user node[:user][:name] do&lt;br /&gt;
        password node[:user][:password]&lt;br /&gt;
        gid &amp;quot;admin&amp;quot;&lt;br /&gt;
        home &amp;quot;/home/#{node[:user][:name]}&amp;quot;&lt;br /&gt;
        supports :manage_home =&amp;gt; true&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
This recipe orchestrates the installation of git-core and creates a new user and sets its privileges and password along with the home directory. Similarly, the plan of action is to write recipes for downloading, installing and configuring various components(nginx, unicorn, RMV, Ruby, MYSQL etc.) which will contribute towards building the infrastructure of expertiza.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Deployment==&lt;br /&gt;
&lt;br /&gt;
1. We first create a droplet( virtual private server) using digital ocean&amp;lt;ref&amp;gt;https://www.digitalocean.com/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Drop.PNG]]&lt;br /&gt;
&lt;br /&gt;
2. We record the IP address of the newly created droplet and create the &amp;lt;ipaddress&amp;gt;.json file.&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;ipaddress&amp;gt;.json''' : This file holds all the node specific values required to install services and config node.&lt;br /&gt;
We will set node_user , user_hash_password , ruby version , mysql root &amp;amp; password . The main function apart from holding node variables is to run recipes in a specific code.&lt;br /&gt;
&lt;br /&gt;
[[File:Ipjson.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following recipes(.rb files), scripts and node specific files were created to achieve automatic deployment. Other pre-installed files and folder for Chef cookbook can be found in the git repository mentioned above.&lt;br /&gt;
&lt;br /&gt;
3. Next &lt;br /&gt;
&lt;br /&gt;
'''setup_vps.sh''' : This will run the knife tool that will setup Chef-solo on the node and  will execute the recipes.&lt;br /&gt;
This needs to be from the directory where it present. The bash command in following format has to be used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sh setup_vps.sh &amp;lt;node_username&amp;gt; &amp;lt;node_ip_address&amp;gt; &amp;lt;node_port&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Setup vps sh.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''default.rb''' : This updates the Ubuntu machine packages, install the list of prerequisite packages and sets the time zone.&lt;br /&gt;
[[File:Default rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''expertiza_clone''' : This recipes creates a directory and clones the  Expertiza git source code in that directory.&lt;br /&gt;
[[File:Expertiza clone rb.JPG ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''set_java_home''': This recipe sets the Java configuration. It then bundle installs all the gems used by the Expertiza.&lt;br /&gt;
[[File:Set java home rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''mysql.rb''' : It installs the MySQL server , MySQL client and its associated dependencies. The root password is preloaded and then fetched on installation by setting DEBIAN_FRONTEND environment variable.&lt;br /&gt;
&lt;br /&gt;
[[File:Mysql rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''nginx.rb''' : This recipe installs nginx which is web proxy server that will listen on user defined port and redirect the requests for static content (images, css, javascript) to the public folder of Experiza rails app.&lt;br /&gt;
&lt;br /&gt;
[[File:NGINX rb.JPG ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''unicorn.rb''' : It will install and configure Unicorn web server used in production environment to handle high traffic and achieve load balancing . All the requests for dynamic content will go through it.&lt;br /&gt;
[[File:Start server rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
==Github link==&lt;br /&gt;
https://github.com/amurark/expertiza&lt;br /&gt;
&lt;br /&gt;
==Points for the reviewer==&lt;br /&gt;
&lt;br /&gt;
While reviewing this project, please consider the following points:&lt;br /&gt;
&lt;br /&gt;
*1. There is no scope for testing in our project. This has been discussed and approved by the mentor. &lt;br /&gt;
*2. There is no scope for UML diagrams for this project, as there are no classes/interface involved.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100525</id>
		<title>CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100525"/>
		<updated>2015-12-16T06:54:42Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: /* Expertiza Deployment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction to Expertiza==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is a web application to create reusable learning objects through peer review. It supports various features such as team projects and the submission of various documents including URLs and wiki pages. It is being used extensively across various universities for select courses.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Currently, setting up the infrastructure for expertiza is done manually. The task is to write a Chef-solo&amp;lt;ref&amp;gt;[https://docs.chef.io/chef_solo.html Chef Solo]&amp;lt;/ref&amp;gt; recipe which will create a production ready environment for expertiza. Chef-solo recipes are Ruby&amp;lt;ref&amp;gt;[https://www.ruby-lang.org/en/ Ruby]&amp;lt;/ref&amp;gt; code.&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
&lt;br /&gt;
We need to provide a single step setup of expertiza for production.&lt;br /&gt;
&lt;br /&gt;
*It should include setting up the basic environment, application dependency, configuration setup and database setup.&lt;br /&gt;
*It should also include recipe for regular deployment.&lt;br /&gt;
&lt;br /&gt;
==Some Terminology==&lt;br /&gt;
===Chef Solo&amp;lt;ref&amp;gt;https://docs.chef.io/chef_solo.html&amp;lt;/ref&amp;gt;=== &lt;br /&gt;
Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each organization is comprised of one(or more) workstations, a single server, and every node that will be configured and maintained by the chef-client. Cookbooks (and recipes) are used to tell the chef-client how each node in your organization should be configured. The chef-client(which is installed on every node) does the actual configuration.&lt;br /&gt;
&lt;br /&gt;
*'''Node:'''&lt;br /&gt;
:A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.&lt;br /&gt;
&lt;br /&gt;
*'''Recipe: ''' &lt;br /&gt;
:A recipe specifies the resources to use and the order in which they are to be applied. It is mostly a collection of resources, defined using patterns(resource names, attribute-value pairs, and actions). A recipe       must define everything that is required to configure part of a system.&lt;br /&gt;
&lt;br /&gt;
*'''Cookbook:''' &lt;br /&gt;
:A cookbook is the fundamental unit of configuration and policy distribution. A cookbook defines a scenario and contains everything that is required to support that scenario.&lt;br /&gt;
&lt;br /&gt;
*'''WorkStation:'''&lt;br /&gt;
:A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery. &lt;br /&gt;
:The workstation is the location from which most users do most of their work.&lt;br /&gt;
:One(or more) workstations are configured to allow users to author, test, and maintain cookbooks. Cookbooks are uploaded to the Chef server from the workstation.&lt;br /&gt;
&lt;br /&gt;
*'''Chef Server:'''&lt;br /&gt;
:The Chef server acts as a hub of information. Cookbooks and policy settings are uploaded to the Chef server by users from workstations.&lt;br /&gt;
&lt;br /&gt;
*'''Chef-client:'''&lt;br /&gt;
:The chef-client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL for specific resources&lt;br /&gt;
&lt;br /&gt;
===Nginx===&lt;br /&gt;
&lt;br /&gt;
Nginx is a free, open-source, high-performance [HTTP] server and reverse proxy&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/glossary/reverse-proxy-server/]&amp;lt;/ref&amp;gt;, as well as an IMAP&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol&amp;lt;/ref&amp;gt;/POP3&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Post_Office_Protocol&amp;lt;/ref&amp;gt; proxy server. Nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/wiki/ Nginx Sever]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unicorn===&lt;br /&gt;
&lt;br /&gt;
Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.  Slow clients should only be served by placing a reverse proxy capable of fully buffering both the the request and response in between unicorn and slow clients.&lt;br /&gt;
&amp;lt;ref&amp;gt;[https://github.com/defunkt/unicorn Unicorn Web Server]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Plan of Action==&lt;br /&gt;
===Steps to Implement the Automated Deployment Process===&lt;br /&gt;
&lt;br /&gt;
[[File:Img01ExpInfra.png | frame|none|Expertiza Virtual Infrastructure]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Setup a virtual Vanilla&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Vanilla_software Vanilla]&amp;lt;/ref&amp;gt; Ubuntu&amp;lt;ref&amp;gt;[http://www.ubuntu.com Ubuntu]&amp;lt;/ref&amp;gt; Machine.&lt;br /&gt;
&lt;br /&gt;
2. Update the ubuntu to the specified version.&lt;br /&gt;
&lt;br /&gt;
3. Install nginx. Nginx is a web server. It is being used in the Expertiza architecture as a reverse proxy server. Through nginx, we will also attempt to serve static pages directly.&lt;br /&gt;
&lt;br /&gt;
4. Make changes in the nginx configuration.&lt;br /&gt;
&lt;br /&gt;
5. Install Ruby, RVM&amp;lt;ref&amp;gt;[https://rvm.io/ Ruby Virtual Machine]&amp;lt;/ref&amp;gt; and all the ruby dependencies.&lt;br /&gt;
&lt;br /&gt;
6. Install MYSQL&amp;lt;ref&amp;gt;[https://mysql.com Mysql server]&amp;lt;/ref&amp;gt; and configure it.&lt;br /&gt;
&lt;br /&gt;
7. Install Unicorn gem. Unicorn is a Rack&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Rack_%28web_server_interface%29 Rack Server]&amp;lt;/ref&amp;gt; HTTP server that uses forked processes to handle multiple incoming requests concurrently. For expertiza, unicorn is being used as the web server, which will interact with the database servers to fetch the data.&lt;br /&gt;
&lt;br /&gt;
8. Configure Unicorn and integrate it to work with nginx.&lt;br /&gt;
&lt;br /&gt;
9. Bundle install, install gems and migrate databases.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Stack==&lt;br /&gt;
&lt;br /&gt;
[[File:Exp1.png]]&lt;br /&gt;
&lt;br /&gt;
The above visually describes the expertiza stack on the virtual machine. The stack includes nginx as the front end, web server which will redirect the requests to the unicorn server. The scope of the project includes just 1 unicorn server but the recipe will be written in a way that later modifications can be made to add more than 1 unicorn servers under a load balancer. The unicorn server will interact with the database server and write/fetch data into it.&lt;br /&gt;
&lt;br /&gt;
==Chef-Solo Recipe Example==&lt;br /&gt;
Chef solo has cookbooks and recipes. An example of recipes is as follows:&lt;br /&gt;
    package &amp;quot;git-core&amp;quot; #apt-get install git-core&lt;br /&gt;
&lt;br /&gt;
    user node[:user][:name] do&lt;br /&gt;
        password node[:user][:password]&lt;br /&gt;
        gid &amp;quot;admin&amp;quot;&lt;br /&gt;
        home &amp;quot;/home/#{node[:user][:name]}&amp;quot;&lt;br /&gt;
        supports :manage_home =&amp;gt; true&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
This recipe orchestrates the installation of git-core and creates a new user and sets its privileges and password along with the home directory. Similarly, the plan of action is to write recipes for downloading, installing and configuring various components(nginx, unicorn, RMV, Ruby, MYSQL etc.) which will contribute towards building the infrastructure of expertiza.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Deployment==&lt;br /&gt;
&lt;br /&gt;
1. We first create a droplet( virtual private server) using digital ocean&amp;lt;ref&amp;gt;https://www.digitalocean.com/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
2. We record the IP address of the newly created droplet and create the &amp;lt;ipaddress&amp;gt;.json file.&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;ipaddress&amp;gt;.json''' : This file holds all the node specific values required to install services and config node.&lt;br /&gt;
We will set node_user , user_hash_password , ruby version , mysql root &amp;amp; password . The main function apart from holding node variables is to run recipes in a specific code.&lt;br /&gt;
&lt;br /&gt;
[[File:Ipjson.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following recipes(.rb files), scripts and node specific files were created to achieve automatic deployment. Other pre-installed files and folder for Chef cookbook can be found in the git repository mentioned above.&lt;br /&gt;
&lt;br /&gt;
3. Next &lt;br /&gt;
&lt;br /&gt;
'''setup_vps.sh''' : This will run the knife tool that will setup Chef-solo on the node and  will execute the recipes.&lt;br /&gt;
This needs to be from the directory where it present. The bash command in following format has to be used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sh setup_vps.sh &amp;lt;node_username&amp;gt; &amp;lt;node_ip_address&amp;gt; &amp;lt;node_port&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Setup vps sh.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''default.rb''' : This updates the Ubuntu machine packages, install the list of prerequisite packages and sets the time zone.&lt;br /&gt;
[[File:Default rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''expertiza_clone''' : This recipes creates a directory and clones the  Expertiza git source code in that directory.&lt;br /&gt;
[[File:Expertiza clone rb.JPG ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''set_java_home''': This recipe sets the Java configuration. It then bundle installs all the gems used by the Expertiza.&lt;br /&gt;
[[File:Set java home rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''mysql.rb''' : It installs the MySQL server , MySQL client and its associated dependencies. The root password is preloaded and then fetched on installation by setting DEBIAN_FRONTEND environment variable.&lt;br /&gt;
&lt;br /&gt;
[[File:Mysql rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''nginx.rb''' : This recipe installs nginx which is web proxy server that will listen on user defined port and redirect the requests for static content (images, css, javascript) to the public folder of Experiza rails app.&lt;br /&gt;
&lt;br /&gt;
[[File:NGINX rb.JPG ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''unicorn.rb''' : It will install and configure Unicorn web server used in production environment to handle high traffic and achieve load balancing . All the requests for dynamic content will go through it.&lt;br /&gt;
[[File:Start server rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
==Github link==&lt;br /&gt;
https://github.com/amurark/expertiza&lt;br /&gt;
&lt;br /&gt;
==Points for the reviewer==&lt;br /&gt;
&lt;br /&gt;
While reviewing this project, please consider the following points:&lt;br /&gt;
&lt;br /&gt;
*1. There is no scope for testing in our project. This has been discussed and approved by the mentor. &lt;br /&gt;
*2. There is no scope for UML diagrams for this project, as there are no classes/interface involved.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100524</id>
		<title>CSC/ECE 517 Fall 2015 E1589 Automating production setup and deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015_E1589_Automating_production_setup_and_deployment&amp;diff=100524"/>
		<updated>2015-12-16T06:45:14Z</updated>

		<summary type="html">&lt;p&gt;Psinaik: /* Nginx */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction to Expertiza==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is a web application to create reusable learning objects through peer review. It supports various features such as team projects and the submission of various documents including URLs and wiki pages. It is being used extensively across various universities for select courses.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
Currently, setting up the infrastructure for expertiza is done manually. The task is to write a Chef-solo&amp;lt;ref&amp;gt;[https://docs.chef.io/chef_solo.html Chef Solo]&amp;lt;/ref&amp;gt; recipe which will create a production ready environment for expertiza. Chef-solo recipes are Ruby&amp;lt;ref&amp;gt;[https://www.ruby-lang.org/en/ Ruby]&amp;lt;/ref&amp;gt; code.&lt;br /&gt;
&lt;br /&gt;
===What needs to be done===&lt;br /&gt;
&lt;br /&gt;
We need to provide a single step setup of expertiza for production.&lt;br /&gt;
&lt;br /&gt;
*It should include setting up the basic environment, application dependency, configuration setup and database setup.&lt;br /&gt;
*It should also include recipe for regular deployment.&lt;br /&gt;
&lt;br /&gt;
==Some Terminology==&lt;br /&gt;
===Chef Solo&amp;lt;ref&amp;gt;https://docs.chef.io/chef_solo.html&amp;lt;/ref&amp;gt;=== &lt;br /&gt;
Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each organization is comprised of one(or more) workstations, a single server, and every node that will be configured and maintained by the chef-client. Cookbooks (and recipes) are used to tell the chef-client how each node in your organization should be configured. The chef-client(which is installed on every node) does the actual configuration.&lt;br /&gt;
&lt;br /&gt;
*'''Node:'''&lt;br /&gt;
:A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.&lt;br /&gt;
&lt;br /&gt;
*'''Recipe: ''' &lt;br /&gt;
:A recipe specifies the resources to use and the order in which they are to be applied. It is mostly a collection of resources, defined using patterns(resource names, attribute-value pairs, and actions). A recipe       must define everything that is required to configure part of a system.&lt;br /&gt;
&lt;br /&gt;
*'''Cookbook:''' &lt;br /&gt;
:A cookbook is the fundamental unit of configuration and policy distribution. A cookbook defines a scenario and contains everything that is required to support that scenario.&lt;br /&gt;
&lt;br /&gt;
*'''WorkStation:'''&lt;br /&gt;
:A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery. &lt;br /&gt;
:The workstation is the location from which most users do most of their work.&lt;br /&gt;
:One(or more) workstations are configured to allow users to author, test, and maintain cookbooks. Cookbooks are uploaded to the Chef server from the workstation.&lt;br /&gt;
&lt;br /&gt;
*'''Chef Server:'''&lt;br /&gt;
:The Chef server acts as a hub of information. Cookbooks and policy settings are uploaded to the Chef server by users from workstations.&lt;br /&gt;
&lt;br /&gt;
*'''Chef-client:'''&lt;br /&gt;
:The chef-client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL for specific resources&lt;br /&gt;
&lt;br /&gt;
===Nginx===&lt;br /&gt;
&lt;br /&gt;
Nginx is a free, open-source, high-performance [HTTP] server and reverse proxy&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/glossary/reverse-proxy-server/]&amp;lt;/ref&amp;gt;, as well as an IMAP&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol&amp;lt;/ref&amp;gt;/POP3&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Post_Office_Protocol&amp;lt;/ref&amp;gt; proxy server. Nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.&amp;lt;ref&amp;gt;[https://www.nginx.com/resources/wiki/ Nginx Sever]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Unicorn===&lt;br /&gt;
&lt;br /&gt;
Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.  Slow clients should only be served by placing a reverse proxy capable of fully buffering both the the request and response in between unicorn and slow clients.&lt;br /&gt;
&amp;lt;ref&amp;gt;[https://github.com/defunkt/unicorn Unicorn Web Server]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Plan of Action==&lt;br /&gt;
===Steps to Implement the Automated Deployment Process===&lt;br /&gt;
&lt;br /&gt;
[[File:Img01ExpInfra.png | frame|none|Expertiza Virtual Infrastructure]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Setup a virtual Vanilla&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Vanilla_software Vanilla]&amp;lt;/ref&amp;gt; Ubuntu&amp;lt;ref&amp;gt;[http://www.ubuntu.com Ubuntu]&amp;lt;/ref&amp;gt; Machine.&lt;br /&gt;
&lt;br /&gt;
2. Update the ubuntu to the specified version.&lt;br /&gt;
&lt;br /&gt;
3. Install nginx. Nginx is a web server. It is being used in the Expertiza architecture as a reverse proxy server. Through nginx, we will also attempt to serve static pages directly.&lt;br /&gt;
&lt;br /&gt;
4. Make changes in the nginx configuration.&lt;br /&gt;
&lt;br /&gt;
5. Install Ruby, RVM&amp;lt;ref&amp;gt;[https://rvm.io/ Ruby Virtual Machine]&amp;lt;/ref&amp;gt; and all the ruby dependencies.&lt;br /&gt;
&lt;br /&gt;
6. Install MYSQL&amp;lt;ref&amp;gt;[https://mysql.com Mysql server]&amp;lt;/ref&amp;gt; and configure it.&lt;br /&gt;
&lt;br /&gt;
7. Install Unicorn gem. Unicorn is a Rack&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Rack_%28web_server_interface%29 Rack Server]&amp;lt;/ref&amp;gt; HTTP server that uses forked processes to handle multiple incoming requests concurrently. For expertiza, unicorn is being used as the web server, which will interact with the database servers to fetch the data.&lt;br /&gt;
&lt;br /&gt;
8. Configure Unicorn and integrate it to work with nginx.&lt;br /&gt;
&lt;br /&gt;
9. Bundle install, install gems and migrate databases.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Stack==&lt;br /&gt;
&lt;br /&gt;
[[File:Exp1.png]]&lt;br /&gt;
&lt;br /&gt;
The above visually describes the expertiza stack on the virtual machine. The stack includes nginx as the front end, web server which will redirect the requests to the unicorn server. The scope of the project includes just 1 unicorn server but the recipe will be written in a way that later modifications can be made to add more than 1 unicorn servers under a load balancer. The unicorn server will interact with the database server and write/fetch data into it.&lt;br /&gt;
&lt;br /&gt;
==Chef-Solo Recipe Example==&lt;br /&gt;
Chef solo has cookbooks and recipes. An example of recipes is as follows:&lt;br /&gt;
    package &amp;quot;git-core&amp;quot; #apt-get install git-core&lt;br /&gt;
&lt;br /&gt;
    user node[:user][:name] do&lt;br /&gt;
        password node[:user][:password]&lt;br /&gt;
        gid &amp;quot;admin&amp;quot;&lt;br /&gt;
        home &amp;quot;/home/#{node[:user][:name]}&amp;quot;&lt;br /&gt;
        supports :manage_home =&amp;gt; true&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
This recipe orchestrates the installation of git-core and creates a new user and sets its privileges and password along with the home directory. Similarly, the plan of action is to write recipes for downloading, installing and configuring various components(nginx, unicorn, RMV, Ruby, MYSQL etc.) which will contribute towards building the infrastructure of expertiza.&lt;br /&gt;
&lt;br /&gt;
==Expertiza Deployment ==&lt;br /&gt;
&lt;br /&gt;
We first create a droplet using [digital ocean].&lt;br /&gt;
&lt;br /&gt;
The following recipes (.rb files) , scripts and node specific files were created to achieve automatic deployment. Other pre-installed files and folder for Chef cookbook can be found on above git repository.&lt;br /&gt;
&lt;br /&gt;
'''setup_vps.sh''' : This will run the knife tool that will setup Chef-solo on the node and  will execute the recipes.&lt;br /&gt;
This needs to be from the directory where it present. The bash command in following format has to be used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sh setup_vps.sh &amp;lt;node_username&amp;gt; &amp;lt;node_ip_address&amp;gt; &amp;lt;node_port&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Setup vps sh.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;ipaddress&amp;gt;.json''' : This file holds all the node specific values required to install services and config node.&lt;br /&gt;
We will set node_user , user_hash_password , ruby version , mysql root &amp;amp; password . The main function apart from holding node variables is to run recipes in a specific code.&lt;br /&gt;
&lt;br /&gt;
[[File:Ipjson.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''default.rb''' : This updates the Ubuntu machine packages, install the list of prerequisite packages and sets the time zone.&lt;br /&gt;
[[File:Default rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''expertiza_clone''' : This recipes creates a directory and clones the  Expertiza git source code in that directory.&lt;br /&gt;
[[File:Expertiza clone rb.JPG ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''set_java_home''': This recipe sets the Java configuration. It then bundle installs all the gems used by the Expertiza.&lt;br /&gt;
[[File:Set java home rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''mysql.rb''' : It installs the MySQL server , MySQL client and its associated dependencies. The root password is preloaded and then fetched on installation by setting DEBIAN_FRONTEND environment variable.&lt;br /&gt;
&lt;br /&gt;
[[File:Mysql rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''nginx.rb''' : This recipe installs nginx which is web proxy server that will listen on user defined port and redirect the requests for static content (images, css, javascript) to the public folder of Experiza rails app.&lt;br /&gt;
&lt;br /&gt;
[[File:NGINX rb.JPG ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''unicorn.rb''' : It will install and configure Unicorn web server used in production environment to handle high traffic and achieve load balancing . All the requests for dynamic content will go through it.&lt;br /&gt;
[[File:Start server rb.JPG]]&lt;br /&gt;
&lt;br /&gt;
==Github link==&lt;br /&gt;
https://github.com/amurark/expertiza&lt;br /&gt;
&lt;br /&gt;
==Points for the reviewer==&lt;br /&gt;
&lt;br /&gt;
While reviewing this project, please consider the following points:&lt;br /&gt;
&lt;br /&gt;
*1. There is no scope for testing in our project. This has been discussed and approved by the mentor. &lt;br /&gt;
*2. There is no scope for UML diagrams for this project, as there are no classes/interface involved.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Psinaik</name></author>
	</entry>
</feed>