Skip to content

NanoLIMS v2.0 Hosted Installation (via AWS Lightsail)

cheinle edited this page Jan 16, 2017 · 19 revisions

#Table of Contents Note: Installation requires sudo user privileges. Requirement met by AWS users

Sign-up for AWS Lightsail

  • Choose to either sign-up as a new user or use an existing amazon user (note: this can be any amazon account) and follow prompts for user registration if needed.

You should now be logged in and on the Amazon Lightsail homepage

  • Click Create Instance

Choose From Pre-configured AMI

Amazon Lightsail comes with many preconfigured AMI's to choose from to help you quickly get set-up and running. We will only explore two different AMI's. LAMP Stack (5.6.27) and Ubuntu 16.04 LTS (Choose one of these two options).

  • Option 1) LAMP Stack (5.6.27) - pre-configured APPS + OS using Bitnami's LAMP stack configuration on Ubuntu 14.0

  • Option 2 ) Ubuntu 16.04 LTS - pre-configured OS using Ubuntu 16.04 LTS. Uses traditional Ubuntu filesystem. (You will need to install LAMP stack. Recommended to use NanoLIMS's lamp.sh script provided)

  • Next: Choose your instance plan For demon purposes we recommend selecting the cheapest plan at $5/month which will give you a month free (or 750 hours, whichever comes first)

  • Name your instance Suggestion: Use default name.
    Currently Lightsail is only avaible in US regions. However, we did not see any performance issuses using in Singapore.

  • Click Create

Once you click create you will wait as your instance is created for you. Once it is ready, instance will appear under 'Resources' and text saying that it is running

  • Click on vertical elipses to bring up the menu for your instance
  • Click on 'manage'

You are now brought to your instance main page where you will note your public IP (Example here: 52.87.214.117). This will be used later to access NanoLIMS in your web browser.

Ex: http://52.87.214.117/NanoLIMS/login.php

Install Lamp Stack (optional)

If you selected to use the Ubuntu 16.04 LTS AMI, you must now install build a complete LAMP stack. Suggested install instructions below

  • Connect to your instance through SSH by clicking the orange 'Connect using SSH' button. (This will open a web GUI of your terminal connecting to your instance

You are now brought to your Ubuntu instance inside the terminal GUI and signed in automatically as user 'Ubuntu'. You are currently in your home directory. We will be creating a file named lamp.sh and inputting the contents of the NanoLIMS file of the same name (lamp.sh). This installation is interactive.

  • Create a file named lamp.sh

We will be creating a file using the text editor called vi

Note: Some basic vi commands can be found here (http://cc.iiti.ac.in/vicom.pdf)

  • Type i to turn on insert-mode within the vi text editor

The words --INSERT-- will appear at the bottom of the screen so you know you are now ready and able to insert text to the page

Because Lightsail uses a GUI we must use special key commands to copy and paste text from your desktop to the lightsail terminal.

  • Click inside Lightsail terminal
  • Press ctrl key, shift key, and alt key at the same time to bring up Lightsail's copy paste window (i.e. clipboard)
  • Right click and select paste to paste contents of lamp.sh to clipboard area

  • Press ctrl key, shift key, and alt key at the same time again to close Lightsail's clipboard
  • Click inside terminal window (you should still be in insert mode)
  • Right-click on mouse to paste contents into file. Use arrow keys on keyboard to scroll to top. To ensure that entire contents were pasted in, make sure top of file reads '#! /bin/bash/' (If paste was not successful, press esc, then q! to quit. Start over at vi lamp.sh)
  • Press Esc, then type wq and enter to save and quit

  • Type source lamp.sh and press enter

  • Answer questions which appear with a [Y/n] option by typing y and pressing enter

  • Type in password for MySQL root user and press enter. You will be asked to confirm password by typing it again in a similar pink screen. (Very Important To Remember)

  • Enter password for user root:

Type in the password you just entered in the pink screen and press enter. This will not appear on screen but will be invisible. Do not worry, the password is still being entered.

  • Answer No for VALIDATE PASSWORD PLUGIN

  • Answer No for Change password for root?

(You will only answer no, because you just set this password on the initial set-up for mysql in pink)

  • Answer Y for Remove anonymous Users?

  • Answer Y for Disallow root login remotely?

  • Answer Y for Remove test database and access to it?

  • Answer Y for Reload privilege tables now?

  • Answer Y for Do you want to continue? (for php installation)

  • Installation Success!!

  • Close window using normal Windows or Mac methods

Install NanoLIMS

If you selected to use the Ubuntu 16.04 LTS AMI please make sure you installed LAMP stack as noted above

  • Connect to your instance through SSH by clicking the orange 'Connect using SSH' button. (This will open a web GUI of your terminal connecting to your instance

You are now brought to your Ubuntu instance inside the terminal GUI and signed in automatically as user 'Ubuntu'. You are currently in your home directory. We will be creating a file named lamp.sh and inputting the contents of the NanoLIMS file of the same name (nanolims.sh). This installation is interactive.

  • Create a file named nanolims.sh
    

We will be creating a file using the text editor called vi
Note: Some basic vi commands can be found here (http://cc.iiti.ac.in/vicom.pdf)

  • Type i to turn on insert-mode within the vi text editor

The words --INSERT-- will appear at the bottom of the screen so you know you are now ready and able to insert text to the page

Because Lightsail uses a GUI we must use special key commands to copy and paste text from your desktop to the lightsail terminal.

  • Click inside Lightsail terminal
  • Press ctrl key, shift key, and alt key at the same time to bring up Lightsail's copy paste window or clipboard
  • Right click and select paste to paste contents of lamp.sh to clipboard area

  • Press ctrl key, shift key, and alt key at the same time again to close Lightsail's clipboard
  • Click inside terminal window (you should still be in insert mode)
  • Right-click on mouse to paste contents into file. Use arrow keys on keyboard to scroll to top. To ensure that entire contents were pasted in, use up arrow to scroll to the top of the page and make sure top of file reads '#! /bin/bash/' (else press esc, then type q! to start again at vi nanolims.sh)
  • Press Esc, then type wq and enter to save and quit

  • Type source nanolims.sh and press enter

Installation will now proceed. When asked 'Do you want to continue? [Y/n]' type Y and press enter

  • Type Y for all subsequent questions which ask [Y/n]

  • When asked 'What platform are you using? [bitnami, ubuntu16,other]' type in one of the 3 options and press enter

bitnami - choose if you are using the amazon image LAMP Stack 5.6.27 (script will assume unique bitnami file structure)
ubuntu16 - choose if you are using amazon image Ubuntu 16.04 LTS
other - choose if you are using another version of Ubuntu (you will need to supply path to webroot and path to php.ini . Please consult your web host documentation for details. Note you will also need to be logged on with a user who has sudo privileges.)

  • If asked for mysql root password

bitnami - This is N/A. Script will pull mysql root password automatically
ubuntu16 - If you used the AWS Ubuntu 16.04 LTS AMI, please supply the root password you created in the previous section (assues you used lamp.sh to set up LAMP stack)
other - User will need to supply previously set-up mysql root password

(Note : no characters will display when you type (will be invisible))

  • User will be asked, "Would you like to install NanoLIMS Demo [Y/N]"? Please answer with Y or N.
    Y - will install NanoLIMS demo which comes pre-populated with example projects and samples.
    N - will install the an empty NanoLIMS

  • When asked to Please enter a new nanolims mysql db password

Select any new password and press enter. This will be your new password for your mysql nanolims_test user . (Note : no characters will display when you type (will be invisible))

  • View NanoLIMS

Using Public IP address found on your instance main page, go to your browser and type -

http://[public ip]/NanoLIMS/login.php

Back-up Instance

  • Log onto your AWS lightsail instance

Go to https://amazonlightsail.com/ and login

  • Click on the instance you would like to manage

  • Select Snapshots from menu

  • Click on Create Snapshot

  • Wait while snapshot is created

Restore Instance

  • Log onto your AWS lightsail instance

Go to https://amazonlightsail.com/ and login

  • Click on the instance you would like to manage

  • Select Snapshots from menu

  • Select which Snapshot you want to restore and select 'Create new instance'

Miscellaneous Information

Note: Limitations of using AWS Lightsail - Limitation of 200 emails/day
Bitnami AWS FAQ : bitnami documenation for aws (https://docs.bitnami.com/aws/faq/)
AWS Lightsail Documentation: aws documenation (https://lightsail.aws.amazon.com/ls/docs/all)

Disclaimer

All NanoLIMS users are responsible for their own data security. Please take any necessary extra precautions to reduce the inherent risk involved with database exposure to the internet such as SQLi and xxs attacks. NanoLIMS utilizes prepared statements and htmlspecialchars to help protect against these attacks. However, NanoLIMS has been created for a closed internet connection and has not been rigorously tested against these types of attacks Please backup all database information as needed