<?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/"
	>

<channel>
	<title>Uncommon Sense</title>
	<atom:link href="http://uncommonsense-uk.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://uncommonsense-uk.com</link>
	<description>Because common sense just isn&#039;t all that common.</description>
	<lastBuildDate>Wed, 22 Feb 2012 10:21:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Lessons in Web Access Management &#8211; Josso &#8211; Part 1</title>
		<link>http://uncommonsense-uk.com/2012/journeying-into-web-access-management-josso-part-1/</link>
		<comments>http://uncommonsense-uk.com/2012/journeying-into-web-access-management-josso-part-1/#comments</comments>
		<pubDate>Mon, 20 Feb 2012 17:39:45 +0000</pubDate>
		<dc:creator>actionjack</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[Single Sign On]]></category>
		<category><![CDATA[joss]]></category>
		<category><![CDATA[sso]]></category>
		<category><![CDATA[wam]]></category>

		<guid isPermaLink="false">http://uncommonsense-uk.com/?p=204</guid>
		<description><![CDATA[I&#8217;m currently looking for a Web Access Management tool to manage and control access to a number of hosted applications. Wikipedia defines Web Access Management as: Authentication Management Policy-based Authorizations Audit &#38; Reporting Services Single sign-on Convenience I&#8217;ve had previous (&#8230;)</p><p><a href="http://uncommonsense-uk.com/2012/journeying-into-web-access-management-josso-part-1/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently looking for a Web Access Management tool to manage and control access to a number of hosted applications.</p>
<p>Wikipedia defines Web Access Management as:<br />
Authentication Management<br />
Policy-based Authorizations<br />
Audit &amp; Reporting Services<br />
Single sign-on Convenience</p>
<p>I&#8217;ve had previous experience in this space using CA&#8217;s Siteminder product but this time I want to experience some &#8220;open&#8221; alternatives where the information on the use and configuration of the product isn&#8217;t as limited and the costs aren&#8217;t as great.</p>
<p>Initially I thought I&#8217;d have a look at <a title="Java Open Single Sign ON" href="http://www.josso.org" target="_blank">JOSSO</a> (Java Open Single Sign On)</p>
<h1>Installing Josso</h1>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">useradd josso<br />
Download josso-ce-<span style="color: #000000;">2.2</span>.x.tar.gz from sf.net<br />
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>opt<br />
<span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>josso-ce-<span style="color: #000000;">2.2</span>.x.tar.gz<br />
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> josso: <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>josso-ce-<span style="color: #000000;">2.2</span>.x<br />
<span style="color: #c20cb9; font-weight: bold;">su</span> - josso<br />
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>josso-ce-<span style="color: #000000;">2.2</span>.x<span style="color: #000000; font-weight: bold;">/</span>bin<br />
.<span style="color: #000000; font-weight: bold;">/</span>atricore<br />
<br />
atricore: JAVA_HOME not <span style="color: #000000; font-weight: bold;">set</span>; results may vary<br />
__ _____ _____ _____ _____ ___ _____ _____<br />
__<span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">|</span> __<span style="color: #000000; font-weight: bold;">|</span> __<span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">|</span>_ <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">|</span> __<span style="color: #000000; font-weight: bold;">|</span><br />
<span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">|</span>__ <span style="color: #000000; font-weight: bold;">|</span>__ <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">|</span> _<span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #660033;">--</span><span style="color: #000000; font-weight: bold;">|</span> __<span style="color: #000000; font-weight: bold;">|</span><br />
<span style="color: #000000; font-weight: bold;">|</span>_____<span style="color: #000000; font-weight: bold;">|</span>_____<span style="color: #000000; font-weight: bold;">|</span>_____<span style="color: #000000; font-weight: bold;">|</span>_____<span style="color: #000000; font-weight: bold;">|</span>_____<span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">|</span>___<span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">|</span>_____<span style="color: #000000; font-weight: bold;">|</span>_____<span style="color: #000000; font-weight: bold;">|</span><br />
<br />
JOSSO <span style="color: #000000;">2</span> Community Edition <span style="color: #7a0874; font-weight: bold;">&#40;</span>2.2.1<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
Atricore Console <span style="color: #7a0874; font-weight: bold;">&#40;</span>1.1.1<span style="color: #7a0874; font-weight: bold;">&#41;</span> http:<span style="color: #000000; font-weight: bold;">//</span>localhost:<span style="color: #000000;">8081</span><span style="color: #000000; font-weight: bold;">/</span>atricore-console<span style="color: #000000; font-weight: bold;">/</span><br />
Atricore Identity Bus <span style="color: #7a0874; font-weight: bold;">&#40;</span>1.2.1<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<br />
Apache Felix Karaf <span style="color: #7a0874; font-weight: bold;">&#40;</span>2.2.1<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
Hit <span style="color: #ff0000;">'&lt;tab&gt;'</span> <span style="color: #000000; font-weight: bold;">for</span> a list of available commands<br />
and <span style="color: #ff0000;">'[cmd] --help'</span> <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #7a0874; font-weight: bold;">help</span> on a specific command.<br />
<br />
Hit <span style="color: #ff0000;">'&lt;ctrl-d&gt;'</span> or <span style="color: #7a0874; font-weight: bold;">type</span> <span style="color: #ff0000;">'osgi:shutdown'</span> to shutdown JOSSO <span style="color: #000000;">2</span> CE.<br />
<br />
karaf<span style="color: #000000; font-weight: bold;">@</span>josso-ce<span style="color: #000000; font-weight: bold;">&gt;</span></div></div>
<p>Enter &#8220;osgi:list | grep Atricore&#8221; to confirm the services are started and running.</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">...<br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">41</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>Resolved <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">60</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Atricore IDBus :: Kernel : Web Console Branding <span style="color: #7a0874; font-weight: bold;">&#40;</span>1.2.1<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">148</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>Active <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">60</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Atricore IDBus :: Kernel : Support <span style="color: #7a0874; font-weight: bold;">&#40;</span>1.2.1<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">149</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>Active <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">60</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Atricore IDBus :: Kernel : XML Digital Signature Binding <span style="color: #7a0874; font-weight: bold;">&#40;</span>1.2.1<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">150</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>Active <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">60</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Atricore IDBus :: Kernel : SPML <span style="color: #000000;">2</span> w<span style="color: #000000; font-weight: bold;">/</span>DSML Profile Binding <span style="color: #7a0874; font-weight: bold;">&#40;</span>1.2.1<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">151</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>Active <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">60</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Atricore IDBus :: Kernel : SAML R <span style="color: #000000;">2.0</span> Protocol Binding <span style="color: #7a0874; font-weight: bold;">&#40;</span>1.2.1<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">152</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>Active <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">60</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Atricore IDBus :: Kernel : SAML R1.1 Protocol Binding <span style="color: #7a0874; font-weight: bold;">&#40;</span>1.2.1<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">153</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>Active <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">60</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Atricore IDBus :: Kernel : Atricore SSO <span style="color: #000000;">1.0</span> Protocol Binding <span style="color: #7a0874; font-weight: bold;">&#40;</span>1.2.1<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
...</div></div>
<p>Browse to http://jossohost:8081/atricore-console/ default login is admin:admin</p>
]]></content:encoded>
			<wfw:commentRss>http://uncommonsense-uk.com/2012/journeying-into-web-access-management-josso-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java Service Management with YAJSW</title>
		<link>http://uncommonsense-uk.com/2012/java-service-management-with-yajsw/</link>
		<comments>http://uncommonsense-uk.com/2012/java-service-management-with-yajsw/#comments</comments>
		<pubDate>Fri, 10 Feb 2012 17:52:58 +0000</pubDate>
		<dc:creator>actionjack</dc:creator>
				<category><![CDATA[deployment]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[service wrapper]]></category>

		<guid isPermaLink="false">http://uncommonsense-uk.com/?p=184</guid>
		<description><![CDATA[Ok so what actually is Java Service Management? Well it means easily enabling your java application to be run as a daemon with all the bells and whistles e.g. clean service stopping and starting, logging and jmx profiling. I was (&#8230;)</p><p><a href="http://uncommonsense-uk.com/2012/java-service-management-with-yajsw/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Ok so what actually is Java Service Management? Well it means easily enabling your java application to be run as a daemon with all the bells and whistles e.g. clean service stopping and starting, logging and jmx profiling.</p>
<p>I was working on a project that ran a java jar file e.g. java -cp application.jar and I initially wrote a simple initscript to stop and start it.Unfortunately it would not daemonize cleanly and dump tons of &#8220;useful&#8221; info and debug data to the console, eventually it got to the point where I only felt comfortable starting it in using screen.</p>
<p>I finally got time to revisit the situation and look at Tanuki&#8217;s Java Service Wrapper software, unfortunately it was incompatible with the project I was working on (and by incompatible I mean it was going to cost me lots and lots of license fees).</p>
<p>Enter YAJSW &#8211; Yet Another Java Service Wrapper (http://yajsw.sourceforge.net/):</p>
<blockquote><p>&#8220;YAJSW is a java centric implementation of the java service wrapper by tanuki (JSW).<br />
It aims at being mostly configuration compliant with the original. It should therefore be easy to switch from JSW to YAJSW.&#8221;</p></blockquote>
<p>And it only took me minutes to get working:</p>
<ul>
<ul>
<li>Download yajsw from Sourceforge</li>
<li>unzip to your application&#8217;s working directory</li>
<li>Run the java application and go to $applicationdir/yajsw/bat</li>
<li>Change the mode to all the shell scripts e.g. chmod a+x *.sh</li>
<li>Run ./genConfig.sh $java_app_pid</li>
<li>Edit $applicationdir/yajsw/conf/wrapper.conf and customise it to your needs</li>
<li>Run ./runConsole.sh to check if the application is running correctly.</li>
<li>If you want to install the service run ./installService.sh this will create the required initscripts and place them into /etc/init.d/ and /etc/rc.d/runlevel directories.</li>
<li>You can then choose to either run the startService or stopService shell scripts or use the newly created one in /etc/init.d.</li>
</ul>
</ul>
<p>More detailed configuration can be found on <a title="Yet Another Java Service Wrapper" href="http://yajsw.sourceforge.net/" target="_blank">their main site</a> and this one is definitely a keeper for my java deployment toolkit.</p>
]]></content:encoded>
			<wfw:commentRss>http://uncommonsense-uk.com/2012/java-service-management-with-yajsw/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moving from puppet-iptables to puppet-firewall</title>
		<link>http://uncommonsense-uk.com/2012/moving-from-puppet-iptables-to-puppet-firewall/</link>
		<comments>http://uncommonsense-uk.com/2012/moving-from-puppet-iptables-to-puppet-firewall/#comments</comments>
		<pubDate>Fri, 03 Feb 2012 16:53:26 +0000</pubDate>
		<dc:creator>actionjack</dc:creator>
				<category><![CDATA[firewall]]></category>
		<category><![CDATA[puppet]]></category>

		<guid isPermaLink="false">http://uncommonsense-uk.com/?p=112</guid>
		<description><![CDATA[After months of procrastination I finally migrated from puppet-iptables to puppet-firewall and I&#8217;m so glad that I did! I&#8217;m beginning to see what Ken Barber (@ken_barber) was hinting at when he told me at the last EU Devops Days conference (&#8230;)</p><p><a href="http://uncommonsense-uk.com/2012/moving-from-puppet-iptables-to-puppet-firewall/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>After months of procrastination I finally migrated from puppet-iptables to puppet-firewall and I&#8217;m so glad that I did!</p>
<p>I&#8217;m beginning to see what Ken Barber (@ken_barber) was hinting at when he told me at the last EU Devops Days conference that configuring linux firewalls was just tip of the iceberg, I can now see the path of it being used to configure Cisco and Juniper based firewalls eventually.</p>
<p>To get the puppet-firewall module working for me out of the box I had to add the following to my site.pp</p>
<div class="codecolorer-container ruby blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#CC0066; font-weight:bold;">exec</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#996600;">'clear-firewall'</span>:<br />
&nbsp; command <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'/sbin/iptables -F'</span>,<br />
<br />
&nbsp; refreshonly <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span>,<br />
&nbsp; <br />
<span style="color:#006600; font-weight:bold;">&#125;</span><br />
<br />
<span style="color:#CC0066; font-weight:bold;">exec</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#996600;">'persist-firewall'</span>:<br />
<br />
&nbsp; command <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'/sbin/iptables-save &gt;/etc/sysconfig/iptables'</span>,<br />
<br />
&nbsp; refreshonly <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span>,<br />
<br />
<span style="color:#006600; font-weight:bold;">&#125;</span><br />
<br />
Firewall <span style="color:#006600; font-weight:bold;">&#123;</span><br />
<br />
&nbsp; subscribe <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#CC0066; font-weight:bold;">Exec</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'clear-firewall'</span><span style="color:#006600; font-weight:bold;">&#93;</span>,<br />
<br />
&nbsp; notify <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#CC0066; font-weight:bold;">Exec</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'persist-firewall'</span><span style="color:#006600; font-weight:bold;">&#93;</span>,<br />
<br />
<span style="color:#006600; font-weight:bold;">&#125;</span></div></div>
<p>After that I configured a base firewall module e.g.</p>
<div class="codecolorer-container ruby blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#9966CC; font-weight:bold;">class</span> basefirewall <span style="color:#006600; font-weight:bold;">&#123;</span><br />
<br />
resources <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#996600;">'firewall'</span>:<br />
<br />
&nbsp; &nbsp; purge <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span>,<br />
<br />
<span style="color:#006600; font-weight:bold;">&#125;</span><br />
<br />
firewall <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#996600;">&quot;001 accept all icmp requests&quot;</span>:<br />
<br />
&nbsp; &nbsp; proto <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'icmp'</span>,<br />
<br />
&nbsp; &nbsp; action &nbsp;<span style="color:#006600; font-weight:bold;">=&gt;</span> accept,<br />
<br />
<span style="color:#006600; font-weight:bold;">&#125;</span><br />
<br />
firewall <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#996600;">'002 INPUT allow loopback'</span>:<br />
<br />
&nbsp; &nbsp; iniface <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'lo'</span>,<br />
<br />
&nbsp; &nbsp; chain &nbsp; <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'INPUT'</span>,<br />
<br />
&nbsp; &nbsp; action &nbsp; &nbsp;<span style="color:#006600; font-weight:bold;">=&gt;</span> accept,<br />
<br />
<span style="color:#006600; font-weight:bold;">&#125;</span><br />
<br />
firewall <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#996600;">'000 INPUT allow related and established'</span>:<br />
<br />
&nbsp; &nbsp; state <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'RELATED'</span>, <span style="color:#996600;">'ESTABLISHED'</span><span style="color:#006600; font-weight:bold;">&#93;</span>,<br />
<br />
&nbsp; &nbsp; action &nbsp;<span style="color:#006600; font-weight:bold;">=&gt;</span> accept,<br />
<br />
&nbsp; &nbsp; proto <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'all'</span>,<br />
<br />
<span style="color:#006600; font-weight:bold;">&#125;</span><br />
<br />
…<br />
<br />
<span style="color:#006600; font-weight:bold;">&#125;</span></div></div>
<p>&nbsp;</p>
<p>Top Marks for this module!</p>
<p><a href="https://github.com/puppetlabs/puppetlabs-firewall">http://github.com/puppetlabs/puppetlabs-firewall</a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://uncommonsense-uk.com/2012/moving-from-puppet-iptables-to-puppet-firewall/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HAProxy and MySQL lockouts</title>
		<link>http://uncommonsense-uk.com/2012/haproxy-and-mysql-lockouts/</link>
		<comments>http://uncommonsense-uk.com/2012/haproxy-and-mysql-lockouts/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 18:32:46 +0000</pubDate>
		<dc:creator>actionjack</dc:creator>
				<category><![CDATA[galera]]></category>
		<category><![CDATA[haproxy]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://uncommonsense-uk.com/?p=108</guid>
		<description><![CDATA[For the last couple of days I&#8217;ve been playing around with HAProxy MySQL/Galera to create a fault tolerant, load balancing database backend that is invisible to the application. Unfortunately, I was having an issues, that after a set amount of (&#8230;)</p><p><a href="http://uncommonsense-uk.com/2012/haproxy-and-mysql-lockouts/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>For the last couple of days I&#8217;ve been playing around with HAProxy MySQL/Galera to create a fault tolerant, load balancing database backend that is invisible to the application.</p>
<p>Unfortunately, I was having an issues, that after a set amount of time the MySQL nodes would stop accepting connections.</p>
<p>After a bit of failed googling I visited the #haproxy irc chat on Freenode and a couple of helpful fellows called @vr and @meineerde pointed me to this section of the HAProxy configuration guide:</p>
<blockquote><p>  …It was reported that it can generate lockout if check is too frequent and/or if there is not enough traffic. In fact, you need in this case to check MySQL &#8220;max_connect_errors&#8221; value as if a connection is established successfully within fewer than MySQL &#8220;max_connect_errors&#8221; attempts after a previous connection was interrupted, the error count for the host is cleared to zero. If HAProxy&#8217;s server get blocked, the &#8220;FLUSH HOSTS&#8221; statement is the only way to unblock it.</p></blockquote>
<p>I had already set the max_connect_errors in my.cnf file to be 1000 but I guess that was no way enough. After looking around the net a bit looking for inspiration I&#8217;ve decided to set it to:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[mysqld]<br />
<br />
max_connect_errors=999999</div></div>
]]></content:encoded>
			<wfw:commentRss>http://uncommonsense-uk.com/2012/haproxy-and-mysql-lockouts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress 0 to 60 in 5 minutes flat</title>
		<link>http://uncommonsense-uk.com/2012/wordpress-0-to-60-in-5-minutes-flat/</link>
		<comments>http://uncommonsense-uk.com/2012/wordpress-0-to-60-in-5-minutes-flat/#comments</comments>
		<pubDate>Sun, 01 Jan 2012 13:20:00 +0000</pubDate>
		<dc:creator>lesliebuna</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[HTTP Web Daemon]]></category>
		<category><![CDATA[MySQL database]]></category>
		<category><![CDATA[WordPress server]]></category>

		<guid isPermaLink="false">http://uncommonsense-uk.com/?p=239</guid>
		<description><![CDATA[So Steve and I agreed that our first sprint was to build a WordPress server, that’ll be a snap to do (or so I thought!) In order to create a WordPress server I need 4 main components: A Server with (&#8230;)</p><p><a href="http://uncommonsense-uk.com/2012/wordpress-0-to-60-in-5-minutes-flat/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>So Steve and I agreed that our first sprint was to build a WordPress server, that’ll be a snap to do (or so I thought!)</p>
<p>In order to create a WordPress server I need 4 main components:</p>
<p>A Server with an Operating System installed<br />
A MySQL database<br />
A HTTP Web Daemon and<br />
The WordPress application itself.<br />
So like a good boy scout I set off about installing a WordPress on a centos box by hand and I found some most excellent instructions <a href="http://http://blog.adlibre.org/" target="_blank">here</a> by Andrew at Adlibre.</p>
<p>I hit my first problem, the WordPress package from EPEL for RHEL/CentOS 5 is quite old, it’s 2.8 while the version of WordPress with all the new hotness is 3.0.</p>
<p>Hmm ”old busted” or “new hotness” (not to say the 2.8 is either old or busted but you get what I mean). I decided I’d roll with the new hotness and then I hit another dilemma I couldn’t find a RPM for RHEL/CentOS 5, so should I just roll out the tar ball or create a package for it?</p>
<p>This is currently a hot topic in the Devops community and when I went to Devops Hamburg back in October one of the more popular open space sessions was “packaging vs. non-packaging, when and what?” and the main output was it “depends”.</p>
<p>However I wanted a zero touch and fully automated deployment so I investigated both methods and weighted them up:</p>
<p>Scenario 1 – Installation of Tar ball</p>
<p>Download WordPress tar ball to the server file system<br />
Untar the package and install it to the correct location<br />
Track the installation and ensure that it is valid (correctly installed, all checksums in place (Thanks AndrewH!)) also be able to cleanly handle upgrades.</p>
<p>Scenario 2 – Installation RPM</p>
<p>Package WordPress RPM<br />
Yum install WordPress</p>
<p>I quickly came to the conclusion that the packaging case won over when I imagined the amount of puppet code I’d have to churn out to do scenario #1 and make it robust versus just using what I believed was the right tool for the job i.e. RPM and keeping it as simple as possible.</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Name: wordpress<br />
Version: 3.0.1<br />
Release: <span style="color: #000000;">1</span><br />
Group: System<span style="color: #000000; font-weight: bold;">/</span>Servers<br />
Summary: Personal publishing platform.<br />
URL: http:<span style="color: #000000; font-weight: bold;">//</span>wordpress.org<span style="color: #000000; font-weight: bold;">/</span><br />
Source0: http:<span style="color: #000000; font-weight: bold;">//</span>wordpress.org<span style="color: #000000; font-weight: bold;">/%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>name<span style="color: #7a0874; font-weight: bold;">&#125;</span>-<span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>version<span style="color: #7a0874; font-weight: bold;">&#125;</span>.tar.gz<br />
Vendor: WordPress<br />
License: GPLv2+<br />
Packager: Martin Jackson<br />
BuildArch: noarch<br />
BuildRoot: <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>_tmppath<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>name<span style="color: #7a0874; font-weight: bold;">&#125;</span>-<span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>version<span style="color: #7a0874; font-weight: bold;">&#125;</span>-root<br />
Requires: php<br />
Requires: php-mysql<br />
<br />
<span style="color: #000000; font-weight: bold;">%</span>description<br />
WordPress is an open <span style="color: #7a0874; font-weight: bold;">source</span> Content Management System <span style="color: #7a0874; font-weight: bold;">&#40;</span>CMS<span style="color: #7a0874; font-weight: bold;">&#41;</span>, often used <span style="color: #c20cb9; font-weight: bold;">as</span> a<br />
blog publishing application, powered by PHP and MySQL. It has many features<br />
including a plug-in architecture and a template system.<br />
<br />
<span style="color: #000000; font-weight: bold;">%</span>prep<br />
<span style="color: #000000; font-weight: bold;">%</span>setup <span style="color: #660033;">-q</span> <span style="color: #660033;">-n</span> <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>name<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<br />
<span style="color: #666666; font-style: italic;"># fix dir perms</span><br />
<span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-type</span> d <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">xargs</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">755</span><br />
<br />
<span style="color: #666666; font-style: italic;"># fix file perms</span><br />
<span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-type</span> f <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">xargs</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">644</span><br />
<br />
<span style="color: #666666; font-style: italic;"># disable wordpress update option</span><br />
<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-i</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;s/add_action/#add_action/g&quot;</span> wp-includes<span style="color: #000000; font-weight: bold;">/</span>update.php<br />
<br />
<span style="color: #000000; font-weight: bold;">%</span><span style="color: #c20cb9; font-weight: bold;">install</span><br />
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>buildroot<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<br />
<span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>buildroot<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>_sysconfdir<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>httpd<span style="color: #000000; font-weight: bold;">/</span>conf.d<br />
<span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>buildroot<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>_sysconfdir<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>name<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>buildroot<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>name<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<br />
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-aRf</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>buildroot<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>name<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span><br />
<br />
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>buildroot<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>_sysconfdir<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>httpd<span style="color: #000000; font-weight: bold;">/</span>conf.d<span style="color: #000000; font-weight: bold;">/%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>name<span style="color: #7a0874; font-weight: bold;">&#125;</span>.conf <span style="color: #cc0000; font-style: italic;">&lt;&lt; EOF<br />
<br />
Alias /%{name} /var/www/%{name}<br />
<br />
AllowOverride None<br />
Allow from All<br />
<br />
EOF</span><br />
<br />
<span style="color: #666666; font-style: italic;"># cleanup</span><br />
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>buildroot<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>name<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>license.txt<br />
<br />
<span style="color: #000000; font-weight: bold;">%</span>clean<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>buildroot<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">%</span>files<br />
<span style="color: #000000; font-weight: bold;">%</span>defattr<span style="color: #7a0874; font-weight: bold;">&#40;</span>-,root,root<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>name<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<span style="color: #000000; font-weight: bold;">%</span>attr<span style="color: #7a0874; font-weight: bold;">&#40;</span>0644,root,root<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">%</span>config<span style="color: #7a0874; font-weight: bold;">&#40;</span>noreplace<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>_sysconfdir<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>httpd<span style="color: #000000; font-weight: bold;">/</span>conf.d<span style="color: #000000; font-weight: bold;">/%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>name<span style="color: #7a0874; font-weight: bold;">&#125;</span>.conf<br />
<br />
<span style="color: #000000; font-weight: bold;">%</span>changelog<br />
<span style="color: #000000; font-weight: bold;">*</span> Wed Nov <span style="color: #000000;">17</span> <span style="color: #000000;">2010</span> Martin Jackson 3.0.1.1<br />
- initial Red Hat Enterprise package</div></div>
<p>OK now I have my newly packaged WordPress 3.0 rpm and life is good, everything else I need is already packaged and can be easily installed using yum, a few minutes later I have a fully functioning WordPress server.</p>
<p>Now for the fun part, how do a fully automate the creation of a WordPress server end to end.</p>
<p>Firstly I created a custom kickstart profile on my <a href="https://fedorahosted.org/cobbler/">cobbler</a> server to install a minimal Just Enough Operating System (JeOS) base build (faster to install and patch with the minimum security attack surface) with some additional post install stuff to bootstrap puppet.</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">install</span><br />
url <span style="color: #660033;">--url</span> http:<span style="color: #000000; font-weight: bold;">//</span>rasengan<span style="color: #000000; font-weight: bold;">/</span>cblr<span style="color: #000000; font-weight: bold;">/</span>links<span style="color: #000000; font-weight: bold;">/</span>Centos-<span style="color: #000000;">5.5</span>-x86_64<br />
key <span style="color: #660033;">--skip</span><br />
lang en_US.UTF-<span style="color: #000000;">8</span><br />
keyboard uk<br />
skipx<br />
network <span style="color: #660033;">--device</span> eth0 <span style="color: #660033;">--bootproto</span> dhcp <span style="color: #660033;">--hostname</span> testvm-wordpress.uncommonsense.local<br />
<br />
rootpw <span style="color: #660033;">--iscrypted</span> <span style="color: #007800;">$MD5PASSWORD</span><br />
firewall <span style="color: #660033;">--enabled</span> <span style="color: #660033;">--http</span> <span style="color: #660033;">--port</span>=<span style="color: #000000;">22</span>:tcp<br />
authconfig <span style="color: #660033;">--useshadow</span> <span style="color: #660033;">--enablemd5</span><br />
selinux <span style="color: #660033;">--permissive</span><br />
timezone Europe<span style="color: #000000; font-weight: bold;">/</span>London<br />
bootloader <span style="color: #660033;">--location</span>=mbr <span style="color: #660033;">--driveorder</span>=vda<br />
clearpart <span style="color: #660033;">--all</span> <span style="color: #660033;">--initlabel</span><br />
part <span style="color: #000000; font-weight: bold;">/</span>boot <span style="color: #660033;">--fstype</span> ext3 <span style="color: #660033;">--size</span>=<span style="color: #000000;">100</span><br />
part pv.2 <span style="color: #660033;">--size</span>=<span style="color: #000000;">0</span> <span style="color: #660033;">--grow</span> <span style="color: #660033;">--ondisk</span>=vda<br />
volgroup VolGroup00 <span style="color: #660033;">--pesize</span>=<span style="color: #000000;">32768</span> pv.2<br />
logvol swap <span style="color: #660033;">--fstype</span> swap <span style="color: #660033;">--name</span>=LogVol01 <span style="color: #660033;">--vgname</span>=VolGroup00 <span style="color: #660033;">--size</span>=<span style="color: #000000;">512</span> <span style="color: #660033;">--grow</span> <span style="color: #660033;">--maxsize</span>=<span style="color: #000000;">1024</span><br />
logvol <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">--fstype</span> ext3 <span style="color: #660033;">--name</span>=LogVol00 <span style="color: #660033;">--vgname</span>=VolGroup00 <span style="color: #660033;">--size</span>=<span style="color: #000000;">1024</span> <span style="color: #660033;">--grow</span><br />
repo <span style="color: #660033;">--name</span>=source-<span style="color: #000000;">1</span> <span style="color: #660033;">--baseurl</span>=http:<span style="color: #000000; font-weight: bold;">//</span>rasengan<span style="color: #000000; font-weight: bold;">/</span>cobbler<span style="color: #000000; font-weight: bold;">/</span>ks_mirror<span style="color: #000000; font-weight: bold;">/</span>Centos-<span style="color: #000000;">5.5</span>-x86_64<span style="color: #000000; font-weight: bold;">/</span><br />
<span style="color: #007800;">$yum_repo_stanza</span><br />
reboot<br />
<br />
<span style="color: #000000; font-weight: bold;">%</span>packages <span style="color: #660033;">--nobase</span> <span style="color: #660033;">--excludedocs</span><br />
coreutils<br />
dhclient<br />
<span style="color: #c20cb9; font-weight: bold;">yum</span><br />
rpm<br />
ruby<br />
libselinux-ruby<br />
subversion<br />
e2fsprogs<br />
lvm2<br />
grub<br />
sysstat<br />
ntp<br />
openssh-server<br />
openssh-clients<br />
xorg-x11-xauth<br />
<span style="color: #c20cb9; font-weight: bold;">screen</span><br />
net-snmp<br />
net-snmp-utils<br />
system-config-securitylevel<br />
xterm<br />
mutt<br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span><br />
yum-downloadonly<br />
yum-protectbase<br />
<span style="color: #660033;">-dhcpv6-client</span><br />
<span style="color: #660033;">-iptables-ipv6</span><br />
<span style="color: #660033;">-system-config-securitylevel-tui</span><br />
<span style="color: #660033;">-wireless-tools</span><br />
<span style="color: #660033;">-rhpl</span><br />
<span style="color: #660033;">-mdadm</span><br />
<br />
<span style="color: #000000; font-weight: bold;">%</span>post<br />
<span style="color: #7a0874; font-weight: bold;">exec</span> <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>tty3 <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>tty3<br />
<span style="color: #c20cb9; font-weight: bold;">chvt</span> <span style="color: #000000;">3</span><br />
<span style="color: #7a0874; font-weight: bold;">echo</span><br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #666666; font-style: italic;">##############################</span><br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #666666; font-style: italic;"># Running Post Configuration #</span><br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #666666; font-style: italic;">##############################</span><br />
<span style="color: #7a0874; font-weight: bold;">echo</span><br />
rpm <span style="color: #660033;">-Uvh</span> http:<span style="color: #000000; font-weight: bold;">//</span>download.fedora.redhat.com<span style="color: #000000; font-weight: bold;">/</span>pub<span style="color: #000000; font-weight: bold;">/</span>epel<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">5</span><span style="color: #000000; font-weight: bold;">/</span>i386<span style="color: #000000; font-weight: bold;">/</span>epel-release-<span style="color: #000000;">5</span>-<span style="color: #000000;">4</span>.noarch.rpm<br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;192.168.1.5 puppet rasengan rasengan.uncommonsense.local&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>hosts<br />
<span style="color: #c20cb9; font-weight: bold;">yum</span> <span style="color: #660033;">-y</span> <span style="color: #c20cb9; font-weight: bold;">install</span> puppet rdoc<br />
chkconfig puppet on<br />
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>sysconfig<span style="color: #000000; font-weight: bold;">/</span>puppet <span style="color: #000000; font-weight: bold;">&lt;&lt;</span> EOF <span style="color: #666666; font-style: italic;"># The puppetmaster server PUPPET_SERVER=rasengan # If you wish to specify the port to connect to do so here #PUPPET_PORT=8140 # Where to log to. Specify syslog to send log messages to the system log. #PUPPET_LOG=/var/log/puppet/puppet.log # You may specify other parameters to the puppet client here #PUPPET_EXTRA_OPTS=--waitforcert=500 EOF cat &gt; /etc/puppet/puppet.conf &lt;&lt; EOF [main] # The Puppet log directory. # The default value is '$vardir/log'. logdir = /var/log/puppet # Where Puppet PID files are kept. # The default value is '$vardir/run'. rundir = /var/run/puppet # Where SSL certificates are kept. # The default value is '$confdir/ssl'. ssldir = $vardir/ssl libdir = /var/lib/puppet/lib [puppetd] # The file in which puppetd stores a list of the classes # associated with the retrieved configuratiion. Can be loaded in # the separate ``puppet`` executable using the ``--loadclasses`` # option. # The default value is '$confdir/classes.txt'. classfile = $vardir/classes.txt # Where puppetd caches the local configuration. An # extension indicating the cache format is added automatically. # The default value is '$confdir/localconfig'. localconfig = $vardir/localconfig pluginsync = true plugindest = /var/lib/puppet/lib EOF cat &gt;&gt; /etc/rc.local &lt; installed</span><br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<br />
class apache::config <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
File<span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
require =<span style="color: #000000; font-weight: bold;">&gt;</span> Class<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;apache::install&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>,<br />
notify =<span style="color: #000000; font-weight: bold;">&gt;</span> Class<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;apache::service&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>,<br />
owner =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;root&quot;</span>,<br />
group =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;root&quot;</span>,<br />
mode =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000;">644</span><br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<br />
class apache::service <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
service<span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #ff0000;">&quot;httpd&quot;</span>:<br />
ensure =<span style="color: #000000; font-weight: bold;">&gt;</span> running,<br />
<span style="color: #7a0874; font-weight: bold;">enable</span> =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #c20cb9; font-weight: bold;">true</span>,<br />
require =<span style="color: #000000; font-weight: bold;">&gt;</span> Class<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;apache::config&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>,<br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<br />
class apache <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
include apache::install,<br />
apache::config,<br />
apache::service<br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<br />
class apache::disable <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
include apache::install,<br />
apache::config<br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span></div></div>
<p>For the MySQL installation and configuration I wanted something a little more robust since I believed I could make a lot of use out of a good MySQL puppet module. I found it quite ironic that I stumbled across a problem that <a href="http://serverfault.com/questions/161486/puppet-packages-puppet-forge-and-good-puppet-code/195229#195229" target="_blank">I had previously answered on server fault</a> that being how do you find a top notch MySQL module:</p>
<p><span style="font-family: Arial; font-size: medium;">There were quite a few out there and after a fair bit of back and forth I settled on the</span><a href="https://github.com/camptocamp" target="_blank"><span style="text-decoration: underline;"><span style="color: #0000ff; font-family: Arial; font-size: medium;"> Camp to Camp boys’ </span></span></a><span style="font-family: Arial; font-size: medium;">MySQL puppet module, it is very functional and quite compact in the amount of supporting modules that are needed to make it function:</span></p>
<p>There were quite a few out there and after a fair bit of back and forth I settled on the Camp to Camp boys’ MySQL puppet module, it is very functional and quite compact in the amount of supporting modules that are needed to make it function:</p>
<p><a href="https://github.com/camptocamp/puppet-mysql" target="_blank">puppet-mysql</a><br />
<a href="https://github.com/camptocamp/puppet-augeas" target="_blank">puppet-augeas</a><br />
<a href="https://github.com/camptocamp/puppet-common" target="_blank">puppet-common</a></p>
<p>You’ll need to have the plugin sync enabled in your puppet.conf for this to work because it copies some custom facts and plugins to the client in order to create the databases.</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>main<span style="color: #7a0874; font-weight: bold;">&#93;</span><br />
<span style="color: #000000;">2</span> libdir = <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>puppet<span style="color: #000000; font-weight: bold;">/</span>lib<br />
<span style="color: #000000;">3</span><br />
<span style="color: #000000;">4</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>puppetd<span style="color: #7a0874; font-weight: bold;">&#93;</span><br />
<span style="color: #000000;">5</span> pluginsync = <span style="color: #c20cb9; font-weight: bold;">true</span><br />
<span style="color: #000000;">6</span> plugindest = <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>puppet<span style="color: #000000; font-weight: bold;">/</span>lib</div></div>
<p>Onto the final stretch I need to install WordPress so I whipped up the following puppet module to install WordPress.</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">?<br />
<span style="color: #666666; font-style: italic;"># Class: wordpress</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># This class manages the wordpress blogging application</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># Parameters:</span><br />
<span style="color: #666666; font-style: italic;"># None</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># Actions:</span><br />
<span style="color: #666666; font-style: italic;"># Install the wordpress blogging application</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># Requires:</span><br />
<span style="color: #666666; font-style: italic;"># - Package[&quot;apache&quot;,&quot;mysqlclient&quot;]</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># Sample Usage:</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<br />
class wordpress::install <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
<span style="color: #007800;">$packagelist</span> = <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;php&quot;</span>,<span style="color: #ff0000;">&quot;php-mysql&quot;</span>,<span style="color: #ff0000;">&quot;wordpress&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><br />
package<span style="color: #7a0874; font-weight: bold;">&#123;</span> <span style="color: #007800;">$packagelist</span>:<br />
ensure =<span style="color: #000000; font-weight: bold;">&gt;</span> latest,<br />
require =<span style="color: #000000; font-weight: bold;">&gt;</span> Class<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;repository::uncommonsense&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>,<br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<br />
class wordpress::config <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
File<span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
require =<span style="color: #000000; font-weight: bold;">&gt;</span> Class<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;wordpress::install&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>,<br />
notify =<span style="color: #000000; font-weight: bold;">&gt;</span> Class<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;apache::service&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>,<br />
owner =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;root&quot;</span>,<br />
group =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;root&quot;</span>,<br />
mode =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000;">644</span><br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<br />
class wordpress <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
include wordpress::install,<br />
wordpress::config<br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<br />
class wordpress::disable <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
include wordpress::install<br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span></div></div>
<p>I used the following entry in my nodes.pp file to pull it all together</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">node <span style="color: #ff0000;">&quot;testvm-wordpress.uncommonsense.local&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
include repository::uncommonsense<br />
include apache<br />
include augeas<br />
include wordpress<br />
<span style="color: #007800;">$mysql_password</span> = <span style="color: #ff0000;">&quot;foo&quot;</span><br />
include mysql::server::small<br />
<br />
mysql::rights <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #ff0000;">&quot;Set rights for wordpress database&quot;</span>:<br />
user =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;username&quot;</span>,<br />
password =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;password&quot;</span>,<br />
database =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;wordpress&quot;</span>,<br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<br />
mysql::database <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #ff0000;">&quot;wordpress&quot;</span>:<br />
ensure =<span style="color: #000000; font-weight: bold;">&gt;</span> present<br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span></div></div>
<p>Ok so I now have a fully functional WordPress Server in about 5 minutes. This is just a basic setup but it demonstrates what can be done without too much effort and if I wanted to take this further in the future, I would create an erb template for the wp-config.php so that the database settings are populated by puppet using the existing username, password and database name variables.</p>
]]></content:encoded>
			<wfw:commentRss>http://uncommonsense-uk.com/2012/wordpress-0-to-60-in-5-minutes-flat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Who’s the JBOSS? Rapid Jboss 4.2.3GA AS server installs on CentOS 5</title>
		<link>http://uncommonsense-uk.com/2012/whos-the-jboss-rapid-jboss-4-2-3ga-as-server-installs-on-centos-5-2/</link>
		<comments>http://uncommonsense-uk.com/2012/whos-the-jboss-rapid-jboss-4-2-3ga-as-server-installs-on-centos-5-2/#comments</comments>
		<pubDate>Sun, 01 Jan 2012 09:41:48 +0000</pubDate>
		<dc:creator>lesliebuna</dc:creator>
				<category><![CDATA[JBoss]]></category>
		<category><![CDATA[CentOS 5]]></category>
		<category><![CDATA[JBOSS]]></category>

		<guid isPermaLink="false">http://uncommonsense-uk.com/?p=225</guid>
		<description><![CDATA[We have just completed the first part of this sprint – creating an automated jboss server installation based on Jboss 4.2.3GA and CentOS 5. This one went relatively smoothly thanks to following resources: Craig Andrews’ Install JBoss 4.2 on Centos/RHEL (&#8230;)</p><p><a href="http://uncommonsense-uk.com/2012/whos-the-jboss-rapid-jboss-4-2-3ga-as-server-installs-on-centos-5-2/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>We have just completed the first part of this sprint – creating an automated jboss server installation based on Jboss 4.2.3GA and CentOS 5.</p>
<p>This one went relatively smoothly thanks to following resources:</p>
<p>Craig Andrews’ Install JBoss 4.2 on Centos/RHEL 5 Blog Post,<br />
The JPackage Project,<br />
R.I. Pienaars Puppet-Concat module and,<br />
Rob Myers [JPackage-discuss] /usr/bin/rebuild-security-providers is needed by package java-1.4.2-gcj-compat fix</p>
<p>Once out of the gate we started with the meatcloud approach and installed everything by hand to find out what the ins and outs were and identify any possible gotcha’s. Straight off the bat we found that there was a problem installing the jboss application server on CentOS/RHEL5 using the JPackage repository due to a rebuild-security-providers dependency, after practicing a bit of google-fu I found Craig Andrews post that pointed us to the following RPM Spec file from Rob Myers JPackage discussion post:</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Name: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jpackage-utils-compat-el5<br />
Version: &nbsp; &nbsp; &nbsp; &nbsp;0.0.1<br />
Release: &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>?dist<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>?repo<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
Epoch: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">0</span><br />
Summary: &nbsp; &nbsp; &nbsp; &nbsp;Compatibility For RHEL5 and JPackage<br />
License: &nbsp; &nbsp; &nbsp; &nbsp;GPL<br />
URL: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;http:<span style="color: #000000; font-weight: bold;">//</span>rmyers.fedorapeople.org<span style="color: #000000; font-weight: bold;">/</span>jpackage-utils-compat-el5<br />
Group: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Utilities<br />
BuildRoot: &nbsp; &nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">mktemp</span> <span style="color: #660033;">-ud</span> <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>_tmppath<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>name<span style="color: #7a0874; font-weight: bold;">&#125;</span>-<span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>version<span style="color: #7a0874; font-weight: bold;">&#125;</span>-<span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>release<span style="color: #7a0874; font-weight: bold;">&#125;</span>-XXXXXX<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
&nbsp;<br />
BuildArch: &nbsp; &nbsp; &nbsp;noarch<br />
Requires: &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">bash</span><br />
&nbsp;<br />
<span style="color: #000000; font-weight: bold;">%</span>description<br />
Compatibility <span style="color: #000000; font-weight: bold;">for</span> JPackage Utils between RHEL5 and the JPackage Project.<br />
&nbsp;<br />
<span style="color: #000000; font-weight: bold;">%</span>prep<br />
<span style="color: #666666; font-style: italic;"># no setup</span><br />
&nbsp;<br />
<span style="color: #000000; font-weight: bold;">%</span>build<br />
<span style="color: #666666; font-style: italic;"># no building</span><br />
&nbsp;<br />
<span style="color: #000000; font-weight: bold;">%</span><span style="color: #c20cb9; font-weight: bold;">install</span><br />
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #007800;">$RPM_BUILD_ROOT</span><br />
&nbsp;<br />
<span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-dm</span> <span style="color: #000000;">755</span> <span style="color: #800000;">${RPM_BUILD_ROOT}</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>_bindir<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-dm</span> <span style="color: #000000;">755</span> <span style="color: #800000;">${RPM_BUILD_ROOT}</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>_sysconfdir<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>java<span style="color: #000000; font-weight: bold;">/</span>security<br />
<span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-dm</span> <span style="color: #000000;">755</span> <span style="color: #800000;">${RPM_BUILD_ROOT}</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>_sysconfdir<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>java<span style="color: #000000; font-weight: bold;">/</span>security<span style="color: #000000; font-weight: bold;">/</span>security.d<br />
&nbsp;<br />
<span style="color: #7a0874; font-weight: bold;">pushd</span> <span style="color: #800000;">${RPM_BUILD_ROOT}</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>_bindir<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
&nbsp;<br />
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">&gt;</span> rebuild-security-providers <span style="color: #cc0000; font-style: italic;">&lt;&lt; EOF<br />
&nbsp;<br />
#!/bin/bash<br />
# Rebuild the list of security providers in classpath.security<br />
&nbsp;<br />
secfiles=&quot;/usr/lib/security/classpath.security /usr/lib64/security/classpath.security&quot;<br />
&nbsp;<br />
for secfile in \$secfiles; do<br />
&nbsp; # check if this classpath.security file exists<br />
&nbsp; [ -f &quot;\$secfile&quot; ] || continue<br />
&nbsp;<br />
&nbsp; sed -i '/^security\.provider\./d' &quot;\$secfile&quot;<br />
&nbsp;<br />
&nbsp; count=0<br />
&nbsp; for provider in \$(ls /etc/java/security/security.d)<br />
&nbsp; do<br />
&nbsp; &nbsp; count=\$((count + 1))<br />
&nbsp; &nbsp; echo &quot;security.provider.\${count}=\${provider#*-}&quot; &gt;&gt; &quot;\$secfile&quot;<br />
&nbsp; done<br />
done<br />
EOF</span><br />
&nbsp;<br />
<span style="color: #7a0874; font-weight: bold;">popd</span><br />
&nbsp;<br />
<span style="color: #000000; font-weight: bold;">%</span>clean<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #007800;">$RPM_BUILD_ROOT</span><br />
&nbsp;<br />
<span style="color: #000000; font-weight: bold;">%</span>files<br />
<span style="color: #000000; font-weight: bold;">%</span>defattr<span style="color: #7a0874; font-weight: bold;">&#40;</span>-,root,root,-<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>_bindir<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>rebuild-security-providers<br />
<span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>_sysconfdir<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>java<span style="color: #000000; font-weight: bold;">/</span>security<br />
<span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>_sysconfdir<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>java<span style="color: #000000; font-weight: bold;">/</span>security<span style="color: #000000; font-weight: bold;">/</span>security.d<br />
&nbsp;<br />
<span style="color: #000000; font-weight: bold;">%</span>changelog<br />
<br />
<span style="color: #000000; font-weight: bold;">*</span> Thu Jul &nbsp;<span style="color: #000000;">3</span> <span style="color: #000000;">2008</span> Rob Myers <span style="color: #000000; font-weight: bold;">&lt;</span>rob.myers at gtri.gatech.edu<span style="color: #000000; font-weight: bold;">&gt;</span> - <span style="color: #000000;">0</span>:0.0.1-<span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>?dist<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>?repo<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
- initial release</div></div>
<p>After vetting what the specfile actually did (Always do this!) and deeming it safe to use we rolled our RPM from it and placed it into our cobbler repository and did a “yum install jbossas”. The default Jpackage installation of Jboss is configured to only listen on localhost for security purposes but we wanted to expose it to our network for testing so we set the JBOSS_IP variable to 0.0.0.0 in the /etc/sysconfig/jbossas file and restarted the jbossas service to make it accessible remotely. It’s all good, just a simple “chkconfig jbossas on” and we are done, a sample jboss server ready to go, now the fun part, automating to whole deployment process from scratch. Breaking out my puppet toolkit, we went about writing a module that would install jbossas, configure it, get it running and set it to autostart on reboot. We also wanted to add some configurability to allow me to change the settings in /etc/sysconfig/jbossas e.g. setting the JBOSS_IP or JAVA_OPTS variables.</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># Class: jboss</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># This class manages the jboss application server</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># Parameters:</span><br />
<span style="color: #666666; font-style: italic;"># &nbsp; None</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># Actions:</span><br />
<span style="color: #666666; font-style: italic;"># &nbsp; Install the jboss application server</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># Requires:</span><br />
<span style="color: #666666; font-style: italic;"># &nbsp; - Package[]</span><br />
<span style="color: #666666; font-style: italic;"># &nbsp; - R.I. Pienaar's puppet-concat module</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># Sample Usage:</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
&nbsp;<br />
class jboss::install <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #007800;">$packagelist</span> = <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;jpackage-utils-compat-el5&quot;</span>,<span style="color: #ff0000;">&quot;jbossas&quot;</span>,<span style="color: #ff0000;">&quot;jbossweb2&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><br />
&nbsp; &nbsp; package<span style="color: #7a0874; font-weight: bold;">&#123;</span> <span style="color: #007800;">$packagelist</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; ensure &nbsp;=<span style="color: #000000; font-weight: bold;">&gt;</span> latest,<br />
&nbsp; &nbsp; &nbsp; &nbsp; require =<span style="color: #000000; font-weight: bold;">&gt;</span> Class<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;repository::uncommonsense&quot;</span>,<span style="color: #ff0000;">&quot;repository::jpackage::generic&quot;</span>,<span style="color: #ff0000;">&quot;repository::jpackage::el5&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>,<br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
&nbsp;<br />
class jboss::config <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
&nbsp; &nbsp; File<span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; require =<span style="color: #000000; font-weight: bold;">&gt;</span> Class<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;jboss::install&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; notify &nbsp;=<span style="color: #000000; font-weight: bold;">&gt;</span> Class<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;jboss::service&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; owner &nbsp; =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;root&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; group &nbsp; =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;root&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; mode &nbsp; &nbsp;=<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000;">644</span><br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
&nbsp;<br />
class jboss::service <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
&nbsp; &nbsp; service<span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;jbossas&quot;</span>,<span style="color: #ff0000;">&quot;jbossweb2&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; ensure &nbsp;=<span style="color: #000000; font-weight: bold;">&gt;</span> running,<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">enable</span> &nbsp;=<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #c20cb9; font-weight: bold;">true</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; require =<span style="color: #000000; font-weight: bold;">&gt;</span> Class<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;jboss::config&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>,<br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
&nbsp;<br />
class jboss <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
&nbsp; &nbsp; include jboss::install,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jboss::service,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jboss::config<br />
&nbsp;<br />
&nbsp; &nbsp; include concat::setup<br />
&nbsp;<br />
&nbsp; &nbsp; concat<span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #ff0000;">&quot;/etc/sysconfig/jbossas&quot;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; notify =<span style="color: #000000; font-weight: bold;">&gt;</span> Service<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;jbossas&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>,<br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
&nbsp;<br />
&nbsp; &nbsp; concat::fragment<span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #ff0000;">&quot;jboss_sysconfig_header&quot;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp;target &nbsp;=<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;/etc/sysconfig/jbossas&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp;content =<span style="color: #000000; font-weight: bold;">&gt;</span> template<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">&quot;jboss/jbossas.erb&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp;order &nbsp; =<span style="color: #000000; font-weight: bold;">&gt;</span> 01,<br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
&nbsp;<br />
class jboss::disable <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
&nbsp; &nbsp; include jboss::install<br />
&nbsp;<br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
&nbsp;<br />
define jboss::setting<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$value</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
&nbsp; &nbsp; concat::fragment<span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #ff0000;">&quot;jboss_<span style="color: #007800;">${name}</span>&quot;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp;target =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;/etc/sysconfig/jbossas&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp;content =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${name}</span> = <span style="color: #007800;">${value}</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>,<br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span></div></div>
<p>We used a slightly modified version of the stock /etc/sysconfig/jbossas file as the template.</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># This file was created and transferred by puppet</span><br />
<span style="color: #666666; font-style: italic;"># Do not edit manually!</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># Service-specific configuration file for jbossas services</span><br />
<span style="color: #666666; font-style: italic;"># This will be sourced by the SysV service script after the global</span><br />
<span style="color: #666666; font-style: italic;"># configuration file /etc/jbossas/jbossas.conf, thus allowing values</span><br />
<span style="color: #666666; font-style: italic;"># to be overridden on a per-service way</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># NEVER change the init script itself:</span><br />
<span style="color: #666666; font-style: italic;"># To change values for all services make your changes in</span><br />
<span style="color: #666666; font-style: italic;"># /etc/jbossas/jbossas.conf</span><br />
<span style="color: #666666; font-style: italic;"># To change values for a specific service, change it here</span><br />
<span style="color: #666666; font-style: italic;"># To create a new service, create a link from /etc/init.d/&lt;you new service&gt; to</span><br />
<span style="color: #666666; font-style: italic;"># /etc/init.d/jbossas (do not copy the init script) and make a copy of the</span><br />
<span style="color: #666666; font-style: italic;"># /etc/sysconfig/jbossas file to /etc/sysconfig/&lt;you new service&gt; and change</span><br />
<span style="color: #666666; font-style: italic;"># the property values so the two services won't conflict</span><br />
<span style="color: #666666; font-style: italic;"># Register the new service in the system as usual (see chkconfig and similars)</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># To change a setting, uncomment the line and set the value for what you want</span><br />
<span style="color: #666666; font-style: italic;"># The values in the comments are the default values, shown here for convenience</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;">#JAVA_HOME=/usr/lib/jvm/java-1.5.0</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;">##define where jboss is - this is the directory containing directories log, bin, conf etc</span><br />
<span style="color: #666666; font-style: italic;">#JBOSS_HOME=&quot;/var/lib/jbossas&quot;</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;">##make sure java is on your path</span><br />
<span style="color: #666666; font-style: italic;">#JAVAPTH=&quot;/usr/lib/jvm/java/bin&quot;</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;">##define the classpath for the shutdown class</span><br />
<span style="color: #666666; font-style: italic;">##JBOSSCP=</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
&nbsp;<br />
<span style="color: #666666; font-style: italic;">##define jboss configuration to start</span><br />
<span style="color: #666666; font-style: italic;">#JBOSSCONF=&quot;production&quot;</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;">##define the script to use to start jboss</span><br />
<span style="color: #666666; font-style: italic;">##JBOSSSH=&quot;$JBOSS_HOME/bin/run.sh -c $JBOSSCONF&quot;</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;">##define what will be done with the console log</span><br />
<span style="color: #666666; font-style: italic;">#JBOSS_CONSOLE=&quot;$JBOSS_HOME/server/$JBOSSCONF/log/console.log&quot;</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;">##define the user under which jboss will run, or use RUNASIS to run as the current user</span><br />
<span style="color: #666666; font-style: italic;">#JBOSSUS=&quot;jboss&quot;</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;">##define the group under which jboss will run</span><br />
<span style="color: #666666; font-style: italic;">#JBOSSGR=&quot;jboss&quot;</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;">##define the jgroups UDP group (multicast address) for clustering</span><br />
<span style="color: #666666; font-style: italic;">#JBOSS_UDP_GROUP=&quot;228.1.2.3&quot;</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;">#define the Http Session Replication UDP port (multicast)</span><br />
<span style="color: #666666; font-style: italic;">#JBOSS_UDP_PORT_WP=&quot;45577&quot;</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;">#define the UDP port for JBoss clustering (multicast)</span><br />
<span style="color: #666666; font-style: italic;">#JBOSS_UDP_PORT_HA=&quot;45566&quot;</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;">#define the UDP port for the ejb3 entity cache cluster (multicast)</span><br />
<span style="color: #666666; font-style: italic;">#JBOSS_UDP_PORT_EJB3=&quot;43333&quot;</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;">#define the UDP port for ejb3 sfsb cache cluster (multicast)</span><br />
<span style="color: #666666; font-style: italic;">#JBOSS_UDP_PORT_EJB3SFSB=&quot;45551&quot;</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
&nbsp;<br />
<span style="color: #666666; font-style: italic;">##define the timeout period for starting the server</span><br />
<span style="color: #666666; font-style: italic;">#JBOSS_START_TIMEOUT=&quot;150&quot;</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;">##define the timeout period for stopping the server</span><br />
<span style="color: #666666; font-style: italic;">#JBOSS_STOP_TIMEOUT=&quot;60&quot;</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;">##define the ip to which the server should bind to</span><br />
<span style="color: #666666; font-style: italic;">#JBOSS_IP=127.0.0.1</span></div></div>
<p>And here are the yum repo definitions required to setup jpackage repos:</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">class repository::jpackage::generic <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
&nbsp; &nbsp; yumrepo <span style="color: #7a0874; font-weight: bold;">&#123;</span> jpackage-generic:<br />
&nbsp; &nbsp; &nbsp; &nbsp; name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;jpackage-generic&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; descr &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;JPackage (free) Generic&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; mirrorlist &nbsp; &nbsp; =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;http://www.jpackage.org/mirrorlist.php?dist=generic&amp;type=free&amp;release=5.0&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; failovermethod =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;priority&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; gpgcheck &nbsp; &nbsp; &nbsp; =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;1&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; gpgkey &nbsp; &nbsp; &nbsp; &nbsp; =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;http://www.jpackage.org/jpackage.asc&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; enabled &nbsp; &nbsp; &nbsp; &nbsp;=<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;1&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<br />
class repository::jpackage::el5 <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
&nbsp; &nbsp; yumrepo <span style="color: #7a0874; font-weight: bold;">&#123;</span> jpackage-redhat-el-<span style="color: #000000;">5</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;jpackage-redhat-el-5.0&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; descr &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;JPackage (free) for Red Hat Enterprise Linux - <span style="color: #000099; font-weight: bold;">\$</span>releasever&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; mirrorlist &nbsp; &nbsp; =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;http://www.jpackage.org/mirrorlist.php?dist=redhat-el-<span style="color: #000099; font-weight: bold;">\$</span>releasever&amp;type=free&amp;release=5.0&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; failovermethod =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;priority&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; gpgcheck &nbsp; &nbsp; &nbsp; =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;1&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; gpgkey &nbsp; &nbsp; &nbsp; &nbsp; =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;http://www.jpackage.org/jpackage.asc&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; enabled &nbsp; &nbsp; &nbsp; &nbsp;=<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;1&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span></div></div>
<p>And finally the code to call it:</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">node testvm-jboss <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; include repository::uncommonsense<br />
&nbsp; &nbsp; &nbsp; &nbsp; include repository::jpackage::generic<br />
&nbsp; &nbsp; &nbsp; &nbsp; include repository::jpackage::el5<br />
&nbsp; &nbsp; &nbsp; &nbsp; include jboss<br />
&nbsp; &nbsp; &nbsp; &nbsp; jboss::setting<span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #ff0000;">&quot;JBOSS_IP&quot;</span>: value =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;0.0.0.0&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span></div></div>
<p>You can use a similar kickstart that we used in one of our previous posts to kick it off and viola! “Look Ma no hands!” –  A working jboss server in less than 5 minutes.</p>
]]></content:encoded>
			<wfw:commentRss>http://uncommonsense-uk.com/2012/whos-the-jboss-rapid-jboss-4-2-3ga-as-server-installs-on-centos-5-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Virtual machine stacking Using LXC on top of ESX</title>
		<link>http://uncommonsense-uk.com/2012/virtual-machine-stacking-using-lxc-on-top-of-esx/</link>
		<comments>http://uncommonsense-uk.com/2012/virtual-machine-stacking-using-lxc-on-top-of-esx/#comments</comments>
		<pubDate>Sun, 01 Jan 2012 06:16:02 +0000</pubDate>
		<dc:creator>lesliebuna</dc:creator>
				<category><![CDATA[Linux Containers (LXC)]]></category>
		<category><![CDATA[Centos 6]]></category>
		<category><![CDATA[Linux Container]]></category>
		<category><![CDATA[Red Hat Enterprise 6]]></category>

		<guid isPermaLink="false">http://uncommonsense-uk.com/?p=261</guid>
		<description><![CDATA[What is LXC? From Dwight Schauer: &#8220;Linux Containers (LXC) are an operating system-level virtualization method for running multiple isolated server installs (containers) on a single control host. LXC does not provide a virtual machine, but rather provides a virtual environment (&#8230;)</p><p><a href="http://uncommonsense-uk.com/2012/virtual-machine-stacking-using-lxc-on-top-of-esx/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<h1>What is LXC?</h1>
<h1 style="text-align: justify;"></h1>
<p style="text-align: justify;">From <a href="http://lxc.teegra.net/#_linux_containers">Dwight Schauer:</a><br />
&#8220;Linux Containers (LXC) are an operating system-level virtualization method for running multiple isolated server installs (containers) on a single control host. LXC does not provide a virtual machine, but rather provides a virtual environment that has its own process and network space. It is similar to a chroot, but offers much more isolation.”</p>
<h2 style="text-align: justify;">Creating Virtual Environments within Virtual Machines using Red Hat Enterprise 6 or Centos 6</h2>
<h2 style="text-align: justify;"></h2>
<p style="text-align: justify;">Why would anyone ever want to do this? Well for a number of reasons:</p>
<p style="text-align: justify;">1. You only have access to one virtual machine but want to create multiple isolated services.</p>
<p style="text-align: justify;">2. Have a requirement for multiple Linux OS versions but don’t want to invest in a heavyweight virtualisation solution.</p>
<p style="text-align: justify;">3. Creating virtual multilayer services to that you wish to be deployed as a single virtual machine, think about a virtual network of machines encapsulated in a single easily deployed package that would only expose a single IP address e.g. reverse proxy, tomcat java container, database, and internal virtual networks).</p>
<p style="text-align: justify;">4. Creation of lightweight development environment.</p>
<p style="text-align: justify;">It so works on KVM, Virtualbox as well as VMware Vsphere.</p>
<h3>LXC Setup</h3>
<h3></h3>
<p style="text-align: justify;"><span style="font-size: medium;">LXC needs kernel namespaces which is fully supported in 2.6.26 kernels and above which are currently upstream of Red Hat Enterprise Linux 5 so I opted to go to RHEL6 so I wouldn’t have to roll and maintain my own kernel (CentOS 6 wasn’t out when I tried this but it should just work).<br />
For Red Hat Enterprise Linux 6 you will also need the RHN Optional Channel enabled so you can get ruby-selinux.</span></p>
<p><strong><span style="font-size: medium;">So let proceed onto how to get, compile and install LXC:</span></strong></p>
<p style="text-align: justify;">
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>downloads.sourceforge.net<span style="color: #000000; font-weight: bold;">/</span>project<span style="color: #000000; font-weight: bold;">/</span>lxc<span style="color: #000000; font-weight: bold;">/</span>lxc<span style="color: #000000; font-weight: bold;">/</span>lxc-0.7.3<span style="color: #000000; font-weight: bold;">/</span>lxc-0.7.3.tar.gz<br />
$ rpmbuild <span style="color: #660033;">-ta</span> lxc-0.7.3.tar.gz<br />
$ <span style="color: #c20cb9; font-weight: bold;">yum</span> <span style="color: #660033;">--nogpg</span> <span style="color: #c20cb9; font-weight: bold;">install</span> lxc-0.7.3-<span style="color: #000000;">1</span>.x86_64.rpm libvirt<br />
$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>lxc <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>lxc<span style="color: #000000; font-weight: bold;">/</span>rootfs <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>lxc <span style="color: #000000; font-weight: bold;">/</span>cgroup<br />
$ <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>fstab <span style="color: #000000; font-weight: bold;">&lt;</span> none <span style="color: #000000; font-weight: bold;">/</span>cgroup cgroup defaults <span style="color: #000000;">0</span> <span style="color: #000000;">0</span><br />
EOF<br />
$ <span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #000000; font-weight: bold;">/</span>cgroup</div></div>
<p><strong>If your using DHCP on your network you can easily setup network bridging by doing the following:</strong></p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">?<br />
$ <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>sysconfig<span style="color: #000000; font-weight: bold;">/</span>network-scripts<span style="color: #000000; font-weight: bold;">/</span>ifcfg-br0 <span style="color: #000000; font-weight: bold;">&lt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>sysconfig<span style="color: #000000; font-weight: bold;">/</span>network-scripts<span style="color: #000000; font-weight: bold;">/</span>ifcfg-eth0 <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #007800;">BRIDGE</span>=br0<br />
EOF<span style="color: #000000; font-weight: bold;">&lt;</span>strong<span style="color: #000000; font-weight: bold;">&gt;</span><br />
<span style="color: #000000; font-weight: bold;">&lt;/</span>strong<span style="color: #000000; font-weight: bold;">&gt;</span>$ service network restart</div></div>
<p><strong><br />
</strong>And voila! LXC is now configured and ready for use, now all you need to do is install a LXC container.<br />
Hint: I typically create a dedicated LVM Volume Group and Logical Volume for each LXC container and mount them under /srv/lxc/ e.g. /src/lxc/myvirtualbox in order to prevent it spilling over into the hosts file system and impacting other services.<br />
You need to already have or create a lxc template here’s a <a href="http://www.emanuelis.eu/2010/05/28/how-to-create-a-lxc-centos-template/">link</a> on how you can create one based on Centos 5.</p>
<p><strong>Here’s some additional stuff I do: Chroot into the template and disable Bluetooth</strong></p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666;">$ </span>chkconfig bluetooth off</div></div>
<p><strong>Delete the ssh *key and *.pub from /etc/ssh</strong></p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666;">$ </span><span style="color: #000000; font-weight: bold;">for</span> key <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssh<span style="color: #000000; font-weight: bold;">/*</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-e</span> key <span style="color: #660033;">-e</span> pub<span style="color: #000000; font-weight: bold;">`</span> ; <span style="color: #000000; font-weight: bold;">do</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #007800;">$key</span> ; <span style="color: #000000; font-weight: bold;">done</span></div></div>
<p><strong>Remove the HWADDR setting in the /etc/sysconfig/network-scripts/ifcfg-eth0</strong></p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666;">$ </span><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-i</span> <span style="color: #ff0000;">'s/HWADDR.*$//g'</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>sysconfig<span style="color: #000000; font-weight: bold;">/</span>network-scripts<span style="color: #000000; font-weight: bold;">/</span>ifcfg-eth0</div></div>
<p><strong>Ensure that tty’s 1-4 are not commented out in /etc/inittab from each image before packaging the template up.</strong></p>
<p><strong>After that’s done and you have your template on your LXC host and are ready to deploy it.</strong></p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>srv<span style="color: #000000; font-weight: bold;">/</span>lxc<br />
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> myvirtualbox<br />
<span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>template<span style="color: #000000; font-weight: bold;">/</span>tar<span style="color: #000000; font-weight: bold;">/</span>gz<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">file</span><br />
<span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>lxc<span style="color: #000000; font-weight: bold;">/</span>myvirtualbox.conf</div></div>
<p><strong>Paste the following into the file (adjust as necessary):</strong></p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">lxc.utsname = myvirtualbox<br />
lxc.tty = <span style="color: #000000;">4</span><br />
lxc.network.type = veth<br />
lxc.network.flags = up<br />
lxc.network.link = br0<br />
lxc.network.name = eth0<br />
lxc.network.mtu = <span style="color: #000000;">1500</span><br />
lxc.network.ipv4 = 0.0.0.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span><br />
lxc.rootfs = <span style="color: #000000; font-weight: bold;">/</span>srv<span style="color: #000000; font-weight: bold;">/</span>lxc<span style="color: #000000; font-weight: bold;">/</span>myvirtualbox<br />
lxc.mount = <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>lxc<span style="color: #000000; font-weight: bold;">/</span>myvirtualbox.fstab<br />
lxc.cgroup.devices.deny = a<br />
<span style="color: #666666; font-style: italic;"># /dev/null and zero</span><br />
lxc.cgroup.devices.allow = c <span style="color: #000000;">1</span>:<span style="color: #000000;">3</span> rwm<br />
lxc.cgroup.devices.allow = c <span style="color: #000000;">1</span>:<span style="color: #000000;">5</span> rwm<br />
<span style="color: #666666; font-style: italic;"># consoles</span><br />
lxc.cgroup.devices.allow = c <span style="color: #000000;">5</span>:<span style="color: #000000;">1</span> rwm<br />
lxc.cgroup.devices.allow = c <span style="color: #000000;">5</span>:<span style="color: #000000;">0</span> rwm<br />
lxc.cgroup.devices.allow = c <span style="color: #000000;">4</span>:<span style="color: #000000;">0</span> rwm<br />
lxc.cgroup.devices.allow = c <span style="color: #000000;">4</span>:<span style="color: #000000;">1</span> rwm<br />
<span style="color: #666666; font-style: italic;"># /dev/{,u}random</span><br />
lxc.cgroup.devices.allow = c <span style="color: #000000;">1</span>:<span style="color: #000000;">9</span> rwm<br />
lxc.cgroup.devices.allow = c <span style="color: #000000;">1</span>:<span style="color: #000000;">8</span> rwm<br />
<span style="color: #666666; font-style: italic;"># /dev/pts/*</span><br />
lxc.cgroup.devices.allow = c <span style="color: #000000;">136</span>:<span style="color: #000000; font-weight: bold;">*</span> rwm<br />
lxc.cgroup.devices.allow = c <span style="color: #000000;">5</span>:<span style="color: #000000;">2</span> rwm<br />
<span style="color: #666666; font-style: italic;"># rtc</span><br />
lxc.cgroup.devices.allow = c <span style="color: #000000;">254</span>:<span style="color: #000000;">0</span> rwm</div></div>
<p><strong>Save the file and create a new fstab file</strong></p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Save the <span style="color: #c20cb9; font-weight: bold;">file</span> and create a new fstab <span style="color: #c20cb9; font-weight: bold;">file</span></div></div>
<p><strong>Paste in the following data and edit as necessary</strong></p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">none <span style="color: #000000; font-weight: bold;">/</span>srv<span style="color: #000000; font-weight: bold;">/</span>lxc<span style="color: #000000; font-weight: bold;">/</span>myvirtualbox<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>pts devpts defaults &nbsp; <span style="color: #000000;">0</span> <span style="color: #000000;">0</span><br />
none <span style="color: #000000; font-weight: bold;">/</span>srv<span style="color: #000000; font-weight: bold;">/</span>lxc<span style="color: #000000; font-weight: bold;">/</span>myvirtualbox<span style="color: #000000; font-weight: bold;">/</span>proc &nbsp; &nbsp;proc &nbsp; defaults &nbsp; <span style="color: #000000;">0</span> <span style="color: #000000;">0</span><br />
none <span style="color: #000000; font-weight: bold;">/</span>srv<span style="color: #000000; font-weight: bold;">/</span>lxc<span style="color: #000000; font-weight: bold;">/</span>myvirtualbox<span style="color: #000000; font-weight: bold;">/</span>sys &nbsp; &nbsp; sysfs &nbsp;defaults &nbsp; <span style="color: #000000;">0</span> <span style="color: #000000;">0</span><br />
none <span style="color: #000000; font-weight: bold;">/</span>srv<span style="color: #000000; font-weight: bold;">/</span>lxc<span style="color: #000000; font-weight: bold;">/</span>myvirtualbox<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>shm tmpfs &nbsp;defaults &nbsp; <span style="color: #000000;">0</span> <span style="color: #000000;">0</span></div></div>
<p><strong>Now you can create myvirtualbox lxc container by typing in</strong></p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666;">$ </span>lxc-create <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>lxc<span style="color: #000000; font-weight: bold;">/</span>myvirtualbox.conf <span style="color: #660033;">-n</span> myvirtualbox</div></div>
<p><strong>And fire it up and a console to go with it using screen:</strong></p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">screen</span> <span style="color: #660033;">-dmS</span> init-myvirtualbox <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>lxc-start <span style="color: #660033;">-n</span> myvirtualbox<br />
$ <span style="color: #c20cb9; font-weight: bold;">screen</span> <span style="color: #660033;">-dmS</span> console-myvirtualbox <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>lxc-console <span style="color: #660033;">-n</span> myvirtualbox</div></div>
<p><strong>You can now use the following command to see the init boot session</strong></p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">screen</span> <span style="color: #660033;">-r</span> <br />
init-myvirtualbox</div></div>
<p><strong>To see and interact with the console.</strong></p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">screen</span> <span style="color: #660033;">-r</span> console-<br />
myvirtualbox</div></div>
]]></content:encoded>
			<wfw:commentRss>http://uncommonsense-uk.com/2012/virtual-machine-stacking-using-lxc-on-top-of-esx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JBoss 5.1.0A RPM Spec</title>
		<link>http://uncommonsense-uk.com/2012/jboss-5-1-0a-rpm-spec/</link>
		<comments>http://uncommonsense-uk.com/2012/jboss-5-1-0a-rpm-spec/#comments</comments>
		<pubDate>Sun, 01 Jan 2012 04:43:25 +0000</pubDate>
		<dc:creator>lesliebuna</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[JBoss]]></category>
		<category><![CDATA[JBOSS]]></category>
		<category><![CDATA[Red hat]]></category>

		<guid isPermaLink="false">http://uncommonsense-uk.com/?p=254</guid>
		<description><![CDATA[I know some of you out there are running JBoss 5.1.0 GA, so not to let you all feel left out, I’ve created an RPM Spec file to let you easily package and roll out your own 5.1.0 packages. Name: (&#8230;)</p><p><a href="http://uncommonsense-uk.com/2012/jboss-5-1-0a-rpm-spec/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I know some of you out there are running JBoss 5.1.0 GA, so not to let you all feel left out, I’ve created an RPM Spec file to let you easily package and roll out your own 5.1.0 packages.</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Name: jbossas5<br />
Version: 5.1.0.GA<br />
Release: <span style="color: #000000;">1</span><br />
Group: Internet<span style="color: #000000; font-weight: bold;">/</span>WWW<span style="color: #000000; font-weight: bold;">/</span>Servers<br />
Summary: JBoss Application Server<br />
Vendor: Red Hat<br />
URL: http:<span style="color: #000000; font-weight: bold;">//</span>www.jboss.org<span style="color: #000000; font-weight: bold;">/</span><br />
BuildArch: noarch<br />
License: LGPL<br />
Source0: http:<span style="color: #000000; font-weight: bold;">//</span>downloads.sourceforge.net<span style="color: #000000; font-weight: bold;">/</span>project<span style="color: #000000; font-weight: bold;">/</span>jboss<span style="color: #000000; font-weight: bold;">/</span>JBoss<span style="color: #000000; font-weight: bold;">/</span>JBoss- 5.0.1.GA<span style="color: #000000; font-weight: bold;">/</span>jboss-<span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>version<span style="color: #7a0874; font-weight: bold;">&#125;</span>-jdk6.zip<br />
Source1: <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>name<span style="color: #7a0874; font-weight: bold;">&#125;</span>.init<br />
BuildRoot: <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>_tmppath<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>name<span style="color: #7a0874; font-weight: bold;">&#125;</span>-<span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>version<span style="color: #7a0874; font-weight: bold;">&#125;</span>-root<br />
Requires: shadow-utils<br />
Requires: java <span style="color: #000000; font-weight: bold;">&gt;</span>= <span style="color: #000000;">1</span>:1.6.0<br />
<br />
<span style="color: #000000; font-weight: bold;">%</span>description</div></div>
<p>JBoss Application Server (or JBoss AS) is a free software/open-source<br />
Java EE-based application server. An important distinction for this<br />
class of software is that it not only implements a server that runs<br />
on Java, but it actually implements the Java EE part of Java. Because<br />
it is Java-based, the JBoss application server operates cross-platform:<br />
usable on any operating system that supports Java.</p>
<p>JBoss AS was developed by JBoss, now a division of Red Hat.</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">%</span>prep<br />
<span style="color: #000000; font-weight: bold;">%</span>setup <span style="color: #660033;">-n</span> jboss-<span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>version<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">%</span><span style="color: #c20cb9; font-weight: bold;">install</span><br />
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>buildroot<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-d</span> <span style="color: #660033;">-m</span> <span style="color: #000000;">755</span> <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>buildroot<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>name<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<br />
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-R</span> . <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>buildroot<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>name<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-d</span> <span style="color: #660033;">-m</span> <span style="color: #000000;">755</span> <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>buildroot<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>_initrddir<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-d</span> <span style="color: #660033;">-m</span> <span style="color: #000000;">755</span> <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>buildroot<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>_sysconfdir<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>sysconfig<br />
<span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-p</span> <span style="color: #660033;">-m</span> <span style="color: #000000;">755</span> <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>SOURCE1<span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>buildroot<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>_initrddir<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>name<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>buildroot<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>name<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>server<span style="color: #000000; font-weight: bold;">/*/</span>deploy<span style="color: #000000; font-weight: bold;">/</span>ROOT.war<br />
<br />
<span style="color: #000000; font-weight: bold;">%</span>clean<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>buildroot<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">%</span>files<br />
<span style="color: #000000; font-weight: bold;">%</span>defattr<span style="color: #7a0874; font-weight: bold;">&#40;</span>-,jboss,jboss<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>name<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<span style="color: #000000; font-weight: bold;">%</span>attr<span style="color: #7a0874; font-weight: bold;">&#40;</span>0755,root,root<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>_initrddir<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>name<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">%</span>pre<br />
<span style="color: #c20cb9; font-weight: bold;">getent</span> group jboss <span style="color: #000000; font-weight: bold;">&gt;/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000; font-weight: bold;">||</span> groupadd <span style="color: #660033;">-r</span> jboss<br />
<span style="color: #c20cb9; font-weight: bold;">getent</span> <span style="color: #c20cb9; font-weight: bold;">passwd</span> jboss <span style="color: #000000; font-weight: bold;">&gt;/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000; font-weight: bold;">||</span> \<br />
useradd <span style="color: #660033;">-r</span> <span style="color: #660033;">-g</span> jboss <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${name}</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">bash</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;JBoss AS Daemon&quot;</span> jboss<br />
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span><br />
<br />
<span style="color: #000000; font-weight: bold;">%</span>changelog<br />
<span style="color: #000000; font-weight: bold;">*</span> Mon Dec <span style="color: #000000;">6</span> <span style="color: #000000;">2010</span> Martin Jackson 5.1.0.GA-<span style="color: #000000;">1</span><br />
- Initial creation</div></div>
<p>All you need to do is download the 5.1.0 JDK version of Jboss from Sourceforge, copy the jboss_init_redhat.sh from the bin directory of the zip file to your SOURCES directory.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://uncommonsense-uk.com/2012/jboss-5-1-0a-rpm-spec/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

