<?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>Colabrativ, Inc. &#187; Elastic Compute Cloud</title>
	<atom:link href="http://www.colabrativ.com/tag/elastic-compute-cloud/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.colabrativ.com</link>
	<description>An Experiment Documentation and Electronic Notebook Provider</description>
	<lastBuildDate>Tue, 28 Oct 2014 04:44:35 +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>Creating SSL Certificates for Google Web Toolkit Running on Apache HTTPD and Tomcat on Amazon Web Services EC2</title>
		<link>http://www.colabrativ.com/creating-ssl-certificates-for-google-web-toolkit-running-on-apache-httpd-and-tomcat-on-amazon-web-services-ec2/</link>
		<comments>http://www.colabrativ.com/creating-ssl-certificates-for-google-web-toolkit-running-on-apache-httpd-and-tomcat-on-amazon-web-services-ec2/#comments</comments>
		<pubDate>Sat, 31 Aug 2013 16:29:08 +0000</pubDate>
		<dc:creator>Marc Whitlow</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[Amazon Web Services]]></category>
		<category><![CDATA[EC2]]></category>
		<category><![CDATA[Elastic Compute Cloud]]></category>
		<category><![CDATA[GWT]]></category>

		<guid isPermaLink="false">http://www.colabrativ.com/?p=737</guid>
		<description><![CDATA[This post is a follow-up article to my August 27, 2012 article on Creating Self-Signed Certificates for Google Web Toolkit Running on Apache HTTPD and Tomcat on Amazon Web Services EC2. Server Configuration Creating and installing a Secure Sockets Layer &#8230; <a href="http://www.colabrativ.com/creating-ssl-certificates-for-google-web-toolkit-running-on-apache-httpd-and-tomcat-on-amazon-web-services-ec2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This post is a follow-up article to my August 27, 2012 article on <a target="_blank" href="http://www.colabrativ.com/self-signed-certificates-gwt-applications-apache-http-tomcat/">Creating Self-Signed Certificates for Google Web Toolkit Running on Apache HTTPD and Tomcat on Amazon Web Services EC2.</a></p>
<h3>Server Configuration</h3>
<p>Creating and installing a <a target="_blank" href="http://en.wikipedia.org/wiki/Secure_Sockets_Layer">Secure Sockets Layer (SSL)</a> certificate on a server should be a relatively simple task.  However, most of the documentation relating to this task is confusing.  Most of the confusion arises from the fact that there are a multitude of different server configurations that utilize the SSL to complete secure transactions over the web.  In order not to add to this confusion, the following tutorial will refer to the following server configuration: </p>
<table style="border:0px solid white;">
<tr>
<td style="border:0px solid white;">Server:</td>
<td style="border:0px solid white;">64 bit Linux server running on <a target="_blank" href="http://aws.amazon.com/">Amazon Web Services</a> <a target="_blank" href="http://aws.amazon.com/ec2/">Elastic Compute Cloud (EC2)</a> server based on AMI ami-3bc9997e</td>
</tr>
<tr>
<td style="border:0px solid white;">Server&nbsp;Software:</td>
<td style="border:0px solid white;"><a target="_blank" href="http://httpd.apache.org/ABOUT_APACHE.html">Apache HTTP Server (HTTPD)</a> and <a target="_blank" href="http://tomcat.apache.org/">Apache Tomcat</a></td>
</tr>
<tr>
<td style="border:0px solid white;">Applications&nbsp;Type:</td>
<td style="border:0px solid white;"><a target="_blank" href="https://developers.google.com/web-toolkit/">Google Web Toolkit</a> and Java servlets</td>
</tr>
</table>
<p>In this post I will describe:</p>
<ol>
<li><a href="#create-keystore">Creating a Java Keystore</a></li>
<li><a href="#CSR-generation">Certificate Signing Request (CSR) Generation</a></li>
<li><a href="#check-CSR">Check the Certificate Signing Request (CSR)</a></li>
<li><a href="#loading-keystore">Loading the Certificates into the Java Keystore</a></li>
<li><a href="#extract-key">Extracting the Key from the Keystore</a></li>
<li><a href="#configure-ssl-conf">Configuring Apache Server (HTTPD) ssl.conf</a></li>
<li><a href="#add-keystore-to-tomcat">Adding Keystore to Tomcat&#8217;s server.xml</a></li>
</ol>
<h3 id="create-keystore">Creating of a Java Keystore</h3>
<p>Here we will use a <a target="_blank" href="http://docs.oracle.com/javase/6/docs/api/java/security/KeyStore.html">Java KeyStore</a> to generate and store the SSL key and certificates.  One of the limitations to this approach is that you must start by creating the KeyStore first.  SSL utilities such as <a target="_blank" href="http://docs.oracle.com/javase/1.4.2/docs/tooldocs/windows/keytool.html">Java keytool</a> and <a target="_blank" href="http://www.openssl.org/">OpenSSL</a> do not have the ability to create a keystore from an existing certificate and key.  In particular, there is no way to put the key in the keystore. </p>
<div class="codeBox">
<p>First we will create and open to the directory /etc/pki/tls/keystore.  The  <strong>keytool</strong> command that creates the keystore, we need to supply the following: </p>
<ul>
<li><strong>keystore</strong> file name: <span style="color: blue">demo.colabrativ.com.jks</span></li>
<li><strong>key algorythm (keyalg)</strong>: <span style="color: blue">RSA</span></li>
<li><strong>alias</strong>: <span style="color: blue">demo</span></li>
<li><strong>keysize</strong>: <span style="color: blue">2048</span>  As of January 1, 2014 2048-bit or longer keys will be required by <a target="_blank" href="https://www.cabforum.org/Baseline_Requirements_V1.pdf">Certification Authority/Browser Forum</a>.</li>
</ul>
<p>In addition, we need to supply information on the website URL, when the keytool asks for &#8220;What is your first and last name?&#8221;  The key and keystore passwords are optional.  This information and information on our institution have been highlighted in green in the example below.  </p>
<pre>$ sudo mkdir /etc/pki/tls/keystore
$ cd /etc/pki/tls/keystore
$ sudo keytool -genkey -alias <span style="color: blue">demo</span> -keyalg <span style="color: blue">RSA</span> -keystore <span style="color: blue">demo.colabrativ.com.jks</span> -keysize <span style="color: blue">2048</span>
Enter keystore password: <span style="color: #080; font-weight:600;">password</span>
Re-enter new password: <span style="color: #080; font-weight:600;">password</span>
What is your first and last name?
  [Unknown]:  <span style="color: #080; font-weight:600;">demo.colabrativ.com</span>
What is the name of your organizational unit?
  [Unknown]:  <span style="color: #080; font-weight:600;"></span>
What is the name of your organization?
  [Unknown]:  <span style="color: #080; font-weight:600;">Colabrativ, Inc.</span>
What is the name of your City or Locality?
  [Unknown]:  <span style="color: #080; font-weight:600;">Orinda</span>
What is the name of your State or Province?
  [Unknown]:  <span style="color: #080; font-weight:600;">California</span>
What is the two-letter country code for this unit?
  [Unknown]:  <span style="color: #080; font-weight:600;">US</span>
Is CN=demo.colabrativ.com, OU=Developmemt, O=Colabrativ, Inc., L=Orinda, ST=California, C=US correct?
  [no]:  <span style="color: #080; font-weight:600;">yes</span>

Enter key password for <demo>
        (RETURN if same as keystore password):

$ ls -lt
total 4
-rw-r--r-- 1 marc users 2246 Aug 30 08:53 demo.colabrativ.com.jks
</pre>
</div>
<h3 id="CSR-generation">Generating the Certificate Signing Request (CSR)</h3>
<div class="codeBox">
We need to supply the following: </p>
<ul>
<li><strong>alias</strong>: <span style="color: blue">demo</span></li>
<li><strong>keystore</strong> file name: <span style="color: blue">demo.colabrativ.com.jks</span></li>
<li>CSR <strong>file</strong> name: <span style="color: blue">demo.colabrativ.com.csr</span></li>
</ul>
<pre>$ keytool -certreq -alias <span style="color: blue">demo</span> -keystore <span style="color: blue">demo.colabrativ.com.jks</span> -file <span style="color: blue">demo.colabrativ.com.csr</span>
Enter keystore password: <span style="color: #080; font-weight:600;">password</span>

$ ls -lt
total 8
-rw-r--r-- 1 marc users 1039 Aug 30 08:55 demo.colabrativ.com.csr
-rw-r--r-- 1 marc users 2246 Aug 30 08:53 demo.colabrativ.com.jks
</pre>
</div>
<h3 id="check-CSR">Check the Certificate Signing Request (CSR)</h3>
<div class="codeBox">
Symantec Corporation provides a set of SSL tools at <a target="_blank" href="https://ssl-tools.verisign.com/#certChecker?sl=DENJS-0000-04-00">https://ssl-tools.verisign.com/#certChecker?sl=DENJS-0000-04-00</a>, including a CSR Validation.  After pasting your CSR into the window provided and running the validator, then following information on your CCR is shown: </p>
<table style="border:0px solid white;">
<tr>
<td>Common Name</td>
<td>demo.colabrativ.com</td>
</tr>
<tr>
<td>Organization</td>
<td>Colabrativ, Inc.</td>
</tr>
<tr>
<td>Organizational Unit</td>
<td>Unknown</td>
</tr>
<tr>
<td>Locality</td>
<td>Orinda</td>
</tr>
<tr>
<td>State</td>
<td>California</td>
</tr>
<tr>
<td>Country</td>
<td>US</td>
</tr>
<tr>
<td>Signature</td>
<td>Verified</td>
</tr>
<tr>
<td>Signature Algorithm </td>
<td>SHA1</td>
</tr>
<tr>
<td>Key Algorithm</td>
<td>RSA</td>
</tr>
<tr>
<td>Key Length</td>
<td>2048</td>
</tr>
</table>
<p>The signing request (demo.colabrativ.com.csr) can now be sent to the certificate authority.
</p></div>
<h3 id="loading-keystore">Loading the Certificates into the Java Keystore</h3>
<div class="codeBox">
After receiving the certificates from the certificate authority, they need to be loaded in the keystore before exporting the key.  You need both the certificate for your URL and the intermediate certificate from the certificate authority.  This example uses the following certificates and keystore:</p>
<ul>
<li><strong>intermediate certificate</strong> file name: <span style="color: blue">intermediate.crt</span></li>
<li><strong>certificate</strong> file name: <span style="color: blue">demo.colabrativ.com.crt</span></li>
<li><strong>keystore</strong> file name: <span style="color: blue">demo.colabrativ.com.jks</span></li>
</ul>
<p>First the certificate authorities intermediate certificate is loaded using the alias <span style="color: blue">root</span>.</p>
<pre>$ keytool -import -trustcacerts -alias <span style="color: blue">root</span> -file <span style="color: blue">intermediate.crt</span> -keystore <span style="color: blue">demo.colabrativ.com.jks</span>
Enter keystore password: <span style="color: #080; font-weight:600;">password</span>
Certificate was added to keystore
</pre>
<p>Then our certificate, <span style="color: blue">demo.colabrativ.com.crt</span> is loaded in the keystore using the alias <span style="color: blue">demo</span>.</p>
<pre>$ keytool -import -trustcacerts -alias <span style="color: blue">demo</span> -file <span style="color: blue">demo.colabrativ.com.crt</span> -keystore <span style="color: blue">demo.colabrativ.com.jks</span>
Enter keystore password: <span style="color: #080; font-weight:600;">password</span>
Certificate was added to keystore
</pre>
</div>
<h3 id="extract-key">Extracting the Key from the Keystore</a></h3>
<div class="codeBox">
<p>There are three steps in extracting the key from the keystore we created above:</p>
<ol>
<li>Use keytool to create an intermediate <span style="color: blue">PKCS12</span> keystore, <span style="color: blue">demo.colabrativ.com.pkcs12</span>, from the keystore, <span style="color: blue">demo.colabrativ.com.jks</span>.</li>
<li>Use OpenSSL to create a <a target="_blank" href="http://en.wikipedia.org/wiki/Privacy_Enhanced_Mail">Privacy-enhanced Electronic Mail (PEM)</a> formatted file containing both the certificate and the key, <span style="color: blue">demo.colabrativ.com.pem</span>.
<li>Extract the key, <span style="color: blue">demo.colabrativ.com.key</span>, from the PEM file using a text editor.</li>
</ol>
<pre>$ sudo keytool -importkeystore -srckeystore <span style="color: blue">demo.colabrativ.com.jks</span> -destkeystore <span style="color: blue">demo.colabrativ.com.pkcs12</span> -deststoretype PKCS12
Enter destination keystore password: <span style="color: #080; font-weight:600;">password</span>
Re-enter new password: <span style="color: #080; font-weight:600;">password</span>
Enter source keystore password: <span style="color: #080; font-weight:600;">password</span>
Entry for alias tomcat successfully imported.
Import command completed:  1 entries successfully imported, 0 entries failed or cancelled

$ sudo openssl pkcs12 -in <span style="color: blue">demo.colabrativ.com.pkcs12</span> -out <span style="color: blue">demo.colabrativ.com.pem</span> -nodes
Enter Import Password: <span style="color: #080; font-weight:600;">password</span>
MAC verified OK

$ sudo cp demo.colabrativ.com.pem demo.colabrativ.com.key
$ sudo vi demo.colabrativ.com.key

$ ls -lt
total 20
-rw-r--r-- 1 marc users 1224 Aug 30 13:57 demo.colabrativ.com.key
-rw-r--r-- 1 marc users  509 Aug 30 13:53 demo.colabrativ.com.pem
-rw-r--r-- 1 marc users  509 Aug 30 13:50 demo.colabrativ.com.pkcs12
-rw-r--r-- 1 marc users 2246 Aug 30 13:48 demo.colabrativ.com.jks
-rw-r--r-- 1 marc users 1039 Aug 30 13:46 demo.colabrativ.com.crt
-rw-r--r-- 1 marc users 1039 Aug 30 13:45 intermediate.crt
-rw-r--r-- 1 marc users 1039 Aug 30 08:55 demo.colabrativ.com.csr
</pre>
<p>After the certificate and key have been prepared, they are moved the /etc/pki/tls/certs/, and /etc/pki/tls/private/ directories, respectively.</p>
<pre>
$ sudo mv intermediate.crt /etc/pki/tls/certs/.
$ sudo mv demo.colabrativ.com.crt /etc/pki/tls/certs/.
$ sudo mv demo.colabrativ.com.key /etc/pki/tls/private/.
</pre>
</div>
<h3 id="configure-ssl-conf">Configuring Apache Server (HTTPD) ssl.conf</h3>
<p>We will place all the SSL information for this server in the ssl.conf file in the /etc/httpd/conf.d directory.  The ssl.conf file is loaded into the Apache Server (HTTPD) from the command &#8220;include conf.d/*.conf&#8221; in httpd.conf in directory /etc/httpd/conf.  You should check to be sure that this command is in your httpd.conf file.</p>
<div class="codeBox">
Shown below are the differences between the original ssl.conf file and the edited version.  It is a bit hard to tell where these changes were made from the file differences, so a copy of a demonstration ssl.conf file can be downloaded at the bottom of the section.</p>
<pre>$ cd /etc/httpd/conf.d
$ sudo cp –p ssl.conf ssl.conf.orig
$ sudo vi ssl.conf
$ sudo diff ssl.conf.orig ssl.conf
19a20,21
&gt; NameVirtualHost *:443
&gt;
74c76,77
&gt; &lt;VirtualHost _default_:443&gt;
---
&gt; #&lt;VirtualHost _default_:443&gt;
&gt; &lt;VirtualHost *:443&gt;
78a82
&gt; ServerName demo.colabrativ.com:443
85a90,100
&gt; #
&gt; # Proxy Server directives. Uncomment the following lines to
&gt; # enable the proxy server:
&gt; #
&gt; ProxyRequests Off
&gt; ProxyPass        /admin   https://demo.colabrativ.com:8443/admin
&gt; ProxyPass        /demoapp https://demo.colabrativ.com:8443/demoapp
&gt;
&gt; SSLProxyEngine on
&gt;
105c120,121
&lt; SSLCertificateFile /etc/pki/tls/certs/localhost.crt
---
&gt; #SSLCertificateFile /etc/pki/tls/certs/localhost.crt
&gt; SSLCertificateFile /etc/pki/tls/certs/<span style="color: blue">demo.colabrativ.com.crt</span>
112c128,129
&lt; SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
---
&gt; #SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
&gt; SSLCertificateKeyFile /etc/pki/tls/private/<span style="color: blue">demo.colabrativ.com.key</span>
143c143
&lt; #SSLCACertificateFile /etc/pki/tls/certs/ca-bundle.crt
---
&gt; SSLCACertificateFile /etc/pki/tls/certs/<span style="color: blue">intermediate.crt</span>
</pre>
<p />
<p><strong>Download: <a target="_blank" href="http://www.colabrativ.com/files/demo_ssl.conf">demo_ssl.conf</a></strong></p>
</div>
<h3 id="add-keystore-to-tomcat">Adding Keystore to Tomcat&#8217;s server.xml</h3>
<div class="codeBox">
We configure Tomcat to support applications and services under the secure https protocol on port 8443.  We do this by editing the server.xml file in /etc/tomcat7.  We need to supply the keystore password in the 8443 Connector we enable.  I have saved the original server.xml, and only show the difference between the two files below. </p>
<pre>$ cd /etc/tomcat7
$ sudo cp -p server.xml server.xml.orig
$ sudo vi server.xml
$ sudo diff server.xml.orig server.xml
84,88c84,92
&lt;     &lt;!--
&lt;     &lt;Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
&lt;                maxThreads="150" scheme="https" secure="true"
&lt;                clientAuth="false" sslProtocol="TLS" /&#038;gt
&lt;     --&gt;
---
&gt;
&gt;     &lt;Connector port="8443"
&gt;                protocol="HTTP/1.1"
&gt;                SSLEnabled="true"
&gt;                maxThreads="150"
&gt;                scheme="https" secure="true"
&gt;                clientAuth="false" sslProtocol="TLS"
&gt;                keystoreFile="<span style="color: blue">/etc/pki/tls/keystore/demo.colabrativ.com.jks</span>"
&gt;                keystorePass="<span style="color: #080; font-weight:600;">password</span>" /&gt;
</pre>
</div>
<h3>Useful Resources</h3>
<ol>
<li>SSL Shopper&#8217;s <a target="_blank" href="http://www.sslshopper.com/article-most-common-java-keytool-keystore-commands.html">The Most Common Java Keytool Keystore Commands</a></li>
<li>SSL Shopper&#8217;s <a target="_blank" href="http://www.sslshopper.com/article-most-common-openssl-commands.html">The Most Common OpenSSL Commands</a></li>
<li>Wikipedia&#8217;s page on <a target="_blank" href="http://en.wikipedia.org/wiki/X.509">X.509</a>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.colabrativ.com/creating-ssl-certificates-for-google-web-toolkit-running-on-apache-httpd-and-tomcat-on-amazon-web-services-ec2/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Creating Self-Signed Certificates for Google Web Toolkit Running on Apache HTTPD and Tomcat on Amazon Web Services EC2</title>
		<link>http://www.colabrativ.com/self-signed-certificates-gwt-applications-apache-http-tomcat/</link>
		<comments>http://www.colabrativ.com/self-signed-certificates-gwt-applications-apache-http-tomcat/#comments</comments>
		<pubDate>Mon, 27 Aug 2012 20:43:09 +0000</pubDate>
		<dc:creator>Marc Whitlow</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[Amazon Web Services]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[EC2]]></category>
		<category><![CDATA[Elastic Compute Cloud]]></category>
		<category><![CDATA[HTTP Server]]></category>
		<category><![CDATA[Tomcat]]></category>

		<guid isPermaLink="false">http://www.colabrativ.com/?p=527</guid>
		<description><![CDATA[Creating and installing a self-signed Secure Sockets Layer (SSL) certificate on a server should be a relatively simple task. However, most of the documentation relating to these tasks is confusing. Most of the confusion arises from the fact that there &#8230; <a href="http://www.colabrativ.com/self-signed-certificates-gwt-applications-apache-http-tomcat/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Creating and installing a self-signed <a target="_blank" href="http://en.wikipedia.org/wiki/Secure_Sockets_Layer">Secure Sockets Layer (SSL)</a> certificate on a server should be a relatively simple task.  However, most of the documentation relating to these tasks is confusing.  Most of the confusion arises from the fact that there are a multitude of different server configurations that utilize the SSL to complete secure transactions over the web.  In order not to add to this confusion, the following tutorial will refer to the following server configuration: </p>
<table style="border:0px solid white;">
<tr>
<td style="border:0px solid white;">Server:</td>
<td style="border:0px solid white;">64 bit Linux server running on <a target="_blank" href="http://aws.amazon.com/">Amazon Web Services</a> <a target="_blank" href="http://aws.amazon.com/ec2/">Elastic Compute Cloud (EC2)</a> server based on AMI ami-3bc9997e</td>
</tr>
<tr>
<td style="border:0px solid white;">Server&nbsp;Software:</td>
<td style="border:0px solid white;"><a target="_blank" href="http://httpd.apache.org/ABOUT_APACHE.html">Apache HTTP Server (HTTPD)</a> and <a target="_blank" href="http://tomcat.apache.org/">Apache Tomcat</a></td>
</tr>
<tr>
<td style="border:0px solid white;">Applications&nbsp;Type:</td>
<td style="border:0px solid white;"><a target="_blank" href="https://developers.google.com/web-toolkit/">Google Web Toolkit</a> and Java servlets</td>
</tr>
</table>
<p>In this post I will describe:</p>
<ol>
<li><a href="#create-keystore">Creation of self-signed SSL certificate in a Java keystore</a></li>
<li><a href="#add-keystore-to-tomcat">Adding keystore to Tomcat&#8217;s server.xml</a></li>
<li><a href="#extract-key-cert">Extracting the certificate and the key from the keystore</a></li>
<li><a href="#configure-ssl-conf">Configuring Apache Server (httpd) ssl.conf</a></li>
</ol>
<h3 id="create-keystore">Creation of self-signed SSL certificate</h3>
<p>Here we will use a <a target="_blank" href="http://docs.oracle.com/javase/6/docs/api/java/security/KeyStore.html">Java KeyStore</a> to supply Apache Tomcat the certificates we generate.  One of the limitations to this approach is that you must start by creating the KeyStore first.  SSL utilities such as <a target="_blank" href="http://docs.oracle.com/javase/1.4.2/docs/tooldocs/windows/keytool.html">Java keytool</a> and <a target="_blank" href="http://www.openssl.org/">OpenSSL</a> do not have the ability to create a keystore from an existing certificate and key.  In particular, there is no way to put the key in the keystore. </p>
<div class="codeBox">
<p>First we will create and open to the directory /etc/pki/tls/keystore.  The  <strong>keytool</strong> command that creates the keystore, we need to supply the following: </p>
<ul>
<li><strong>keystore</strong> file name: <span style="color: blue">demo.colabrativ.keystore</span></li>
<li><strong>alias</strong>: <span style="color: blue">tomcat</span></li>
<li><strong>keypass</strong>: <span style="color: blue">password</span></li>
<li><strong>storepass</strong>: <span style="color: blue">password</span></li>
</ul>
<p>In addition, we need to supply information on the website URL, when the keytool asks for &#8220;What is your first and last name?&#8221; and our institution information.  This information has been highlighted in green below in the example below.
</p>
<pre>$ sudo mkdir /etc/pki/tls/keystore
$ cd /etc/pki/tls/keystore
$ sudo keytool -genkey -alias tomcat -keypass <span style="color: blue">password</span> -keystore <span style="color: blue">demo.colabrativ.keystore</span> -storepass <span style="color: blue">password</span>
What is your first and last name?
  [Unknown]:  <span style="color: #080; font-weight:600;">demo.colabrativ.com</span>
What is the name of your organizational unit?
  [Unknown]:  <span style="color: #080; font-weight:600;">Developmemt</span>
What is the name of your organization?
  [Unknown]:  <span style="color: #080; font-weight:600;">Colabrativ, Inc.</span>
What is the name of your City or Locality?
  [Unknown]:  <span style="color: #080; font-weight:600;">El Sobrante</span>
What is the name of your State or Province?
  [Unknown]:  <span style="color: #080; font-weight:600;">California</span>
What is the two-letter country code for this unit?
  [Unknown]:  <span style="color: #080; font-weight:600;">US</span>
Is CN=demo.colabrativ.com, OU=Developmemt, O=Colabrativ, Inc., L=El Sobrante, ST=California, C=US correct?
  [no]:  <span style="color: #080; font-weight:600;">y</span>
</pre>
<p/>
<p>A useful command to check to keystore before preceeding is: </p>
<pre>$ sudo keytool -list -keystore <span style="color: blue">demo.colabrativ.keystore</span>
Enter keystore password: <span style="color: #080; font-weight:600;">password</span>

Keystore type: JKS
Keystore provider: SUN

Your keystore contains 1 entry

tomcat, Aug 27, 2012, PrivateKeyEntry,
Certificate fingerprint (MD5): 1A:2D:B5:C1:E9:1E:5C:A2:79:D3:8A:9B:A1:CE:14:72
</pre>
</div>
<h3 id="add-keystore-to-tomcat">Adding Keystore to Tomcat&#8217;s server.xml</h3>
<div class="codeBox">
<p>We configure Tomcat to support applications and services under the secure https protocol on port 8443.  We do this by editing the server.xml file in /etc/tomcat7.  We need to supply the keystore password in the 8443 Connector we enable.  I have saved the original server.xml, and only show the difference between the two files below. </p>
<pre>$ cd /etc/tomcat7
$ sudo cp -p server.xml server.xml.orig
$ sudo vi server.xml
$ sudo diff server.xml.orig server.xml
84,88c84,92
&lt;     &lt;!--
&lt;     &lt;Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
&lt;                maxThreads="150" scheme="https" secure="true"
&lt;                clientAuth="false" sslProtocol="TLS" /&#038;gt
&lt;     --&gt;
---
&gt;
&gt;     &lt;Connector port="8443"
&gt;                protocol="HTTP/1.1"
&gt;                SSLEnabled="true"
&gt;                maxThreads="150"
&gt;                scheme="https" secure="true"
&gt;                clientAuth="false" sslProtocol="TLS"
&gt;                keystoreFile="<span style="color: blue">/etc/pki/tls/keystore/demo.colabrativ.keystore</span>"
&gt;                keystorePass="<span style="color: blue">password</span>" /&gt;
</pre>
</div>
<h3 id="extract-key-cert">Extracting the Certificate and Key from the Keystore</a></h3>
<div class="codeBox">
<p>There are three steps in extracting the certificate and key from the keystore we created above:</p>
<ol>
<li>Use keytool to create an intermediate PKCS12 keystore.</li>
<li>Use OpenSSL to create a <a target="_blank" href="http://en.wikipedia.org/wiki/Privacy_Enhanced_Mail">Privacy-enhanced Electronic Mail (PEM)</a> formatted file containing the certificate and the key.
<li>Extract the certificate and key from the PEM file using a text editor.</li>
</ol>
<p>After the certificate and key have been prepared, they are moved the /etc/pki/tls/certs/, and /etc/pki/tls/private/ directories, respectively.
<p>The ASCII demo.colabrativ.pem file created during the preparation of this tutorial can be download at the bottom of this section. </p>
<pre>$ sudo keytool -importkeystore -srckeystore <span style="color: blue">demo.colabrativ.keystore</span> -destkeystore <span style="color: blue">demo.colabrativ.intermediate</span> -deststoretype PKCS12
Enter destination keystore password: <span style="color: #080; font-weight:600;">password</span>
Re-enter new password: <span style="color: #080; font-weight:600;">password</span>
Enter source keystore password: <span style="color: #080; font-weight:600;">password</span>
Entry for alias tomcat successfully imported.
Import command completed:  1 entries successfully imported, 0 entries failed or cancelled

$ sudo openssl pkcs12 -in <span style="color: blue">demo.colabrativ.intermediate</span> -out <span style="color: blue">demo..colabrativ.pem</span> -nodes
Enter Import Password: <span style="color: #080; font-weight:600;">password</span>
MAC verified OK

$ sudo cp demo.colabrativ.pem demo.colabrativ.key
$ sudo cp demo.colabrativ.pem demo.colabrativ.crt
$ sudo vi demo.colabrativ.key
$ sudo vi demo.colabrativ.crt

$ ls -lt
total 20
-rw-r--r-- 1 root root 1224 Aug 27 10:11 demo.colabrativ.crt
-rw-r--r-- 1 root root  509 Aug 27 10:11 demo.colabrativ.key
-rw-r--r-- 1 root root 2294 Aug 27 10:02 demo.colabrativ.pem
-rw-r--r-- 1 root root 1852 Aug 27 10:00 demo.colabrativ.intermediate
-rw-r--r-- 1 root root 1333 Aug 27 09:37 demo.colabrativ.keystore

$ sudo mv demo.colabrativ.crt /etc/pki/tls/certs/.
$ sudo mv demo.colabrativ.key /etc/pki/tls/private/.
</pre>
</p>
<p><strong>Download: <a target="_blank" href="http://www.colabrativ.com/files/ssl.conf">demo.colabrativ.pem</a></strong>
</div>
<h3 id="configure-ssl-conf">Configuring Apache Server (HTTPD) ssl.conf</a></h3>
<p>We will place all the SSL information for this server in the ssl.conf file in the /etc/httpd/conf.d directory.  The ssl.conf file is loaded into the Apache Server (HTTPD) from the command &#8220;Include conf.d/*.conf&#8221; in httpd.conf in directory /etc/httpd/conf.  You should check to be sure that this command is in your httpd.conf file.</p>
<div class="codeBox">
<p>We will place all the SSL information for this server in the ssl.conf file in the /etc/httpd/conf.d directory.  Shown below are the differences between the original ssl.conf file and the edited version.  It is a bit hard to tell where these changes were made from the file differences, so a copy of a demonstration ssl.conf file can be downloaded at the bottom of the section.</p>
<pre>$ cd /etc/httpd/conf.d
$ sudo cp –p ssl.conf ssl.conf.orig
$ sudo vi ssl.conf
$ sudo diff ssl.conf.orig ssl.conf
19a20,21
&gt; NameVirtualHost *:443
&gt;
74c76,77
&gt; &lt;VirtualHost _default_:443&gt;
---
&gt; #&lt;VirtualHost _default_:443&gt;
&gt; &lt;VirtualHost *:443&gt;
78a82
&gt; ServerName demo.colabrativ.com:443
85a90,100
&gt; #
&gt; # Proxy Server directives. Uncomment the following lines to
&gt; # enable the proxy server:
&gt; #
&gt; ProxyRequests Off
&gt; ProxyPass        /admin   https://demo.colabrativ.com:8443/admin
&gt; ProxyPass        /demoapp https://demo.colabrativ.com:8443/demoapp
&gt;
&gt; SSLProxyEngine on
&gt;
105c120,121
&lt; SSLCertificateFile /etc/pki/tls/certs/localhost.crt
---
&gt; #SSLCertificateFile /etc/pki/tls/certs/localhost.crt
&gt; SSLCertificateFile /etc/pki/tls/certs/demo.colabrativ.crt
112c128,129
&lt; SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
---
&gt; #SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
&gt; SSLCertificateKeyFile /etc/pki/tls/private/demo.colabrativ.key
</pre>
<p />
<p><strong>Download: <a target="_blank" href="http://www.colabrativ.com/files/ssl.conf">ssl.conf</a></strong></p>
</div>
<h3>Useful Resources</h3>
<ol>
<li>SSL Shopper&#8217;s <a target="_blank" href="http://www.sslshopper.com/article-most-common-java-keytool-keystore-commands.html">The Most Common Java Keytool Keystore Commands</a></li>
<li>SSL Shopper&#8217;s <a target="_blank" href="http://www.sslshopper.com/article-most-common-openssl-commands.html">The Most Common OpenSSL Commands</a></li>
<li>Wikipedia&#8217;s page on <a target="_blank" href="http://en.wikipedia.org/wiki/X.509">X.509</a>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.colabrativ.com/self-signed-certificates-gwt-applications-apache-http-tomcat/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Public iExperiment Amazon Machine Image is Now Available</title>
		<link>http://www.colabrativ.com/public-iexperiment-amazon-machine-image-now-available/</link>
		<comments>http://www.colabrativ.com/public-iexperiment-amazon-machine-image-now-available/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 18:14:27 +0000</pubDate>
		<dc:creator>Marc Whitlow</dc:creator>
				<category><![CDATA[Announcement]]></category>
		<category><![CDATA[Amazon Machine Image]]></category>
		<category><![CDATA[Amazon Web Services]]></category>
		<category><![CDATA[EC2]]></category>
		<category><![CDATA[Elastic Compute Cloud]]></category>
		<category><![CDATA[electronic notebook]]></category>
		<category><![CDATA[ELN]]></category>
		<category><![CDATA[iExperiment]]></category>

		<guid isPermaLink="false">http://www.colabrativ.com/?p=305</guid>
		<description><![CDATA[We are pleased to announce that we have made public an Amazon Machine Image (AMI) of our enterprise electronic notebook iExperiment. The creation of the iExperiment public AMI is based on two of our earlier posts Setup of Amazon’s Elastic &#8230; <a href="http://www.colabrativ.com/public-iexperiment-amazon-machine-image-now-available/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>We are pleased to announce that we have made <strong>public</strong> an <a href="http://aws.amazon.com/amis" target="_blank">Amazon Machine Image</a> (AMI) of our enterprise electronic notebook iExperiment. The creation of the iExperiment public AMI is based on two of our earlier posts <a href="http://www.colabrativ.com/setup-of-amazons-elastic-compute-cloud-ec2-server-for-iexperiment/" target="_blank">Setup of Amazon’s Elastic Compute Cloud (EC2) Server for iExperiment</a> and <a href="http://www.colabrativ.com/setup-of-iexperiment-on-amazons-elastic-compute-cloud-ec2-server/" target="_blank">Setup of iExperiment on Amazon’s Elastic Compute Cloud (EC2) Server</a>. A <a href="http://www.colabrativ.com/free-61-day-trial-of-iexperiment-enterprise-electronic-notebook/" target="_blank">three-part tutorial</a> is available to guide you through the creation of an <a href="http://aws.amazon.com/ec2/" target="_blank">Amazon Elastic Compute Cloud</a> (EC2) instance from the iExperiment AMI, configuration of iExperiment, and adding your first researcher.</p>
<p><strong>iExperiment Public Machine Image on the Amazon Management Console</strong><br />
<img src="http://www.colabrativ.com/images/iExperiment_public_AMI.png" alt="Enterprise Electronic Notebook, iExperiment, Public Machine Image on the Amazon Web Services (AWS) Management Console - US West - Launch Instance Wizard - Community AMIs.  This image has been edited to fit in this post." width="600" /></p>
<h3>Why We Choose to Use Amazon Web Services</h3>
<ol>
<li><strong>Control of Experiment Information:</strong> A research organization&#8217;s experiment records are the foundation of its intellectual property, and, as such, must be stored in a way that allows the research organization to maintain control over these records. We feel that Software as a Service (SAAS) electronic notebook solutions do not offer the same level of control as having your experimental data on a server you control.</li>
<li><strong>Convenience of Cloud Computing:</strong> Using an Amazon Machine Image allows us to set up the iExperiment server for you. All you need to do is configure the instance and start the instance&#8217;s services. In addition, Amazon&#8217;s <a href="http://aws.amazon.com/ec2/" target="_blank">Elastic Compute Cloud (EC2)</a> is one of the lower cost cloud service providers.</li>
<li><strong>Support:</strong> Amazon has one of the largest cloud services user communities to draw upon to answer questions that you may have about running your EC2 instance. You can also always contact us at here at <a href="http://www.colabrativ.com/contact-colabrativ-inc/">colabrativ.com</a>.</li>
<li><strong>Server Security:</strong> Amazon facilities are <a href="http://sas70.com/sas70_overview.html" target="_blank">Statement on Auditing Standard No. 70 (SAS70)</a> compliant. <a href="http://aws.amazon.com/about-aws/whats-new/2009/11/11/aws-completes-sas70-type-ii-audit/" target="_blank">They completed the Type II audit in 2009</a>, so you know they are doing everything they can to keep your data secure.</li>
</ol>
<h3>Other iExperiment Hosting Options</h3>
<p>Amazon Web Services may not be the right solution for you for any number of reasons, including: AWS places the responsibility of the enterprise application setup and maintenance on the client&#8217;s administrator; or, you may not be comfortable with the security in a cloud computing environment. If this is the case, you can <a href="http://www.colabrativ.com/contact-colabrativ-inc/">contact us</a> and we can work with you to install our electronic notebook, iExperiment, either at your facility or at another full-service SAS70-compliant cloud service provider.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.colabrativ.com/public-iexperiment-amazon-machine-image-now-available/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setup of iExperiment on Amazon&#8217;s Elastic Compute Cloud (EC2) Server</title>
		<link>http://www.colabrativ.com/setup-of-iexperiment-on-amazons-elastic-compute-cloud-ec2-server/</link>
		<comments>http://www.colabrativ.com/setup-of-iexperiment-on-amazons-elastic-compute-cloud-ec2-server/#comments</comments>
		<pubDate>Thu, 08 Sep 2011 05:27:56 +0000</pubDate>
		<dc:creator>Marc Whitlow</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[Amazon Web Services]]></category>
		<category><![CDATA[EC2]]></category>
		<category><![CDATA[Elastic Compute Cloud]]></category>
		<category><![CDATA[iExperiment]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://www.colabrativ.com/?p=246</guid>
		<description><![CDATA[A research organization&#8217;s experiment records are the foundation of its intellectual property, and, as such, must be stored in a way that allows the research organization to maintain control over these records. Enterprise electronic notebooks, such as our iExperiment, store &#8230; <a href="http://www.colabrativ.com/setup-of-iexperiment-on-amazons-elastic-compute-cloud-ec2-server/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A research organization&#8217;s experiment records are the foundation of its intellectual property, and, as such, must be stored in a way that allows the research organization to maintain control over these records.  Enterprise electronic notebooks, such as our iExperiment, store their experiment records on a server.  Many organizations, including Colabrativ, Inc., are using cloud computing to lower the cost of a server and IT costs in general.  Amazon&#8217;s <a target="_blank" href="http://aws.amazon.com/ec2/">Elastic Compute Cloud (EC2)</a> is one of the lower cost cloud service providers.  Amazon is <a target="_blank" href="http://sas70.com/sas70_overview.html">Statement on Auditing Standards No. 70 (SAS70)</a> compliant.  They completed the Type II audit in 2009 (see <a target="_blank" href="http://aws.amazon.com/about-aws/whats-new/2009/11/11/aws-completes-sas70-type-ii-audit/">AWS Completes SAS70 Type II Audit</a> announcement).  Thus, one can be comfortable that they are doing everything they can to keep one&#8217;s data secure.  Amazon Web Services places the responsibility of the enterprise application setup and maintenance on the client&#8217;s administrator.  Other full-service SAS70-compliant cloud service providers will happily take on these responsibilities for you, for a fee. </p>
<p>In my previous post, I described the <a traget="_blank" href="./setup-of-amazons-elastic-compute-cloud-ec2-server-for-iexperiment">Setup of Amazon&#8217;s Elastic Compute Cloud (EC2) Server for iExperiment</a>, our enterprise electronic notebook application.  That post covered the following topics:</p>
<ul>
<li><a href="./setup-of-amazons-elastic-compute-cloud-ec2-server-for-iexperiment#requirements">iExperiment Server Requirements</a></li>
<li><a href="./setup-of-amazons-elastic-compute-cloud-ec2-server-for-iexperiment#ec2-instance-setup">Setup of Amazon Web Services EC2 Instance</a></li>
<li><a href="./setup-of-amazons-elastic-compute-cloud-ec2-server-for-iexperiment#attaching-ebs">Creating and Attaching an Elastic Block Storage Volume (optional)</a></li>
<li><a href="./setup-of-amazons-elastic-compute-cloud-ec2-server-for-iexperiment#dns-server">Assigning URL of the iExperiment EC2 Server on the DNS Server</a></li>
</ul>
<p>You may want to take a quick look at <a href="./setup-of-amazons-elastic-compute-cloud-ec2-server-for-iexperiment#requirements">iExperiment Server Requirements</a>. </p>
<p>In this post we will go over the setup and configuration of the EC2 server and the installation and setup of iExperiment on it.  Topics in this post include: </p>
<ul>
<li><a href="#update-server">Updating the EC2 Server</a></li>
<li><a href="#mounting-ebs">Mounting Elastic Block Storage Volume (optional)</a></li>
<li><a href="#installing-MySQL">Installing MySQL</a></li>
<li><a href="#database-setup">iExperiment Database Setup</a></li>
<li><a href="#SSL-certificate">SSL Certificate Creation</a></li>
<li><a href="#apache-tomcat">Set Up of Apache and Tomcat</a></li>
<li><a href="#index-html">Adding index.html</a></li>
<li><a href="#iExperiment-applications">iExperiment Applications Installation</a></li>
<li><a href="#removing-8443">Removing Port 8443 from HTTPS Requests</a></li>
</ul>
<p>The majority of these tasks are preformed on the iExperiment EC2.  Tests of the server&#8217;s operation were made using Firefox 5.  We use <a target="_blank" href="http://www.chiark.greenend.org.uk/~sgtatham/putty/">PuTTY</a> to log onto our EC2 server (Instructions can be found in an Amazon appendix on <a target="_blank" href="http://docs.amazonwebservices.com/AmazonEC2/gsg/2007-01-19/putty.html">PuTTY</a>. </p>
<div class="codeBox">
<h3 id="update-server">Updating the EC2 Server using Amazon&#8217;s Yum repository</h3>
<p>The update of the EC2 server from Amazon&#8217;s <a target="_blank" href="http://yum.baseurl.org/">Yum</a> repository takes only a single command &#8220;sudo yum update&#8221;.  It produces a large output.  During the update you will be asked two yes-no question.  You should answer &#8220;yes&#8221; to both of these questions.  Below I have edited the session to only include the yum command and text around the two questions.</p>
<pre>> sudo yum update
...
===============================================================================
Install       1 Package(s)
Upgrade      47 Package(s)

Total download size: 113 M
Is this ok [y/N]: Y
...
Importing GPG key 0x21C0F39F "Amazon Linux AMI (Beta)
<linux-security@amazon.com>" from /etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-beta
Is this ok [y/N]: Y
</pre>
</div>
<p><!-- codeBox  --></p>
<div class="codeBox">
<h3 id="mounting-ebs">Mounting Elastic Block Storage Volume (optional)</h3>
<p>In order to format the elastic block storage (EBS) volume, we need to install XFS filesystem utilities (xfsprogs) from the Amazon Yum repository.</p>
<p>The /proc/partitions file contains a list of the volumes associated with the EC2 instance.  The /dev/xvda1 device is the system volume.  The other volume is the unformatted EBS volume we associated with the EC2 instance.  The EBS volume has two related device names; the system refers to the device as dev/xvd[f-p], but mkds.xfs takes /dev/sd[f-p].  In the case below, the device names are /dev/xsdf and /dev/sdf, respectively. </p>
<ol>
<li>Format the EBS volume using mkfs.xfs and the device name (/dev/sdf)</li>
<li>Create a mount point for the volume (/ebs1).</li>
<li>Add the mount point to the /etc/fstab file.</li>
<li>Mount the volume. </li>
</ol>
<pre>> sudo yum install xfsprogs
Is this ok [y/N]: y

> more /proc/partitions
major  minor  #blocks  name
 202        1    8388608 xvda1
 202       80   10485760 xvdf

> sudo mkfs.xfs /dev/sdf
meta-data=/dev/sdf               isize=256    agcount=4, agsize=65536 blks
         =                       sectsz=512   attr=2
data     =                       bsize=4096   blocks=2621440, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0
log      =internal log           bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0sudo vi /etc/fstab

> sudo mkdir /ebs1

> sudo cp -p /etc/fstab /etc/fstab.orig
> sudo vi /etc/fstab
> more /etc/fstab
#
LABEL=/     /           ext4    defaults,noatime  1   1
tmpfs       /dev/shm    tmpfs   defaults        0   0
devpts      /dev/pts    devpts  gid=5,mode=620  0   0
sysfs       /sys        sysfs   defaults        0   0
proc        /proc       proc    defaults        0   0
/dev/xvdf   /ebs1       xfs     noatime         0   0

> sudo mount /ebs1
</pre>
<p>After mounting the EBS volume on /ebs1, we create and link both the iExperiment and MySQL directories.  We add the mounts to the /etc/fstab file, then mount the directories.</p>
<pre>> sudo mkdir /ebs1/etc
> sudo mkdir /ebs1/etc/mysql
> sudo mkdir /ebs1/lib
> sudo mkdir /ebs1/lib/mysql
> sudo mkdir /ebs1/log
> sudo mkdir /ebs1/log/mysql
> sudo mkdir /ebs1/log/iexperiment
> sudo mkdir /ebs1/local/iexperiment

> sudo mkdir /etc/mysql
> sudo mkdir /var/lib/mysql
> sudo mkdir /var/log/mysql
> sudo mkdir /var/log/iexperiment
> sudo mkdir /var/local/iexperiment

> sudo vi /etc/fstab
> more /etc/fstab
#
LABEL=/     /           ext4    defaults,noatime  1   1
tmpfs       /dev/shm    tmpfs   defaults        0   0
devpts      /dev/pts    devpts  gid=5,mode=620  0   0
sysfs       /sys        sysfs   defaults        0   0
proc        /proc       proc    defaults        0   0
/dev/xvdf   /ebs1       xfs     noatime         0   0
/ebs1/etc/mysql          /etc/mysql              none    bind
/ebs1/lib/mysql          /var/lib/mysql          none    bind
/ebs1/log/mysql          /var/log/mysql          none    bind
/ebs1/log/iexperiment    /var/log/iexperiment    none    bind
/ebs1/local/iexperiment  /var/local/iexperiment  none    bind

> sudo mount /etc/mysql
> sudo mount /var/lib/mysql
> sudo mount /var/log/mysql
> sudo mount /var/log/iexperiment
> sudo mount /var/local/iexperiment
</pre>
<p>If MySQL has already been installed and setup, then instead of making the /mysql directories, we would move (mv) the existing MySQL directories to the EBS volume.  We continue from the snippet above remaking mysql directories that are used as mount bind points. </p>
<pre>> sudo mkdir /ebs1/etc
> sudo mkdir /ebs1/lib
> sudo mkdir /ebs1/log
> sudo mv /etc/mysql     /vol/etc/
> sudo mv /var/lib/mysql /vol/lib/
> sudo mv /var/log/mysql /vol/log/

> sudo mkdir /etc/mysql
...
</pre>
</div>
<div class="codeBox">
<h3 id="installing-MySQL">Installing MySQL</h3>
<p>MySQL and MySQL Server (mysqld) are available from the Amazon Yum repository.  Like update snippets above, the snippet below has been edited to show only what is necessary.</p>
<pre>> sudo yum install mysql
Is this ok [y/N]: y

> sudo yum install mysql-server
Is this ok [y/N]: y
</pre>
<p>After installing MySQL and MySQL Server, we start the MySQL service. </p>
<pre>
> sudo service mysqld start
Initializing MySQL database:  Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h ip-10-176-31-62 password 'new-password'

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &#038;

You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!

[  OK  ]
Starting mysqld:                                           [  OK  ]
</pre>
<p>Finally the mysql_secure_installation script is run.</p>
<pre>
> /usr/bin/mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

Set root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!

By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] Y
... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] Y
... Success!

By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] Y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] Y
... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!
    </pre>
</div>
<p><!-- codeBox  --></p>
<div class="codeBox">
<h3 id="database-setup">Set Up the iExperiment Database</h3>
<ol>
<li>Log in as root to the MySQl database.  We recommend that you not put the root password in the mysql command, so that it does not end up in .bash_history.</li>
<li>Create a user &lsquo;iexperiment&lsquo;@&lsquo;localhost&lsquo;. </li>
<li>Grant the iexperiment user appropriate privileges.</li>
</ol>
<pre>> mysql -h localhost -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 5.1.52 Source distribution

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create user 'iexperiment'@'localhost' identified by 'iexperimentpassword';
Query OK, 0 rows affected (0.00 sec)

mysql> grant usage on *.* to 'iexperiment'@'localhost';
Query OK, 0 rows affected (0.00 sec)

mysql> grant all privileges on *.* to 'iexperiment'@'localhost';
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye
    </pre>
<ol start="4">
<li>Create the /var/log/iexperiment, /var/local/iexperiment and /var/local/iexperiment/ddl directories.</li>
<li>Upload the iExperiment SQL files to the /var/local/iexperiment/ddl directory using an FTP application that supports SSL, such at <a target="_blank" href="http://filezilla-project.org/">FileZilla</a>. </li>
</ol>
<pre>> sudo mkdir /var/log/iexperiment
> sudo mkdir /var/local/iexperiment
> sudo mkdir /var/local/iexperiment/ddl
    </pre>
<ol start="6">
<li>Log in to MySQL as iexperiment.</li>
<li>Create a database named iexperiment. </li>
<li>Load the database by sourcing the initial_setup.sql file. </li>
</ol>
<pre>
> pushd /var/local/iexperiment/ddl
/var/local/iexperiment/ddl ~
> ls -lt
total 136
-rw-rw-r-- 1 root root   917 Jul 17 21:22 initial_setup.sql
-rw-rw-r-- 1 root root  3465 Jul 17 21:08 insert_permissions_START-UP.sql
-rw-rw-r-- 1 root root   944 Jul 17 21:08 insert_admin_START-UP.sql
-rw-rw-r-- 1 root root 22612 Jul 14 17:33 create_tables.sql
-rw-rw-r-- 1 root root 73893 Jul 14 17:09 insert_record_categories.sql
-rw-rw-r-- 1 root root 18355 Jul 14 17:09 create_constraints.sql
-rw-rw-r-- 1 root root   932 Jul 14 17:08 insert_admin.sql

> mysql -h localhost -u iexperiment -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 5.1.52 Source distribution

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show grants;
+-----------------------------------------------------------------------------------------------------------------------------+
| Grants for iexperiment@localhost                                                                                            |
+-----------------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'iexperiment'@'localhost' IDENTIFIED BY PASSWORD '*BAA33824FACE624B5B0AAC8A604733A5648A7A6B' |
+-----------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> create database iexperiment;
Query OK, 1 row affected (0.00 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| iexperiment        |
| mysql              |
+--------------------+
3 rows in set (0.00 sec)

mysql> use iexperiment;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> source initial_setup.sql;

Query OK, 1 row affected (0.00 sec)
.
.
.
Query OK, 1 row affected (0.00 sec)

mysql> show tables;
+------------------------+
| Tables_in_iexperiment  |
+------------------------+
| admin_group_member     |
| ...
| version                |
+------------------------+
55 rows in set (0.00 sec)

mysql> select * from version;
+-------------+----------------------------------+
| version_num | comment                          |
+-------------+----------------------------------+
|           6 | May 25, 2010 - Switch to Records |
+-------------+----------------------------------+
1 row in set (0.00 sec)

mysql> exit
Bye
  </pre>
</div>
<p><!-- codeBox  --></p>
<div class="codeBox">
<h3 id="SSL-certificate">Create SSL Certificate</h3>
<p>iExperiment runs under the secure HTTPS protocol; thus, we need a Secure Sockets Layer (SSL) certificate.  If you already have a wildcard certificate for your domain, then you can skip this step. </p>
<p>Note, that if you use a self-signing certificate, then your iExperiment users will be notified of this.  In FireFox they will see a &#8220;This Connection is Untrusted&#8221; page, in which they will need to open the &#8220;I understand the Risks&#8221; link and click on the &#8220;Add Exception&#8230;&#8221; button. </p>
<ol>
<li>Make a directory for the SSL certificate.</li>
<li>Generate the self-signing SSL certificate.  In the snippet below, the certificate&#8217;s file name, temp.iexperiment.bin, reflects the URL we are using.</li>
</ol>
<pre>
> sudo mkdir /usr/etc/cert
> cd /usr/etc/cert

> sudo keytool -genkey -alias tomcat -keypass sslcert1 -keystore temp.iexperiment.bin -storepass sslcert1
What is your first and last name?
[Unknown]:  Marc Whitlow
What is the name of your organizational unit?
[Unknown]:
What is the name of your organization?
[Unknown]:  Colabrativ, Inc.
What is the name of your City or Locality?
[Unknown]:  El Sobrante
What is the name of your State or Province?
[Unknown]:  California
What is the two-letter country code for this unit?
[Unknown]:  US
Is CN=Marc Whitlow, OU=Unknown, O="Colabrativ, Inc.", L=El Sobrante, ST=California, C=US correct?
[no]:  y

> ls -l
total 4
-rw-r--r-- 1 root root 1292 Jul 18 02:30 temp.iexperiment.bin
    </pre>
<p>Write down the certificate &#8220;keypass&#8221; as you will need it to set up Tomcat.</p>
</div>
<p><!-- codeBox  --></p>
<div class="codeBox">
<h3 id="apache-tomcat">Setup Apache &amp; Tomcat</h3>
<ol>
<li>Install <a target="_blank" href="http://httpd.apache.org/docs/2.0/programs/httpd.html">Apache Hypertext Transfer Protocol Server</a> (httpd), <a target="_blank" href="http://tomcat.apache.org/tomcat-6.0-doc/index.html">Apache Tomcat 6</a> (tomcat6), Tomcat&#8217;s web application service (tomcat6-webapps) and <a target="_blank" href="http://www.modssl.org/">Apache Interface to OpenSSL</a> (mod_ssl) from Amazon&#8217;s Yum repository.</li>
<li>Start the Apache (httpd) and Tomcat (tomcat6) services. </li>
</ol>
<pre>> sudo yum install httpd
Is this ok [y/N]: y

> sudo yum install tomcat6
Is this ok [y/N]: y

> sudo yum install tomcat6-webapps
Is this ok [y/N]: y

> sudo yum install mod_ssl
Is this ok [y/N]: y

> sudo service httpd start
Starting httpd:                                            [  OK  ]
> sudo service tomcat6 start
Starting tomcat6:                                          [  OK  ]
    </pre>
<p>Now we can check to see if the “Amazon Linux AMI Test Page” loads in a Browser using:</p>
<ul>
<li>EC2 Instance&#8217;s public URL that is found in the EC2 Instance information on the AWS Management Console, e.g. http://ec2-204-236-137-138.us-west-1.compute.amazonaws.com</li>
<li>The URL that was assigned to the Elastic IP address associated with the EC2 Instance in the Domain Name Server (DNS), e.g. http://temp.iexperiment.net/</li>
</ul>
<p>Next, we will configure Tomcat to support applications and services under the secure https protocol on port 8443.  We do this by editing the server.xml file in /etc/tomcat.</p>
<pre>
> cd /etc/tomcat6
> sudo cp -p server.xml server.xml.orig
> sudo vi server.xml
> diff server.xml.orig server.xml
83,88c83,92
<     <!--
<     <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
<                maxThreads="150" scheme="https" secure="true"
<                clientAuth="false" sslProtocol="TLS" />
<     -->
<
---
>
>     <Connector port="8443"
>                protocol="HTTP/1.1"
>                SSLEnabled="true"
>                maxThreads="150"
>                scheme="https" secure="true"
>                clientAuth="false" sslProtocol="TLS"
>                keystoreFile="/usr/etc/cert/temp.iexperiment.bin"
>                keystorePass="sslcert1" />

> sudo service tomcat6 restart
Stopping tomcat6:                                          [  OK  ]
Starting tomcat6:                                          [  OK  ]
    </pre>
<p>We should now beable to see the sample web applications supplied with the tomcat6-webapps Yum distribution found in /var/lib/tomcat6/webapps/sample, using the following URLs: </p>
<ul>
<li>&#8220;EC2 Public URL&#8221;:8080/sample e.g. http://ec2-204-236-137-138.us-west-1.compute.amazonaws.com:8080/sample </li>
<li>http://&#8221;iExperiment Domain&#8221;:8080/sample, e.g. http://temp.iexperiment.net:8080/sample</li>
<li>https://&#8221;iExperiment Domain&#8221;:8443/sample, e.g. https://temp.iexperiment.net:8443/sample</li>
</ul>
</div>
<p><!-- codeBox  --></p>
<div class="codeBox">
<h3 id="index-html">Adding index.html</h3>
<p>Upload the iExperiment index.html page and any images associated with the page to the /var/www/html directory.  You can either overwrite the existing index.html page or rename it.
</p></div>
<p><!-- codeBox  --></p>
<div class="codeBox">
<h3 id="iExperiment-applications">iExperiment Applications Installation</h3>
<p>iExperiment has three applications: Admin, Record and ResetPassword.</p>
<ol>
<li>Upload the iExperiment applications .war files (admin.war, record.war and resetPassword.war) to the /var/lib/tomcat6/webapps/ directory in the EC2 server. </li>
<li>Stop the Tomcat service.</li>
<li>Create directories for the attachments and the Lucene search engine index.</li>
<li>For each of the iExperiment applications.
<ol>
<li>Create a directory for the application in /var/lib/tomcat6/webapps/ </li>
<li>Change the group to tomcat.</li>
<p>            li>Unzip the contents of the war file into the newly created directory.</li>
<li>Upload and replace the &#8220;application&#8221;.html file with deployment specific version. </li>
<li>Add deployment specific images to the images directory.</li>
<li>Upload and replace existing iexperiment.properties, dbpool.properties and log4j.properties with files specific for this deployment.</li>
</ol>
</li>
<li>Start the Tomcat service.</li>
</ol>
<pre>> sudo service tomcat6 stop
Stopping tomcat6:                                          [  OK  ]

> sudo mkdir /var/local/iexperiment/attachments
> sudo mkdir /var/local/iexperiment/lucene
> sudo chown -R tomcat:tomcat /var/local/iexperiment/*

> cd /var/lib/tomcat6/webapps/
> ls -lt
total 12
drwxrwxr-x 5 root tomcat 4096 Jul 14 14:53 sample
drwxrwxr-x 5 root tomcat 4096 Jul 14 14:53 examples
drwxrwxr-x 3 root tomcat 4096 Jul 14 14:53 ROOT

> sudo mkdir record
> sudo mkdir admin
> sudo mkdir resetPassword
> sudo chgrp tomcat *

# Begein of admin application configuration.
> pushd admin
> sudo unzip ../admin.war

# After uploading Admin.html
> sudo chown -R root:root *.html

# After uploading deployment specific images to the images diectory.
> pushd images
> sudo chown -R root:root *
> popd

# After uploading the deployment specific properties files
# to the WEB-INF/classes directory
> pushd WEB-INF/classes/
> sudo chown -R root:root *.properties
> ls -lt
total 28
-rw-rw-r-- 1 root root 1287 Jul 14 18:33 log4j.properties
-rw-rw-r-- 1 root root 2020 Jul 14 18:33 iexperiment.properties
-rw-rw-r-- 1 root root 1514 Jul 14 18:33 dbpool.properties
drwxr-xr-x 3 root root 4096 Jul 14 17:49 net
drwxr-xr-x 3 root root 4096 Jul 14 17:49 org
drwxr-xr-x 4 root root 4096 Jul 14 17:49 com
-rw-r--r-- 1 root root 1370 May  3 19:05 mail.properties

# End of admin application configuration.
# Repeat for the record and resetPassword applications. 

> sudo service tomcat6 start
Starting tomcat6:                                          [  OK  ]
    </pre>
</div>
<p><!-- codeBox  --></p>
<div class="codeBox">
<h3 id="removing-8443">Removing Port 8443 from HTTPS Requests</h3>
<p>The final task in setting up the iExperiment Server is to remove the port number from the secure https requests.  We do this by relay the port 443 TCP connections to port 8443 using iptables in the <a target="_blank" href="http://www.netfilter.org/">Netfilter package</a> that already installed on the EC2 instance. </p>
<ol>
<li>Using iptables redirect the incoming port 443 request to port 8443.</li>
<li>Using iptables redirect the output from the incoming port 443 request to port 8443.</li>
<li>We can see these rules in the &#8220;nat&#8221; table using the command &#8220;sudo iptables -t nat -L&#8221;.</li>
<li>Save the iptable in /etc/iptables.conf, and change ownership to root.</li>
<li>Finally, add &#8220;/sbin/iptables-restore &lt; /etc/iptables.conf&#8221; to the bottom to /etc/rc.local file.</li>
</ol>
<pre>> sudo iptables -t nat -I PREROUTING -p tcp --dport 443 -j REDIRECT --to-ports 8443
> sudo iptables -t nat -I OUTPUT -p tcp --dport 443 -j REDIRECT --to-ports 8443

> sudo iptables -t nat -L
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination
REDIRECT   tcp  --  anywhere             anywhere            tcp dpt:https redir ports 8443

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
REDIRECT   tcp  --  anywhere             anywhere            tcp dpt:https redir ports 8443

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination

> sudo iptables-save > iptables.conf
> more iptables.conf
# Generated by iptables-save v1.4.7 on Thu Sep  8 03:32:23 2011
*nat
&#58;PREROUTING ACCEPT [5:300]
:OUTPUT ACCEPT [50:3801]
&#58;POSTROUTING ACCEPT [50:3801]
-A PREROUTING -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 8443
-A OUTPUT -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 8443
COMMIT
# Completed on Thu Sep  8 03:32:23 2011

> sudo cp -p iptables.conf /etc/.
> sudo chown -R root:root /etc/iptables.conf
> sudo ls -l /etc/iptables.conf
-rw-rw-r-- 1 root root 332 Sep  8 03:32 /etc/iptables.conf

> sudo vi /etc/rc.local
> more /etc/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
/sbin/iptables-restore &lt; /etc/iptables.conf
    </pre>
</div>
<p><!-- codeBox  --></p>
<h3>Closing Remarks</h3>
<p>iExperiment run on a typical AWS Apache Tomcat deployment. </p>
<h3>Resources</h3>
<ol>
<li>&ldquo;Configuring MySQL to use the EBS volume&rdquo; section of Eric Hammond&#8217;s article on <a target="_blank" href="http://aws.amazon.com/articles/1663?_encoding=UTF8&amp;jiveRedirect=1">Running MySQL on Amazon EC2 with EBS (Elastic Block Store)</a>.</li>
<li><a target="_blank" href="http://www.puschitz.com/InstallingTomcat.html">Installing Apache Tomcat on Linux</a> by Werner Puschitz.</li>
<li><a target="_blank" href="http://www.cyberciti.biz/faq/how-do-i-save-iptables-rules-or-settings/">How Do I Save Iptables Rules or Settings?</a> by Vivek Gite. </li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.colabrativ.com/setup-of-iexperiment-on-amazons-elastic-compute-cloud-ec2-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setup of Amazon&#8217;s Elastic Compute Cloud (EC2) Server for iExperiment</title>
		<link>http://www.colabrativ.com/setup-of-amazons-elastic-compute-cloud-ec2-server-for-iexperiment/</link>
		<comments>http://www.colabrativ.com/setup-of-amazons-elastic-compute-cloud-ec2-server-for-iexperiment/#comments</comments>
		<pubDate>Mon, 29 Aug 2011 17:37:23 +0000</pubDate>
		<dc:creator>Marc Whitlow</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[Amazon Web Services]]></category>
		<category><![CDATA[EC2]]></category>
		<category><![CDATA[Elastic Compute Cloud]]></category>
		<category><![CDATA[electronic notebook]]></category>
		<category><![CDATA[ELN]]></category>
		<category><![CDATA[iExperiment]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://www.colabrativ.com/?p=226</guid>
		<description><![CDATA[A research organization&#8217;s experiment records are the foundation of its intellectual property, and, as such, must be stored in a way that allows the research organization to maintain control over these records. Enterprise electronic notebooks, such as our iExperiment, store &#8230; <a href="http://www.colabrativ.com/setup-of-amazons-elastic-compute-cloud-ec2-server-for-iexperiment/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A research organization&#8217;s experiment records are the foundation of its intellectual property, and, as such, must be stored in a way that allows the research organization to maintain control over these records.  Enterprise electronic notebooks, such as our iExperiment, store their experiment records on a server.  Many organizations, including Colabrativ, Inc., are using cloud computing to lower the cost of a server and IT costs in general.  Amazon&#8217;s <a target="_blank" href="http://aws.amazon.com/ec2/">Elastic Compute Cloud (EC2)</a> is one of the lower cost cloud service providers.  Amazon is <a target="_blank" href="http://sas70.com/sas70_overview.html">Statement on Auditing Standards No. 7 (SAS70)</a> compliant.  <a target="_blank" href="http://aws.amazon.com/about-aws/whats-new/2009/11/11/aws-completes-sas70-type-ii-audit/">They completed the Type II audit in 2009</a>, so you know they are doing everything they can to keep our data secure.  Amazon Web Services places the responsibility of the enterprise application setup and maintenance on the client&#8217;s administrator.  Other full-service SAS70-complaint cloud service providers will happily take on these responsibilities for you, for a fee. </p>
<p>In this post and in the following post, I will show you how we setup our enterprise electronic notebook application, iExperiment, on an Amazon EC2 server.  This first post covers the launch of the Amazon EC2 server and attachment of <a target="_blank" href="http://aws.amazon.com/ebs/">Elastic Block Storage</a> volume to the server.  The cloud equivalent of purchasing a server and disk, plugging it in, and connecting it to the network.  Experienced Amazon EC2 administrators may want to take a quick look at <a href="#requirements">iExperiment Server Requirements</a> and then move on to the second post on the setup and configuring of an EC2 server for iExperiment. </p>
<ul>
<li><a href="#requirements">iExperiment Server Requirements</a></li>
<li><a href="#ec2-instance-setup">Setup of Amazon Web Services EC2 Instance</a></li>
<li><a href="#attaching-ebs">Creating and Attaching an Elastic Block Storage Volume (optional)</a></li>
<li><a href="#dns-server">Assigning URL of the iExperiment EC2 Server on the DNS Server</a></li>
</ul>
<p>In the second post we will go over the setup and configuration of the EC2 server and the installation and setup of iExperiment on it.  Topic in the post include: </p>
<ul>
<li>Updating the Server</li>
<li>Installing MySQL</li>
<li>iExperiment Database Setup</li>
<li>Mounting Elastic Block Storage Volume (optional)</li>
<li>SSL Certificate Creation</li>
<li>Setup Apache &amp; Tomcat</li>
<li>Adding index.html</li>
<li>iExperiment Applications Installation</li>
</ul>
<h3 id="requirements">iExperiment Server Requirements</h3>
<p>The requirements of our enterprise electronic notebook application, iExperiment, are: </p>
<ol>
<li>Linux hosting web environment:  We normally use Apache and Tomcat.</li>
<li>MySQL database.</li>
<li>Mail server:  By default iExperiment uses the iExperiment.net mail server.</li>
</ol>
<p>In addition to these requirements, we recommend that you have the following before setting up iExperiment.</p>
<ol>
<li>A subdomain name under your domain name for iExperiment, for example iexperiment.example.org. </li>
<li>An administrator mail address on your mail server, e.g. admin@example.org.</li>
</ol>
<h3 id="ec2-instance-setup">Setup of Amazon Web Services EC2 Instance</h3>
<p>If you are not familiar with Amazon Web Services, we recommend that you read the <a target="_blank" href="http://docs.amazonwebservices.com/AWSEC2/latest/GettingStartedGuide/">Amazon Elastic Compute Cloud Getting Started Guide</a>.  There you can find instructions on how to sign up for Amazon EC2, which tell you to &#8220;Go to <a target="_blank" href="http://aws.amazon.com/ec2">http://aws.amazon.com/ec2</a>, click on the <strong>Sign Up for Amazon EC2</strong>, and follow the on-screen instructions.&#8221; </p>
<p>After signing on in the <a target="_blank" href="http://aws.amazon.com/console/">Amazon Management Console</a>, and selecting a region, the following tasks are performed. </p>
<ol>
<li>
<h4>Select an Amazon Region for the iExperiment Server</h4>
<p>Select a <strong>Region</strong> from the region pull-down menu at the top of the Navigation panel.  We are in Northern California, so we normally select the <span style="color:#004B91">US West (N. California)</span> region.
  </li>
<li>
<h4>Create Security Group</h4>
<p>Open the <strong>Security Groups</strong> panel by clicking on its link under <span style="color:gray">NETWORK &amp; SECURITY</span> in the Navigation panel. </p>
<ol>
<li>Click on the &#8220;Create Security Group&#8221; button at the top of the Security Group panel.<br />
         This will bring up the &#8220;Create Security Group&#8221; popup.
       </li>
<li>In the &#8220;Create Security Group&#8221; popup, fill in the following information:<br />
<table>
<tr>
<td>Name:</td>
<td>iExperiment</td>
</tr>
<tr>
<td>Description:</td>
<td>iExperiment open ports: 22 (SSH), 80 and 8080 (HTTP), and 443 and 8443 (HTTPS)</td>
</tr>
<tr>
<td>VPC:</td>
<td>No VPC</td>
</tr>
</table>
<p>         Then click on the &#8220;<span style="color:#004B91">Yes, Create</span>&#8221; button.
        </li>
<li>Click on the iExperiment security group, and click on the &#8220;Inbound&#8221; tab.</li>
<li>In the &#8220;Inbound&#8221; tab add the following rules:
<ol>
<li>From the &#8220;Create a new rule&#8221; pull-down menu, select &#8220;SSH&#8221;,<br />
                then click on the &#8220;Add Rule&#8221; button.</li>
<li>From the &#8220;Create a new rule&#8221; pull-down menu, select &#8220;HTTP&#8221;,<br />
                then click on the &#8220;Add Rule&#8221; button.</li>
<li>From the &#8220;Create a new rule&#8221; pull-down menu, select &#8220;HTTPS&#8221;,<br />
                then click on the &#8220;Add Rule&#8221; button.</li>
<li>From the &#8220;Create a new rule&#8221; pull-down menu, select &#8220;Custom TCP rule&#8221;,<br />
                enter the &#8220;port range&#8221; of 8080,<br />
                then click on the &#8220;Add Rule&#8221; button.</li>
<li>From the &#8220;Create a new rule&#8221; pull-down menu, select &#8220;Custom TCP rule&#8221;,<br />
                enter the &#8220;port range&#8221; of 8443,<br />
                then click on the &#8220;Add Rule&#8221; button.<br />
                <br/>The resulting security table contains the following rules: <br/><br />
                <img src="http://www.colabrativ.com/images/iExperiment_EC2_security_group.png" alt="The enterprise iExperiment electronic notebook Amazon EC2 security group." />
            </li>
<li>After adding all of the Rules, click on the &#8220;Apply Rule Changes&#8221; button at the bottom of the Inbound* tab.</li>
</ol>
</li>
</ol>
<p>&nbsp;</p>
</li>
<li>
<h4>Create Key Pair</h4>
<p>Open the <strong>Key Pairs</strong> panel by click on its link under <span style="color:gray">NETWORK &amp; SECURITY</span> in the Navigation panel. </p>
<ol>
<li>Click on the &#8220;Create Key Pair&#8221; button at the top of the Key Pairs panel.<br />
          This will bring up the &#8220;Create Key Pair&#8221; popup.
      </li>
<li>Supply a &#8220;Key Pair Name&#8221;, then click on the &#8220;<span style="color:#004B91">Create</span>&#8221; button.<br />
          Amazon will create the key pair and download the file to you.<br />
          Save the .pem file somewhere accessible to you.
      </li>
</ol>
<p>&nbsp;</p>
</li>
<li>
<h4>Launch EC2 Instance</h4>
<p>Open the <strong>Instances</strong> panel by clicking on its link under <span style="color:gray">INSTANCES</span> in the Navigation panel. </p>
<ol>
<li>Click on the &#8220;Launch Instance&#8221; button at the top of the My Instances panel.<br />
           This will bring up the &#8220;Request Instances Wizard&#8221; popup. </li>
<li>Click the &#8220;Select&#8221; button to the right of the &#8220;Basic 32-bit Amazon Linux AMI 2011.02.1 Beta&#8221; under the &#8220;Quick Start&#8221; tab in the Request Instances Wizard.</li>
<li>Fill in the Instance Details:<br />
<table>
<caption>Instance Details</caption>
<tr>
<td>Number of Instances:</td>
<td>1</td>
</tr>
<tr>
<td>Availability Zone:</td>
<td>us-west-1a</td>
</tr>
<tr>
<td>Instance Type:</td>
<td>Small (m1.small, 1.7 GB)</td>
</tr>
</table>
<p>           Then click on the &#8220;<span style="color:#004B91">Continue</span>&#8221; button at the bottom of the popup.
       </li>
<li>We normally change nothing in the &#8220;<span style="color:#004B91">Advanced Instance Options</span>&#8220;.<br />
           Click on the &#8220;<span style="color:#004B91">Continue</span>&#8221; button at the bottom of the popup. </li>
<li>If you have multiple EC2 instances, you may want to add Tags to the iExperiment instance.<br />
           Click on the &#8220;<span style="color:#004B91">Continue</span>&#8221; button at the bottom of the popup. </li>
<li>Choose the &#8220;Choose from your existing Key Pairs&#8221; option, then select the key pair for iExperiment from a &#8220;Your existing Key Pair&#8221; pull-down menu.<br />
           Click on the &#8220;<span style="color:#004B91">Continue</span>&#8221; button at the bottom of the popup. </li>
<li>Choose the iExperiment security group using the &#8220;Choose one or more of your existing Security Groups&#8221; option from list of security groups, then<br />
           click on the &#8220;<span style="color:#004B91">Continue</span>&#8221; button at the bottom of the popup. </li>
<li>Review the configuration of your EC2 Instance request, then<br />
           click on the &#8220;<span style="color:#004B91">Launch</span>&#8221; button at the bottom of the &#8220;Request Instances Wizard&#8221; popup.<br />
           <img width="580px" src="http://www.colabrativ.com/images/Amazon_EC2_Instance_Review.png" alt="Review section Amazon EC2 Request Instances Wizard popup for a server capable of running Colabrativ's enterprise electronic notebook, iExpertiment." />
        </li>
</ol>
<p>It&#8217;s worth noting the id, Availability Zone, and Public DNS of the EC2 instance you created by clicking on the instance in the &#8220;My Instances&#8221; panel.
  </li>
<li>
<h4>Create an Elastic IP</h4>
<p>Amazon&#8217;s <a target="_blank" href="http://aws.amazon.com/articles/1346">Elastic IP Addresses</a> are static IP addresses that you can associate with an Amazon EC2 server.  Open the Addresses panel by clicking on the <strong>Elastic IPs</strong> link under <span style="color:gray">NETWORK &amp; SECURITY</span> in the Navigation panel. </p>
<ol>
<li>Click on the &#8220;Allocate New Address&#8221; button at the top of the &#8220;Addresses&#8221; panel.<br />
          This will bring up the &#8220;Allocate New Address&#8221; popup.<br />
          Click on the &#8220;<span style="color:#004B91">Yes, Allocate</span>&#8221; button in the popup.<br />
          This will create a new address.
      </li>
<li>Click on the new Elastic IP address and select Associate Address.<br />
          This will bring up the &#8220;Associate Address&#8221; popup.<br />
          Select the iExperiment EC2 Instance from the &#8220;Instance&#8221; pull-down list and<br />
          click on the &#8220;<span style="color:#004B91">Yes, Associate</span>&#8221; button in the popup.
      </li>
</ol>
<p>The eleastic IP address will be needed when setting up the Domain Name Server, below, so make a note of it.
  </li>
</ol>
<h3 id="attaching-ebs">Creating and Attaching an Elastic Block Storage Volume (optional)</h3>
<p>We highly recommend that you place your experiment records created in iExperiment on an EC2 server in an <a target="_blank" href="http://aws.amazon.com/ebs/">Elastic Block Storage (EBS)</a> volume.  EBS isolates your data from the server failures and its scalable.  An existing volume can be copied to a large volume as your iExperiment records increase.  From the Amazon Management Console open the EBS Volumes panel by clicking on the <strong>Volumes</strong> link under <span style="color:gray">ELASTIC BLOCK STORE</span> in the Navigation panel. </p>
<ol>
<li>Click on the &#8220;Create Volume&#8221; button at the top of the &#8220;EBS Volumes&#8221; panel.<br />
      This will bring up the &#8220;Create Volume&#8221; popup.
  </li>
<li>In the &#8220;Create Volume&#8221; popup enter a volume <strong>Size</strong>, and <strong>Availability Zone</strong>.<br />
      The volume <strong>Size</strong> you choose will primarily depend on the size of the figures and attachment the researchers using iExperiment plan to associate with their experiment records.  10 GiB is a good starting size.  The <strong>Availability Zone</strong> must be the same as the iExperiment instance.<br />
      Click on &#8220;<span style="color:#004B91">Yes, Create</span>&#8221; button in the popup.
  </li>
<li>Click on the EBS volume you just created and select &#8220;Attach Volume&#8221;.<br />
      This will bring up the &#8220;Attach Volume&#8221; popup with <strong>Volume</strong> already filled in.<br />
      Select the iExperiment EC2 instance, shown by id, from the <strong>Instances</strong> pull-down menu.<br />
      Click on the &#8220;<span style="color:#004B91">Yes, Attach</span>&#8221; button in the popup to attach the EBS volume to the iExperiment instance.
  </li>
</ol>
<h3 id="dns-server">Assigning URL of the iExperiment EC2 Server on the DNS Server</h3>
<p>Here we will use the domain name temp.iExperiment.net, but you will be using a sub-domain of your domain such as iexperiment.example.com.  We are using Kattare Internet Services for our DNS server.  There we associate the AWS Elastic IP address with both the sub-domain and its secure variant in the iExperiment Zone File:</p>
<table>
<tr>
<td>temp</td>
<td>IN</td>
<td>A</td>
<td>50.18.109.21</td>
</tr>
<tr>
<td>www.temp</td>
<td>IN</td>
<td>A</td>
<td>50.18.109.21</td>
</tr>
<tr>
<td>securetemp</td>
<td>IN</td>
<td>A</td>
<td>50.18.109.21</td>
</tr>
<tr>
<td>www.securetemp</td>
<td>IN</td>
<td>A</td>
<td>50.18.109.21</td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.colabrativ.com/setup-of-amazons-elastic-compute-cloud-ec2-server-for-iexperiment/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
