<?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>marius &#187; HTTPS</title>
	<atom:link href="http://devilx.net/tag/https/feed/" rel="self" type="application/rss+xml" />
	<link>http://devilx.net</link>
	<description></description>
	<lastBuildDate>Wed, 25 Jan 2012 07:42:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Amazon EC2: How to Setup an Instance and Bundle it</title>
		<link>http://devilx.net/2009/11/01/amazon-ec2-how-to-setup-an-instance-and-bundle-it/</link>
		<comments>http://devilx.net/2009/11/01/amazon-ec2-how-to-setup-an-instance-and-bundle-it/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 16:25:46 +0000</pubDate>
		<dc:creator>Marius</dc:creator>
				<category><![CDATA[Linux and stuff ...]]></category>
		<category><![CDATA[New & Cool]]></category>
		<category><![CDATA[World Wide Web]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[AMI]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Bucket]]></category>
		<category><![CDATA[Bundle]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[EBS]]></category>
		<category><![CDATA[EC2]]></category>
		<category><![CDATA[Elastic]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[HTTPS]]></category>
		<category><![CDATA[Instance]]></category>
		<category><![CDATA[IP]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[S3]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.devilx.net/?p=1033</guid>
		<description><![CDATA[I know, that there are several documentations concerning Amazon&#8217;s Elastic Cloud Computing, though I&#8217;d like to describe some very first steps for using their infrastructure to build (Linux-) instances that fulfill your needs. Let&#8217;s not beat around the bush and &#8230; <a href="http://devilx.net/2009/11/01/amazon-ec2-how-to-setup-an-instance-and-bundle-it/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I know, that there are several documentations concerning Amazon&#8217;s Elastic Cloud Computing, though I&#8217;d like to describe some very first steps for using their infrastructure to build (Linux-) instances that fulfill your needs. Let&#8217;s not beat around the bush and start-over by setting up the very first instance.</p>
<p>The first thing needed is a client computer running any kind of the supported OSs by the Amazon API tools and of course the tools themselves. After you&#8217;ve installed those and configured all credentials the right way, we can create a new pair of SSH keys for our new project. Due to the location I&#8217;m currently in, I&#8217;ve chosen to use Amazon Instances in the western EU. Execute the following line on your command-line:</p>
<blockquote><p>ec2-add-keypair &#8211;region eu-west-1 test-keypair</p></blockquote>
<p>The result should look something like this:</p>
<blockquote><p>[Deprecated] Xalan: org.apache.xml.res.XMLErrorResources_en_US<br />
KEYPAIR	test-keypair	e1:1a:d1:a1:a1:1c:10:a1:b1:d1:cb:11:11:1a:11:11:f1:11:ae:fe<br />
&#8212;&#8211;BEGIN RSA PRIVATE KEY&#8212;&#8211;<br />
XXX<br />
&#8212;&#8211;END RSA PRIVATE KEY&#8212;&#8211;</p></blockquote>
<p>You can now copy the lines from <i>BEGIN&#8230;</i> until <i>END&#8230;</i> (including those two) into a file which you&#8217;ll be using as SSH-key for connecting to your instance. Don&#8217;t forget to <i>chmod 600</i> it!</p>
<p>Next, let&#8217;s see what base-images for creating our instance we could you &#8211; first, provided by Amazon themselves:</p>
<blockquote><p>
ec2-describe-images &#8211;region eu-west-1 -o &#8216;amazon&#8217;
</p></blockquote>
<p>The list is contained of several different OSs and versions, although in our current project we can&#8217;t make use of any of those. Therefor, we&#8217;re now searching for a perfectly fitting, really good operating system:</p>
<blockquote><p>
ec2-describe-images &#8211;region eu-west-1 -a | grep -i debian
</p></blockquote>
<p>And yet, we receive another list with several different versions of the Debian Linux distribution. After we&#8217;ve picked the one we&#8217;d like to run, we should check what instances are currently up and running:</p>
<blockquote><p>
ec2-describe-instances &#8211;region eu-west-1
</p></blockquote>
<p>If you&#8217;re using Amazon&#8217;s EC2 for the first time, there shouldn&#8217;t be any items listed. We can now start our very first instance, by copying the instance&#8217;s identifier (in the second column, a string starting with ami-<id>) and pasting it into our command:</p>
<blockquote><p>
ec2-run-instances &#8211;region eu-west-1 -k test-keypair -g &#8216;http/s&#8217; -g &#8216;ssh&#8217; ami-b8446fcc
</p></blockquote>
<p>In this command, we tell Amazon to start up a new instance that&#8217;s built on top of the ami-b8446fcc-image, using the key-pair we just created before and using some custom built firewall-rules named &#8220;http/s&#8221; (which allows us to connect to port 80 and 443) and &#8220;ssh&#8221; (port 22).</p>
<p>We need to wait a few seconds, until the instance comes up. We can use the describe-instances command from above to check the instance&#8217;s status:</p>
<blockquote><p>
ec2-describe-instances &#8211;region eu-west-1
</p></blockquote>
<p>As soon as it&#8217;s up and running, the &#8220;pending&#8221; column should have been replaced by a dynamically allocated hostname and the status &#8220;running&#8221;. Keep in mind, that this hostname/ip is dynamically allocated! If you want a fixed IP, you need to allocate and assign an Elastic IP &#8211; I&#8217;ll show you later how to do so.<br />
If our firewall rules worked out, we can now connect using SSH:</p>
<blockquote><p>
ssh -i ~/Library/EC2/id_rsa-test-keypair root@ec2-11-111-11-111.eu-west-1.compute.amazonaws.com
</p></blockquote>
<p>By default, Amazon sets up a Small Instance, that provides around 10 GB of hard drive, an Dual-Core AMD Opteron 2218 with 2600 MHz and around 1.7 GB of RAM. Small instances, in comparison to the bigger ones, also still provide a real swap-partition which is limited to 895 MB. Here, you could run into problems when installing some Oracle for example, since the DB would like to have 1 GB or more Swap-space. If 895 MB should not be enough, the only way to enlarge it seems to be to use a file within your file-system for that. Either, by placing it somewhere into / or by using /mnt for that. /mnt is a special mount in Amazon instances which provides you 147 GB of additional <i>volatile</i> storage. Amazon doesn&#8217;t guarantee in any way the storage to be stable/solid or even backed up &#8211; and usually /mnt is only used for bundling your instance. You might now think <i>&#8220;so, where could I place my data, if / is only providing me 10 GB of space and /mnt should not be used for storing sensitive data?&#8221;</i> &#8211; well, there&#8217;s a third possibility named Elastic Block Storage. An EBS is being displayed to your instance as regular block-device (/dev/sdb, &#8230;) that&#8217;s format- and mountable. There, sensitive data could be stored, by bind-mounting the directories you&#8217;d like to have your data in. I&#8217;m not going to explain how this works, else I&#8217;ll never finish writing this brief documentation.</p>
<p>However, since we&#8217;re connected to the instance now, we can set it up the way we want it, with whatever software we need on it. I&#8217;ve assumed, that most people would set it up as regular LAMP-instance, therefor I&#8217;ve also added the firewall-rule for HTTP/HTTPS. After we finished installing the software we need, there&#8217;s one more package that should be plugged into the system: The Amazon AMI Tools. Simply wget them from http://s3.amazonaws.com/ec2-downloads/ec2-ami-tools.zip and unzip the package. Those tools make use of Ruby, so ensure having it installed on your instance. Also, you need to have the private key (pk-<id>.pem) and the certificate (cert-<id>.pem) you created the instance with somewhere within your instance&#8217;s filesystem, for later use.</p>
<p>Before we bundle up our system now, let&#8217;s come back to the topic we had before: The hostname/IP. Amazon allocates some dynamic address, unless you tell them to give you a fixed (called Elastic) IP. You can do that by simply executing:</p>
<blockquote><p>
ec2-allocate-address &#8211;region eu-west-1
</p></blockquote>
<p>&#8230; within your client&#8217;s command-line (where the Amazon API Tools have been installed &#8211; not on the instance!). As result you&#8217;ll get some IP address that has now being allocated by Amazon for you. The IP isn&#8217;t bound to any instance yet &#8211; it&#8217;s just allocated for you to be able to use it. ATTENTION: You pay for Elastic IPs as long as you do not assign them to an instance. Yes, that&#8217;s right. Amazon charges you for every allocated but unused IP hourly. By that, they want to prevent people &#8220;collecting&#8221; addresses, I guess. To assign the address you just received to your instance, simply run:</p>
<blockquote><p>
ec2-associate-address &#8211;region eu-west-1 -i i-11e11b1e 79.125.11.11
</p></blockquote>
<p>The i-<id> is your actual instance&#8217;s ID, where the last, dot-separated number is the IP you&#8217;ve received. And yes, those are fake numbers &#8211; so don&#8217;t even try. <img src='http://devilx.net/wp-content/plugins/smilies-themer/Riceballs/wink.png' alt=';]' class='wp-smiley' /> </p>
<p>Now it could take a bit for Amazon to reconfigure the instance, but as soon as it finished, you should be able to re-connect to the instance using the IP you just assigned to it.</p>
<p>As last task for today, let&#8217;s bundle up the image the way we have it now. Bundling an image allows you more than just eating up your credit card&#8217;s limit by dumping your S3 buckets. On the one hand, with bundles you can recover machines that crashed or lost data within a few blinks and on the other, you can created new instances out of a bundle (talking about &#8220;scalability&#8221;).</p>
<p>For bundling, we use the AMI tools we installed. First of all, let&#8217;s create a directory for the bundle:</p>
<blockquote><p>
mkdir /mnt/myimage
</p></blockquote>
<p>After that, run the bundle-vol-tool:</p>
<blockquote><p>
ec2-bundle-vol -k pk-<id>.pem -c cert-<id>.pem -s <bundle size in MB, e.g. 5000> -u <user-id, without dashes> -d /mnt/myimage/
</p></blockquote>
<p>This command takes several parameters for the private key, the certificate, the size of the resulting bundle in MB and your User-ID (without dashes). The User-ID can be found within your Account Information on Amazon&#8217;s EC2 site. The command should ask you, what architecture you&#8217;d like to bundle the system for &#8211; i386 should work out perfectly for what we&#8217;re doing. The following procedure could take some time, since the tool collections every peace of the system and builds a bundle into the directory we specified. As soon as the tool finished, we can upload our bundle to our S3-bucket:</p>
<blockquote><p>
ec2-upload-bundle &#8211;location EU -b <some unique bucket name>  -m /mnt/myimage/image.manifest.xml -a <access-key> -s <secret-key>
</p></blockquote>
<p>Again, we need to specify some credentials (our access-key and the secret-key) for the upload to work. Also, we need to pick a globally unique bucket-name for uploading the bundle, what shouldn&#8217;t be that hard as long as you don&#8217;t try stuff like &#8220;linux&#8221; or other common words. The bundle will then be uploaded to your (private) bucket, so you have it for later use.</p>
<p>From within the web-interface you could now simply create new instances out of the uploaded bundle, without even knowing how the actual system was set up or having the Amazon API tools installed on your client.</p>
<p>Cool stuff, enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://devilx.net/2009/11/01/amazon-ec2-how-to-setup-an-instance-and-bundle-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bringing Lenny to the Etch</title>
		<link>http://devilx.net/2008/10/31/bringing-lenny-to-the-etch/</link>
		<comments>http://devilx.net/2008/10/31/bringing-lenny-to-the-etch/#comments</comments>
		<pubDate>Fri, 31 Oct 2008 18:46:17 +0000</pubDate>
		<dc:creator>Marius</dc:creator>
				<category><![CDATA[Life itself]]></category>
		<category><![CDATA[Linux and stuff ...]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Apt]]></category>
		<category><![CDATA[Aptitude]]></category>
		<category><![CDATA[Backports]]></category>
		<category><![CDATA[Bug]]></category>
		<category><![CDATA[Courier]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Develop]]></category>
		<category><![CDATA[Etch]]></category>
		<category><![CDATA[Evolution]]></category>
		<category><![CDATA[GNOME]]></category>
		<category><![CDATA[HTTPS]]></category>
		<category><![CDATA[Icedove]]></category>
		<category><![CDATA[Kernel]]></category>
		<category><![CDATA[KVM]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Machine]]></category>
		<category><![CDATA[Migrate]]></category>
		<category><![CDATA[Roundcubemail]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Stable]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[Upgrade]]></category>
		<category><![CDATA[Virtual]]></category>
		<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">http://www.devilx.net/?p=588</guid>
		<description><![CDATA[So, today I upgraded the Debian Etch on my project-server at work to Debian Lenny and had to experience some things I really did not expect. The actual reason, why I upgraded was KVM. Lenny seems to be getting more &#8230; <a href="http://devilx.net/2008/10/31/bringing-lenny-to-the-etch/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>So, today I upgraded the Debian Etch on my project-server at work to Debian Lenny and had to experience some things I really did not expect.</p>
<p>The actual reason, why I upgraded was KVM. Lenny seems to be getting more and more stable and by that usable as server system. Of course, it&#8217;s not etch yet, but since I&#8217;m trying to migrate from VMware (-Server) to KVM I&#8217;m actually forced to use Lenny. There are no KVM packages available for Etch, besides the ones from Backports.org. Unfortunatelly, even those are only available at version 28-4, what&#8217;s not that usable on a productive system.</p>
<p>However, so like I said, today I s/etch/lenny/g on my APT sources.list and ran an aptitude dist-upgrade. I was pretty surprised how fluent the upgrade worked out, the only thing it broke was the Roundcubemail I have installed on the machine for checking the Maildir via HTTP(S). Apache still works fine, Courier also runs, Fetchmail, and all the other stuff I had configured upgraded with nearly no problems.</p>
<p>Unfortunately, the upgrade still caused problems regarding my everyday-work. The most annoying thing is the fact, that I&#8217;m forced to use Icedove as mail client from now on, at least until some strange bug regarding the SSL authentication has been fixed in Evolution. The curious thing is, that with the previous version of Courier, Evolution worked just fine. I don&#8217;t know, what exactly the Courier developers changed, but it caused evolution to not be able anymore to authenticate against it. Some might say, it sounds like an Courier bug, but to be honest, I know how things are being implemented into Evolution and I don&#8217;t believe it&#8217;s Courier&#8217;s fault. <img src='http://devilx.net/wp-content/plugins/smilies-themer/Riceballs/wink.png' alt=';-)' class='wp-smiley' /> </p>
<p>It&#8217;s pretty much a bummer, because I actually liked working with Evolution. Not because it&#8217;s fast &#8211; it&#8217;s not. And not because it&#8217;s light &#8211; it&#8217;s neither. And not even because it works perfectly in the infrastructure I&#8217;m sitting in &#8211; it definitely did not. But Evolution unfortunatelly is the only mail reader for the GNOME desktop environment, which really integrates into the desktop. I could always take a quick look at the meetings/appointments I have for a specific test, by just clicking the the clock on my menubar. Also, it was integrated into GNOME&#8217;s keyring, so that my mail-account password was just getting unlocked after the login.</p>
<p>However, this tiny, integrative features enhanced the usability of Evolution a lot, even if everything else might just suck. Now I&#8217;m trying to find out which bugreport documented the problem I&#8217;m experiencing, to put myself on CC. I&#8217;m really wondering when this will be fixed. If it takes as long as fixing problems regarding shared folders or caldav, then I guess I&#8217;ll just try to say Hello! to my future e-mail client Icedove. <img src='http://devilx.net/wp-content/plugins/smilies-themer/Riceballs/ermm.png' alt=':-/' class='wp-smiley' /> </p>
<p>Meh.</p>
]]></content:encoded>
			<wfw:commentRss>http://devilx.net/2008/10/31/bringing-lenny-to-the-etch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RDP over SSH over HTTPS</title>
		<link>http://devilx.net/2007/01/12/rdp-over-ssh-over-https/</link>
		<comments>http://devilx.net/2007/01/12/rdp-over-ssh-over-https/#comments</comments>
		<pubDate>Fri, 12 Jan 2007 21:17:29 +0000</pubDate>
		<dc:creator>Marius</dc:creator>
				<category><![CDATA[Linux and stuff ...]]></category>
		<category><![CDATA[Mac and stuff ...]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[DarwinPorts]]></category>
		<category><![CDATA[HTTPS]]></category>
		<category><![CDATA[Jabber]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Proxy]]></category>
		<category><![CDATA[prtunnel]]></category>
		<category><![CDATA[RDP]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[Tunnel]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://www.devilx.net/?p=271</guid>
		<description><![CDATA[Okay, tunneling unter Linux/Unix system definitely is a bit complicated &#8211; until you really understand the basics. Some day I was searching for a possibility to tunnel a RDP Session over a WWW-Proxy and I really couldn&#8217;t find anything useful &#8230; <a href="http://devilx.net/2007/01/12/rdp-over-ssh-over-https/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Okay, tunneling unter Linux/Unix system definitely is a bit complicated &#8211; until you really understand the basics. Some day I was searching for a possibility to tunnel a RDP Session over a WWW-Proxy and I really couldn&#8217;t find anything useful on Google or Yahoo!. After some more searching, asking and trying I finally figured out how this can be done.</p>
<p>First of all: You cannot tunnel RDP directly through a proxy. RDP doesn&#8217;t speak any HTTP(S) to make the proxy connect to the RDP-Server or anything else. So you&#8217;ll need an application, that surrounds this RDP datachannel with HTTP, prefferable HTTPS. I found <em>prtunnel</em> for my Mac on DarwinPorts. This software allows you to tunnel anything you want through an http/socks proxy by connecting to the proxy, making it connect (by sending HTTP commands) to the preffered host and open a local port for the application (e.g. rdesktop) to connect. Good, so let&#8217;s connect using prtunnel to myrdpmachine.com:3389 and be happy! &#8211; NAH. As soon as you&#8217;ll try that you&#8217;ll see that it&#8217;s not that simple. Most http-proxies do not allow CONNECTs to other ports than 80/443. So you can either set up your RDP daemon to use that port &#8211; never found that option in Windoze &#8211; or you can use an SSH jumphost, since it&#8217;s pretty simple to change the SSH port to 443. So, you connect with prtunnel to your SSH machine on port 443, where the SSH daemon runs, open an SSH tunnel through that machine to the myrdpmachine.com port 3389 and connect with your RDP client on localhost:. Okay, let&#8217;s stop the theory and begin with the practice:</p>
<p>Open three terminals and execute the following command on the first one:</p>
<pre>prtunnel -V -t http -H 'proxy address' -P 'proxy port' \
'port on local machine' 'remote host to connect to over proxy' \
'remote port, put SSHd on 443'</pre>
<p>Then, terminal #2 gets the following command: ssh -L&#8217;local tunneling port&#8217;:'destination host&#8217;:'destination port&#8217; -p &#8216;local port to connect to, the same given at prtunnel&#8217; &#8216;user&#8217;@localhost<br />
After that you can hapily run your <em>rdesktop localhost:&#8217;local tunneling port&#8217;</em> and start RDPing. To make the stuff even more clear, here a concrete example:</p>
<pre>prtunnel -V -t http -H 192.168.111.2 -P 3128 13337 192.168.111.3 443
ssh -L13338:192.168.111.24:3389 -p 13337 root@localhost
rdesktop localhost:13338</pre>
<p>That&#8217;s all the magic. Though, you need to pay attention when selecting your ports, because of course only free ports will work and you really should try to keep them higher than 1024 unless you want to become root. Also you need to remember that running an RDP session over HTTP(S) might get the attention of a firewall or whatever monitoring application is available in that network. &#8220;Abnormal behaviour&#8221; &#8211; you&#8217;d never get such an 50:50 up- and downtraffic unless you run some peer-2-peer application or remote desktops.</p>
<p>But of course you can modify the commands and use it to be able to connect to let&#8217;s say Jabber from a network where only 80/443-outgoing is available &#8211; all you need is a jumphost.</p>
]]></content:encoded>
			<wfw:commentRss>http://devilx.net/2007/01/12/rdp-over-ssh-over-https/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

