<?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>UNIXy &#187; Amazon</title>
	<atom:link href="http://blog.unixy.net/tag/amazon/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.unixy.net</link>
	<description>Fully Managed Dedicated Servers</description>
	<lastBuildDate>Thu, 09 Sep 2010 07:08:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Running DirectAdmin On Amazon EC2 Linux- Solved!</title>
		<link>http://blog.unixy.net/2009/06/running-directadmin-on-amazon-ec2-linux-solved/</link>
		<comments>http://blog.unixy.net/2009/06/running-directadmin-on-amazon-ec2-linux-solved/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 18:21:09 +0000</pubDate>
		<dc:creator>UNIXy</dc:creator>
				<category><![CDATA[Challenge]]></category>
		<category><![CDATA[Add new tag]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[DA]]></category>
		<category><![CDATA[DirectAdmin]]></category>
		<category><![CDATA[EC2]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://blog.unixy.net/?p=15</guid>
		<description><![CDATA[We were able to install DirectAdmin (a Web hosting control panel) on Amazon&#8217;s Elastic Compute Cloud, branded as EC2. We would like to share the steps required to build a working instance of DirectAdmin on an Amazon server. First, I would like to personally thank Mark from DirectAdmin for being so accommodating and granting us [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.unixy.net%2F2009%2F06%2Frunning-directadmin-on-amazon-ec2-linux-solved%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.unixy.net%2F2009%2F06%2Frunning-directadmin-on-amazon-ec2-linux-solved%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>We were able to install DirectAdmin (a Web hosting control panel) on Amazon&#8217;s Elastic Compute Cloud, branded as EC2. We would like to share the steps required to build a working instance of DirectAdmin on an Amazon server. First, I would like to personally thank Mark from <a title="Web Control Panel" href="http://www.directadmin.com" target="_blank">DirectAdmin</a> for being so accommodating and granting us a trial license. His help is very much appreciated! Keep in mind that <a href="http://www.unixy.net" target="_self">UNIXY</a>&#8216;s truly fully managed service goes above and beyond. We take business dreams and make them a reality.</p>
<p>Before we list the requirements, it is important to note that EC2 instances are Xen Virtual Machines. We encountered some issues running DA on the &#8220;Small&#8221; Amazon instances. The issues are related to 64-bit mode library mismatches. The only instances to be able to run DirectAdmin out of the box are of type &#8220;Large&#8221; and better. They are more expensive but ideal for this configuration.</p>
<p>Here are the requirements:</p>
<ul>
<li>Instance of type Large</li>
<li>Linux CentOS 5 image</li>
<li>One elastic (which is another word for static) IP address</li>
</ul>
<p>Go ahead and bring up the node as you would normally do. Be sure to remove all extra software that comes pre-installed with the CentOS 5 image. Otherwise, it will break DirectAdmin. If in doubt, follow the instructions on the DirectAdmin Install page:</p>
<blockquote><p>http://www.directadmin.com/install.html</p></blockquote>
<p>Once logged in as root, go ahead and download the DirectAdmin install tarball:</p>
<blockquote><p># wget http://www.directadmin.com/setup.sh</p></blockquote>
<p>By default, the licensing scheme of DirectAdmin makes it that setup.sh binds to the licensed IP address. Here&#8217;s how the license verification command looks like:</p>
<blockquote><p>$BIN_DIR/wget $WGET_OPTION -O $DA_PATH/update.tar.gz &#8211;bind-address=$IP https://www.directadmin.com/cgi-bin/daupdate?uid=$CID\&amp;lid=$LID</p></blockquote>
<p>But as you know, EC2 instances are 1:1 private:public NAT. Which means that the license check step will fail and the DA install won&#8217;t start. To avoid this chicken-and-egg problem, we are going to tell setup.sh to not bind to any IP address but to simply connect to the DA licensing server using the elastic external IP address, which it will do by default. Go ahead and run this command against the setup.sh file:</p>
<blockquote><p><code># sed -i 's/--bind-address=\$IP//;' setup.sh</code></p></blockquote>
<p>Before we run setup.sh, we need to trick the setup script to think that the external IP address is &#8220;attached&#8221; to the server. Here&#8217;s how:</p>
<blockquote><p># ifconfig eth0:0 inet 1.1.1.1 netmask 255.255.255.255 up</p></blockquote>
<p>Be sure to replace the IP address 1.1.1.1 with your elastic IP. Then simply run setup.sh:</p>
<blockquote><p># cd /usr/local/directadmin/scripts; while [ true ]; do <code>sed -i 's/--bind-address=\$IP//; s/--bind-address=\${3}//;' *.sh </code>&gt; /dev/null &gt; 2&amp;&gt;1; sleep 10; done &amp; sh setup.sh 11111 22222 vpslux.com eth0:0 1.1.1.1</p></blockquote>
<p>Woaah! Wait a minute! What is that!? OK, let&#8217;s break it down. The DA scripts directory gets unpacked into the server after you run setup.sh. It dumps a list of scripts that are used by DA to setup accounts, domains, etc. Some scripts use the same &#8211;bind-address flag. Having that flag in those scripts breaks DA. the one-line script &#8220;while [ true ]; do sed -i &#8216;s/&#8211;bind-address=\$IP//; s/&#8211;bind-address=\${3}//;&#8217; *.sh; sleep 10; done&#8221; simply goes to that directory and removes the flag.</p>
<p>The trick being DA attempts to run some of those scripts <em>while</em> setup.sh is running. So it&#8217;s important to have the sed script run in parallel during the installation. Once the setup.sh is done running, we&#8217;ll kill the job (or reboot per the final step). The arguments supplied to setup.sh are in this format</p>
<blockquote><p># setup.sh &lt;ClientID&gt; &lt;LicenseID&gt; &lt;Hostname&gt; &lt;Interface&gt; &lt;ExternalIP&gt;</p></blockquote>
<p>Be sure to replace those values accordingly. Once the install finishes, simply reboot the VM:</p>
<blockquote><p># reboot</p></blockquote>
<p>That&#8217;s all folks. Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.unixy.net/2009/06/running-directadmin-on-amazon-ec2-linux-solved/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Amazon S3 File Size Limitation &#8211; Solved</title>
		<link>http://blog.unixy.net/2009/04/amazons-s3-file-size-limitation-solved/</link>
		<comments>http://blog.unixy.net/2009/04/amazons-s3-file-size-limitation-solved/#comments</comments>
		<pubDate>Sun, 12 Apr 2009 09:38:25 +0000</pubDate>
		<dc:creator>UNIXy</dc:creator>
				<category><![CDATA[Break-Fix]]></category>
		<category><![CDATA[5368709120]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[File size limitation]]></category>
		<category><![CDATA[Limitation]]></category>
		<category><![CDATA[S3]]></category>

		<guid isPermaLink="false">http://blog.unixy.net/?p=8</guid>
		<description><![CDATA[If you attempt to store a file larger than roughly 5GB, the Amazon service will generate the following error and fail to store the file: &#60;Error&#62;&#60;Code&#62;EntityTooLarge&#60;/Code&#62;&#60;Message&#62;Your proposed upload exceeds the maximum allowed object size&#60;/Message&#62;&#60;ProposedSize&#62;6091682399&#60;/ProposedSize&#62;&#60;MaxSizeAllowed&#62;5368709120&#60;/MaxSizeAllowed&#62;&#60;/Error&#62; One way around this limitation is use the GNU/Linux command split to divide the file into several smaller chunks, which are [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.unixy.net%2F2009%2F04%2Famazons-s3-file-size-limitation-solved%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.unixy.net%2F2009%2F04%2Famazons-s3-file-size-limitation-solved%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>If you attempt to store a file larger than roughly 5GB, the Amazon service will generate the following error and fail to store the file:</p>
<blockquote><p>&lt;Error&gt;&lt;Code&gt;EntityTooLarge&lt;/Code&gt;&lt;Message&gt;<strong>Your proposed upload exceeds the maximum allowed object size</strong>&lt;/Message&gt;&lt;ProposedSize&gt;6091682399&lt;/ProposedSize&gt;<strong>&lt;MaxSizeAllowed&gt;5368709120&lt;/MaxSizeAllowed&gt;</strong>&lt;/Error&gt;</p></blockquote>
<p>One way around this limitation is use the GNU/Linux command <em>split</em> to divide the file into several smaller chunks, which are in turn stored in Amazon&#8217;s S3. It&#8217;s important to know the order of these chunks as the original file is split. The good news is that the split command preserves the order of the chunks by adding a suffix to each chunk. Here&#8217;s an example of the split command in action. In this example, we&#8217;re splitting file outfile.tmp, which is of size 2.3GB, into chunks of 1GB each:</p>
<blockquote><p># du -sh outfile.tmp<br />
2.3G    outfile.tmp</p>
<p># split -a 1 -b 1073741824 outfile.tmp outfile.tmp.</p>
<p># ls -alh outfile.tmp.*<br />
-rw-r&#8211;r&#8211; 1 root root 1.0G Apr 11 09:51 outfile.tmp.a<br />
-rw-r&#8211;r&#8211; 1 root root 1.0G Apr 11 09:51 outfile.tmp.b<br />
-rw-r&#8211;r&#8211; 1 root root 274M Apr 11 09:51 outfile.tmp.c</p></blockquote>
<p>As you can see, split is appending alphabetical letters to the end of the split file name. This comes handy when reassembling the file. Here&#8217;s a quick proof of concept following our earlier example:</p>
<blockquote><p># <strong>md5sum outfile.tmp</strong><br />
<strong>e1f4bbcfc2309b3c7ea48028c3f1c9e9</strong> outfile.tmp<br />
# cat outfile.tmp.a outfile.tmp.b outfile.tmp.c &gt; reassembled.tmp<br />
# <strong>md5sum reassembled.tmp </strong><br />
<strong>e1f4bbcfc2309b3c7ea48028c3f1c9e9</strong> reassembled.tmp</p></blockquote>
<p>All as planned! That&#8217;s all folks.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.unixy.net/2009/04/amazons-s3-file-size-limitation-solved/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Ruby On a cPanel Server</title>
		<link>http://blog.unixy.net/2009/04/installing-ruby-on-a-cpanel-server/</link>
		<comments>http://blog.unixy.net/2009/04/installing-ruby-on-a-cpanel-server/#comments</comments>
		<pubDate>Sat, 11 Apr 2009 16:26:51 +0000</pubDate>
		<dc:creator>UNIXy</dc:creator>
				<category><![CDATA[Crash Course]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[cPanel]]></category>
		<category><![CDATA[RoR]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[S3]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://blog.unixy.net/?p=7</guid>
		<description><![CDATA[A customer wanted Amazon&#8217;s S3 tools installed on his Centos 5.3 server in order to backup important files off-network. The task is straight forward as it requires installing the usual Ruby interpreter, tools, and Gems. But as it turned out, cPanel appends an exclude line in /etc/yum.conf to prevent installing anything related to Ruby: exclude=apache* [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.unixy.net%2F2009%2F04%2Finstalling-ruby-on-a-cpanel-server%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.unixy.net%2F2009%2F04%2Finstalling-ruby-on-a-cpanel-server%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>A customer wanted Amazon&#8217;s S3 tools installed on his Centos 5.3 server in order to backup important files off-network. The task is straight forward as it requires installing the usual Ruby interpreter, tools, and Gems. But as it turned out, cPanel appends an exclude line in /etc/yum.conf to prevent installing anything related to Ruby:</p>
<blockquote><p>exclude=apache* bind-chroot courier* dovecot* exim* httpd* mod_ssl* mysql* nsd* perl* php* proftpd* pure-ftpd* <strong>ruby*</strong> spamassassin* squirrelmail*</p></blockquote>
<p>I&#8217;m reluctant to un-exclude the ruby* entry as it could somehow break the cPanel production install. The next logical thing to do in this case is to scan /scripts for anything ruby related:</p>
<blockquote><p>[/scripts]# ls -1|grep -i ruby<br />
installruby*</p></blockquote>
<p>Bingo! The cPanel conformant way of installing Ruby is to run /scripts/installruby. But it&#8217;s important to read cPanel&#8217;s document on RoR just in case. Here&#8217;s the URL:</p>
<blockquote><p>http://www.cpanel.net/docs/ror/index.html</p></blockquote>
<p>I then simply ran the script to install Ruby and configure S3 to keep the customer happy! I hope this will help someone carry on the Ruby installation.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.unixy.net/2009/04/installing-ruby-on-a-cpanel-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
