Install a mirror at Amazon AWS Cloud

From wubrowse wiki
Jump to: navigation, search

brief introduction about Amazon AWS

  • You could be able to get a one-year free trial of Amazon AWS, pretty awesome. While you need provide a credit card, but Amazon won't charge you unless the Free Usage Tier ends.

Create an EC2 instance

  • 1, First, create an EC2 instance by clicking the 'Launch Instance' button


  • 2, Select Ubuntu 12.04 as operating system


  • 3, Click 'Review and Launch'


  • 4, Click 'Launch'


  • 5, Create a new key pair


  • 6, After download the new key pair file, click 'Launch Instance'


  • 7, Done


Install the browser

  • 8, After get you instance running, SSH to your instance using your key pair file and public DNS name as server address, see the Amazon Documentation for details.
  • 9a, Setup a WashU Epigenome Browser mirror site following the instructions at Install a local mirror
  • 9b, Alternatively, if you don't want do the step-by-step setup, search ami-c9caf4a0 in Amazon AMIs list, copy it to your cloud, and launch a new instance using this image, which contains a functional WashU Epigenome Browser site.
  • 10, Note, if you could not be able to visit your instance website by, add HTTP and HTTPS protocol to your security settings, for more please see the related documentation.

Example commands for setup browser in an Amazon EC2

  • Following are the commands I used for building a browser instance in an Amazon EC2 server, mostly following Install a local mirror
dli@dli:~/Desktop/aws$ ssh -i washugb.pem
The authenticity of host ' (' can't be established.
RSA key fingerprint is 36:a2:af:93:f8:f4:be:ca:87:ea:c3:7f:54:29:cc:a9.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ',' (RSA) to the list of known hosts.
Welcome to Ubuntu 12.04.3 LTS (GNU/Linux 3.2.0-54-virtual x86_64)

 * Documentation:

  System information as of Thu Jan 30 20:30:36 UTC 2014

  System load:  0.0               Processes:           58
  Usage of /:   11.1% of 7.87GB   Users logged in:     0
  Memory usage: 6%                IP address for eth0:
  Swap usage:   0%

  Graph this data and manage this system at

  Get cloud support with Ubuntu Advantage Cloud Guest:

  Use Juju to deploy your cloud instances and workloads:

0 packages can be updated.
0 updates are security updates.

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

sudo apt-get install make gcc lib32z1-dev lib32ncurses5-dev apache2 unzip libssl-dev libghc-curl-dev libssh2-1-dev libssh2-1 mysql-server  libmysqlclient-dev libmysqld-dev libpng12-dev
sudo mkdir -p /srv/epgg/data
sudo chown ubuntu.ubuntu data/

== For the moment, we need non-standard versions of Samtools and Tabix to enable HTTPS support
cd /srv/epgg/data/
tar zxvf samtools-legacy.tgz
cd samtools-legacy
== Make sure samtools works properly
./samtools view

== Download a version of tabix modified by Daofeng Li and compile
== However the Tabix we're using here does not work well on 32-bit computers
== It has trouble accessing files with size 4GB or larger.
== It works all right on 64-bit systems.
cd /srv/epgg/data

tar zxvf tabix-lidaof.tgz
cd tabix-lidaof/

== Make sure tabix works properly
./tabix -f chr7:27053199-27373567

sudo mkdir /var/www/browser
cd /srv/epgg/data
mkdir data
cd data
mkdir subtleKnife
cd subtleKnife
mkdir seq

mkdir /srv/epgg/data/subtleKnife
cd /srv/epgg/data/subtleKnife

tar zxvf sukn.tgz 
sudo mv *.js index.html style.css images/ /var/www/browser/ 
vi # fill the right x86_64-linux-gnu/libmysqlclient.a
sudo ./ 

sudo mkdir /var/www/t
sudo mkdir /usr/lib/trash
sudo chown www-data.www-data /usr/lib/trash

sudo cc postdeposit.c -o /usr/lib/cgi-bin/postdeposit

sudo mv script/ucsc/ /usr/lib/cgi-bin/

chmod 400 ~/washugb.pem 
scp -i ~/washugb.pem -r hg19/ sessionUtils.sql
scp -i ~/washugb.pem -r images/ *.html *.js *.gif
scp -i ~/washugb.pem *

mkdir /srv/epgg/data/data/subtleKnife/hg19
mkdir /srv/epgg/data/data/subtleKnife/hg19/config
mkdir /srv/epgg/data/data/subtleKnife/hg19/session
sudo chown www-data.www-data /srv/epgg/data/data/subtleKnife/hg19/session

mkdir -p /srv/epgg/data/data/browserLoad/hg19

cat makeDb.sql | mysql -u hguser -p hg19 --local-infile=1
cat sessionUtils.sql | mysql -u hguser -p hg19 --local-infile=1
cat load.sql | mysql -u hguser -p hg19 --local-infile=1

Update AWS mirror