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

Aws001.png

  • 2, Select Ubuntu 12.04 as operating system

Aws002.png

  • 3, Click 'Review and Launch'

Aws3.png

  • 4, Click 'Launch'

Aws4.png

  • 5, Create a new key pair

Aws5.png

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

Aws6.png

  • 7, Done

Aws7.png

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 http://your.public.dns.name/, 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 ubuntu@ec2-54-84-62-179.compute-1.amazonaws.com
The authenticity of host 'ec2-54-84-84-78.compute-1.amazonaws.com (54.84.84.78)' 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 'ec2-54-84-84-78.compute-1.amazonaws.com,54.84.84.78' (RSA) to the list of known hosts.
Welcome to Ubuntu 12.04.3 LTS (GNU/Linux 3.2.0-54-virtual x86_64)

 * Documentation:  https://help.ubuntu.com/

  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: 172.31.22.126
  Swap usage:   0%

  Graph this data and manage this system at https://landscape.canonical.com/

  Get cloud support with Ubuntu Advantage Cloud Guest:
    http://www.ubuntu.com/business/services/cloud

  Use Juju to deploy your cloud instances and workloads:
    https://juju.ubuntu.com/#cloud-precise

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/
wget http://cgs.wustl.edu/~xzhou/samtools-legacy.tgz
tar zxvf samtools-legacy.tgz
cd samtools-legacy
make
== Make sure samtools works properly
./samtools view https://dl.dropboxusercontent.com/u/6959481/hg19_test.bam

== 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

wget http://cgs.wustl.edu/~xzhou/tabix-lidaof.tgz
tar zxvf tabix-lidaof.tgz
cd tabix-lidaof/
make

== Make sure tabix works properly
./tabix -f https://dl.dropboxusercontent.com/u/6959481/bed_hg19.gz 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

wget http://cgs.wustl.edu/~xzhou/sukn.tgz
tar zxvf sukn.tgz 
sudo mv *.js index.html style.css images/ /var/www/browser/ 
vi make.sh # fill the right x86_64-linux-gnu/libmysqlclient.a
sudo ./make.sh 

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/ucsc2jsonhub.py /usr/lib/cgi-bin/

chmod 400 ~/washugb.pem 
scp -i ~/washugb.pem -r hg19/ sessionUtils.sql ubuntu@ec2-54-84-62-179.compute-1.amazonaws.com:/srv/epgg/data/subtleKnife/config
scp -i ~/washugb.pem -r images/ *.html *.js *.gif ubuntu@ec2-54-84-62-179.compute-1.amazonaws.com:/var/www
scp -i ~/washugb.pem * ubuntu@ec2-54-84-62-179.compute-1.amazonaws.com:/srv/epgg/data/data/browserLoad/hg19

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