<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>Puppet - Cognizant Transmutation</title>
	<atom:link href="https://www.ibd.com/tag/puppet/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.ibd.com</link>
	<description>Internet Bandwidth Development: Composting the Internet for over Two Decades</description>
	<lastBuildDate>Fri, 09 Jan 2009 06:35:23 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1</generator>

<image>
	<url>https://i0.wp.com/www.ibd.com/wp-content/uploads/2019/01/fullsizeoutput_7ae8.jpeg?fit=32%2C32&#038;ssl=1</url>
	<title>Puppet - Cognizant Transmutation</title>
	<link>https://www.ibd.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<atom:link rel="hub" href="https://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="https://pubsubhubbub.superfeedr.com"/><atom:link rel="hub" href="https://websubhub.com/hub"/><site xmlns="com-wordpress:feed-additions:1">156814061</site>	<item>
		<title>HOWTO: Install iClassify on Ubuntu and Mac OS X Leopard</title>
		<link>https://www.ibd.com/howto/howto-install-iclassify-on-ubuntu-and-mac-os-x-leopard/</link>
					<comments>https://www.ibd.com/howto/howto-install-iclassify-on-ubuntu-and-mac-os-x-leopard/#comments</comments>
		
		<dc:creator><![CDATA[Robert J Berger]]></dc:creator>
		<pubDate>Fri, 09 Jan 2009 06:35:23 +0000</pubDate>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Scalable Deployment]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[AWS]]></category>
		<category><![CDATA[iClassify]]></category>
		<category><![CDATA[Macintosh]]></category>
		<category><![CDATA[Opscode Chef]]></category>
		<category><![CDATA[Puppet]]></category>
		<category><![CDATA[ubuntu]]></category>
		<guid isPermaLink="false">http://blog2.ibd.com/?p=105</guid>

					<description><![CDATA[<p>Update: The folks who developed iClassify have come out with a total framework that is an alternative to iClassify/Puppet called opscode-chef. I will be looking into that soon and not do anymore work with iClassify (unless Chef turns out to suck or something, but at first glance it looks pretty good!). [After playing with Chef, my conclusion is forget about&#8230;</p>
<p>The post <a href="https://www.ibd.com/howto/howto-install-iclassify-on-ubuntu-and-mac-os-x-leopard/">HOWTO: Install iClassify on Ubuntu and Mac OS X Leopard</a> first appeared on <a href="https://www.ibd.com">Cognizant Transmutation</a>.</p>]]></description>
										<content:encoded><![CDATA[<h2>Update:</h2>
<p>The folks who developed iClassify have come out with a total framework that is an alternative to iClassify/Puppet called <a href="http://wiki.opscode.com/display/chef/Home" target="_blank">opscode-chef</a>. I will be looking into that soon and not do anymore work with iClassify (unless Chef turns out to suck or something, but at first glance it looks pretty good!).</p>
<p>[After playing with Chef, my conclusion is forget about iClassify / Puppet and just use Chef unless you are already using Puppet]</p>
<h2>iClassify Description</h2>
<p>From the creator&#8217;s of<a href="https://wiki.hjksolutions.com/display/IC/Home" target="_blank"> iClassify HJK Solutions website:</a></p>
<blockquote><p>iClassify allows for the easy registration and classification of nodes. Most of the time, a node is a server. With iClassify:</p>
<ul>
<li>Nodes register themselves with a central web service, including reporting <span class="nobr"><a rel="nofollow" href="http://reductivelabs.com/projects/facter">Facter<sup><img decoding="async" loading="lazy" class="rendericon" src="https://i0.wp.com/wiki.hjksolutions.com/images/icons/linkext7.gif?resize=7%2C7&#038;ssl=1" border="0" alt="" width="7" height="7" align="absmiddle" data-recalc-dims="1" /></sup></a></span> facts.</li>
<li>You can then tag those nodes, and add manual attributes.</li>
<li>You can search the nodes with a full text search engine</li>
<li>You can write recipies for icagent to auto-classify and auto-attribute your nodes.</li>
<li>You can tie it in to <span class="nobr"><a rel="nofollow" href="http://reductivelabs.com/projects">Puppet<sup><img decoding="async" loading="lazy" class="rendericon" src="https://i0.wp.com/wiki.hjksolutions.com/images/icons/linkext7.gif?resize=7%2C7&#038;ssl=1" border="0" alt="" width="7" height="7" align="absmiddle" data-recalc-dims="1" /></sup></a></span> as an external node classification tool, enabling you to easily configure hundreds of nodes at a time.</li>
<li>You can <a title="Capistrano Task" href="https://wiki.hjksolutions.com/display/IC/Capistrano+Task">tie it in to Capistrano, and have a dynamic ad-hoc configuration tool</a>.</li>
</ul>
</blockquote>
<p>We are considering using it along with Puppet and Amazon EC2 for deployment of some of our infrastructure.</p>
<h2>Install iClassify</h2>
<pre><span style="font-family: 'Lucida Grande'; line-height: 19px; white-space: normal;"><a href="https://wiki.hjksolutions.com/display/IC/Install+Instructions">Original Instructions</a> are at HJK Solutions. Some of the following quotes liberally from that site but adds the things I learnt along the way as well as how to do it on a Mac.</span></pre>
<h3>Prerequisites</h3>
<h4>Ruby Gems</h4>
<ul>
<li>Rails 2.0.2</li>
<li>Rake</li>
<li>Builder</li>
<li>UUID Tools</li>
<li>Mongrel</li>
<li>Highline</li>
<li>Net-LDAP</li>
</ul>
<pre>sudo gem rails rake install builder uuidtools mongrel ruby-net-ldap</pre>
<h4>Non-Gems</h4>
<ul>
<li>MySQL</li>
<li>Factor</li>
<li>Git</li>
<li>Java</li>
<li>Runit</li>
<li>Mongrel Runit</li>
</ul>
<h3>Configure MySQL</h3>
<p>The folks at HJK say they use MySQL and it should work with PostgreSQL and sqlite3 as well. We went wtih MySQL.<br />
First create the database <em>iclassify_production</em></p>
<pre>mysqladmin -u root -p  create iclassify_production</pre>
<p>Grant it the correct privleges (set <em>yourpass</em> to the password you want to use):</p>
<pre>mysql -u root -p iclassify_production
mysql&gt; GRANT ALL ON iclassify_production.* TO 'iclassify'@'localhost' IDENTIFIED BY 'yourpass';</pre>
<p>You should have the ruby mysql gem installed</p>
<pre>sudo gem install mysql</pre>
<p>on the Macintosh OS X Leopard I had to say:</p>
<pre>sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config</pre>
<h3>Git</h3>
<p>You can install from ubuntu packages</p>
<pre>sudo apt-get install git-core</pre>
<p>On the Mac Download and install the git OS X package for the <a href="http://code.google.com/p/git-osx-installer/">Mac from Git OSX Installer on Google Code </a>or</p>
<pre>port -uR install git-core</pre>
<h3>Java</h3>
<p>Java is needed for the <a href="http://lucene.apache.org/solr" target="_blank">Solr</a> package that is bundled in the iClassify distro. It can be installed via apt and/or downloaded from the Sun site. Java is already installed on Mac OS X.</p>
<h3>Runit</h3>
<p>Runit is an alternative / addition to the standard /etc/init.d &#8220;systemV&#8221; init system. I guess the HJK folks like it and seem to have dependencies on it. They say it should work without it, but I haven&#8217;t tried putting this together without the Runit/Mongrel_runit dependencies yet.</p>
<p>Some good info and tips on setting up / running runit on various systems can be found at <a href="http://smarden.org/runit/" target="_blank">runit &#8211; a UNIX init scheme with service supervision</a></p>
<p>Runit can be safely installed with apt. It will not replace the standard init system.:</p>
<pre>sudo apt-get install runit</pre>
<p>For the Mac:</p>
<pre>port install runit</pre>
<p>On the Mac, you&#8217;ll have to start the runit system with the command</p>
<div>
<pre>sudo launchctl load -w /Library/LaunchDaemons/org.macports.runit.plist</pre>
</div>
<h3>iClassify itself</h3>
<p>In a directory you want to keep the source of iclassify:</p>
<pre>git clone git://git.hjksolutions.com/iclassify iclassify
cd iclassify</pre>
<p>You need to know where you want to install the actual working rails app of iclassify and what user id/group you want to run it under.</p>
<p>The default location and the one we&#8217;ll use on Ubuntu is <em>/srv/iclassify</em> and the user id/group is usually the same as the one that runs the apache web services (<em>www-data</em>). Change <em>yourpass</em> to the password used for the iclassify user in MySQL.</p>
<pre>sudo rake iclassify:install ICBASE=/srv/iclassify ICUSER=www-data ICGROUP=www-data DBUSER=iclassify DBPASS=yourpass</pre>
<p>For the Macintosh:</p>
<pre>sudo rake iclassify:install ICBASE=/usr/local/iclassify ICUSER=_www ICGROUP=_www DBUSER=iclassify DBPASS=yourpass</pre>
<p>This will create a new iClassify instance in <em>/srv/iclassify</em>, set the right ownership to run iClassify, and set run the migrations to prepare your database instance. I found that I had to run this as root so that it will create the directories properly.</p>
<p>You can test that the iClassify rails app was installed properly by testing it with the built in Rails Server (on the Mac use the <em>/usr/local/iclassify</em> directory and <em>_www</em> user id):</p>
<div class="preformatted panel">
<div class="preformattedContent panelContent">
<pre>$ cd /srv/iclassify
$ sudo -u www-data env RAILS_ENV=production ./script/server
=&gt; Booting Mongrel (use 'script/server webrick' to force WEBrick)
=&gt; Rails application starting on http://0.0.0.0:3000
=&gt; Call with -d to detach
=&gt; Ctrl-C to shutdown server
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with production environment...
** Rails loaded.
** Loading any Rails specific GemPlugins
** Signals ready.  TERM =&gt; stop.  USR2 =&gt; restart.  INT =&gt; stop (no restart).
** Rails signals registered.  HUP =&gt; reload (without restart).  It might not work well.
** Mongrel available at 0.0.0.0:3000
** Use CTRL-C to stop.</pre>
</div>
</div>
<p>You can now point your browser to the local instance of iClassify at <span class="nobr"><a rel="nofollow" href="http://localhost:3000/">http://localhost:3000</a>, hit CTRL-C when you are done to terminate the script/server.</span></p>
<h3>Mongrel Runit</h3>
<p>You can download the mongrel_runit gem from the <a href="https://wiki.hjksolutions.com/display/MR/Home" target="_blank">Mongrel Runit page at HJK</a></p>
<p>Then install it with (on the Mac you&#8217;ll have to use the /usr/local/iclassify directory instead of /src/iclassify):</p>
<p><span style="font-family: 'Courier New'; line-height: 18px; white-space: pre;">F</span>or some reason the HJK folks set their <em>runit_service_dir</em> to be <em>/var/service</em> but the runit ubuntu package puts it in<em> /etc/service</em>. So you might want to edit <em>/srv/iclassify/examples/mongrel_runit_iclassify.yml</em> and set <em>runit_service_dir </em>to <em>/etc/service.</em> You can also change the number of mongrels you want to run in that file. Similarly, the DarwinPorts port install of runit expects it to be in <em>/opt/local/var/service</em>. You can change the <em>/srv/iclassify/examples/mongrel_runit_iclassify.yml</em> or you can make a symbolic link from <em>/opt/local/var/service</em> to <em>/var/service</em></p>
<pre>sudo gem install mongrel_runit-0.2.1.gem
sudo mkdir /etc/mongrel_runit
sudo cp /srv/iclassify/examples/mongrel_runit_iclassify.yml /etc/mongrel_runit/iclassify.yml
sudo mongrel_runit -c /etc/mongrel_runit/iclassify.yml create</pre>
<p>You should be able to then run the command</p>
<pre>mongrel_runit -v status -c /etc/mongrel_runit/iclassify.yml</pre>
<p>and see something like (there should be as many lines as you have set for mongrel servers. I changed the iclassify.yml from 5 to 3):</p>
<pre>5000: true: run: /etc/sv/mongrel-iclassify-5000: (pid 4403) 119s; run: log: (pid 4402) 119s
5001: true: run: /etc/sv/mongrel-iclassify-5001: (pid 4401) 119s; run: log: (pid 4400) 119s
5002: true: run: /etc/sv/mongrel-iclassify-5002: (pid 4399) 119s; run: log: (pid 4398) 119s</pre>
<h3>Solr</h3>
<p>First create some directories that will be needed for Solr to run its index as the www user (on the Mac replace /srv with /usr/local).</p>
<pre>sudo mkdir -p /srv/iclassify/vendor/plugins/acts_as_solr/solr/solr/data/production
sudo chown -R www-data:www-data /srv/iclassify/vendor/plugins/acts_as_solr/solr/solr/data/</pre>
<p>You can then test it with the command:</p>
<pre>sudo -u www-data env RAILS_ENV=production rake solr:start</pre>
<p>It should start and run with no errors.</p>
<p>You can stop it if you want with:</p>
<pre>sudo -u www-data env RAILS_ENV=production rake solr:stop</pre>
<p>Then set up runit to run it automatically (use /usr/local instead of /srv on the Mac and /var/service or whatevever your system uses for runit service dir if not on ubuntu and using /etc/service):</p>
<pre>sudo mkdir -p /etc/sv/iclassify-solr/log/main
sudo cp /srv/iclassify/examples/solr-run /etc/sv/iclassify-solr/run
sudo cp /srv/iclassify/examples/solr-log /etc/sv/iclassify-solr/log/run
sudo chmod a+x /etc/sv/iclassify-solr/run /etc/sv/iclassify-solr/log/run</pre>
<p>The following will start the solr process immediately as well as in the future reboots</p>
<pre>sudo ln -s /etc/sv/iclassify-solr /etc/service</pre>
<h3>Apache</h3>
<p>iClassify is best configured as a virtual host under Apache, running with SSL and mod_proxy_balancer. Follow the proper steps for configuring your platforms Apache to use mod_ssl,  mod_proxy_balance r and mod_rewrite. Create a virtual host config which resembles the following (works with Mac and Ubuntu, On the Mac just change the refs to /srv to /usr/local and the EXAMPLE.com to your domain in any case)</p>
<div class="preformatted panel">
<div class="preformattedContent panelContent">
<pre>&lt;VirtualHost *:443&gt;
  DocumentRoot /srv/iclassify/public
  LimitRequestBody 8388608
  ServerName iclassify.EXAMPLE.COM
  ServerAlias iclassify
  &lt;Directory /&gt;
    Options FollowSymLinks
    AllowOverride None
  &lt;/Directory&gt;

  &lt;Location /server-status&gt;
    SetHandler server-status
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1 192.168.0.0/255.255.0.0
  &lt;/Location&gt;

  &lt;Proxy balancer://iclassify&gt;
    BalancerMember http://localhost:5000
    BalancerMember http://localhost:5001
    BalancerMember http://localhost:5002
    BalancerMember http://localhost:5003
  &lt;/Proxy&gt;

  LogLevel info
  ErrorLog /var/log/apache2/iclassify-error.log
  CustomLog /var/log/apache2/iclassify-access.log combined

  RewriteEngine On
  RewriteLog /var/log/apache2/iclassify-rewrite.log
  RewriteLogLevel 0
  RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
  RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
  RewriteCond %{SCRIPT_FILENAME} !maintenance.html
  RewriteRule ^.*$ /system/maintenance.html [L]
  RewriteRule ^/server-status$ /server-status$1 [L]

  RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
  RequestHeader set X_FORWARDED_PROTO 'https'
  RewriteRule ^/(.*)$ balancer://iclassify%{REQUEST_URI} [P,QSA,L]
  ProxyPassReverse / balancer://iclassify
  SetEnv proxy-nokeepalive 1

  SSLEngine on
  SSLCertificateFile /etc/apache2/ssl/iclassify.crt
  SSLCertificateKeyFile /etc/apache2/ssl/iclassify.key

  BrowserMatch ".*MSIE.*" \
    nokeepalive ssl-unclean-shutdown \
    downgrade-1.0 force-response-1.0
&lt;/VirtualHost&gt;

&lt;VirtualHost *:80&gt;
  DocumentRoot /srv/iclassify/public
  LimitRequestBody 8388608
  ServerName iclassify.EXAMPLE.COM
  ServerAlias iclassify

  RewriteEngine On
  RewriteCond %{HTTPS} !=on
  RewriteRule ^/(.*) https://%{SERVER_NAME}/ [R,L]
&lt;/VirtualHost&gt;</pre>
</div>
</div>
<p>Basic instructions for setting up ssl certificates can be found at Just Samuels blog post <a href="http://www.justinsamuel.com/2006/03/11/howto-create-a-self-signed-wildcard-ssl-certificate/" target="_blank"><span style="color: #000000; text-decoration: none;">HOWTO: Create a self-signed (wildcard) SSL certificate</span></a></p>
<pre><a rel="nofollow" href="http://www.justinsamuel.com/2006/03/11/howto-create-a-self-signed-wildcard-ssl-certificate"></a></pre>
<p>Take the resulting hosts.cert and copy it to /etc/apache2/ssl/iclassify.crt and hosts.key to /etc/apache2/ssl/iclassify.key (or whereever you put your ssl keys and make sure the SSLCertificateKeyFile and SSLCertificateFile are set the same in your vhosts conf file.</p>
<h3>Conclusion</h3>
<p>That should get you up and running with iClassify. In a future post I will install Puppet and then figure out how to use these together to deploy to Amazon EC2.</p><p>The post <a href="https://www.ibd.com/howto/howto-install-iclassify-on-ubuntu-and-mac-os-x-leopard/">HOWTO: Install iClassify on Ubuntu and Mac OS X Leopard</a> first appeared on <a href="https://www.ibd.com">Cognizant Transmutation</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.ibd.com/howto/howto-install-iclassify-on-ubuntu-and-mac-os-x-leopard/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">105</post-id>	</item>
	</channel>
</rss>
