└── README.md /README.md: -------------------------------------------------------------------------------- 1 | # Getting started with Cloud9 on Amazon Web Services (AWS) 2 | 3 | - Sign up [here](https://portal.aws.amazon.com/billing/signup#/start) 4 | - Select **Personal** for account type 5 | - AWS requires a valid phone number for verification 6 | - Your credit/debit card will also be charged $1 for verification purposes, the amount will be refunded after being processed 7 | - See [here](https://aws.amazon.com/premiumsupport/knowledge-center/aws-authorization-charges/) for more information about the charge 8 | - Select the *Free* **Basic Plan** 9 | - This plan is free for 12 months with certain usage restrictions, set a date in your calender to cancel your plan if you don't want to be charged after one year 10 | - See more details about the free plan [here](https://aws.amazon.com/free/?sc_channel=em&sc_campaign=wlcm&sc_publisher=aws&sc_medium=em_wlcm_1d&sc_detail=wlcm_1d&sc_content=other&sc_country=global&sc_geo=global&sc_category=mult&ref_=pe_1679150_261538020) 11 | - Sign in to the AWS console with your new account 12 | - It can take up to 24 hours for your account to be verified, check your email for notification 13 | - Once logged in you'll be in the AWS dashboard 14 | - Click the **Cloud9** link, otherwise type **cloud9** into the **AWS services** search bar and select **Cloud9 A Cloud IDE for Writing, Running, and Debugging Code** 15 | - If your account has been verified then you will be able to select **Create environment** 16 | - Name it **wdb** and click **Next step** 17 | - *Leave default settings* and click **Next step** again 18 | - Scroll down and click **Create environment** 19 | 20 | ## Check node and npm 21 | 22 | - Once inside your c9 environment (previously called a workspace) type `node -v` into the terminal, you should see v6.11.4 or greater (current version being used at the time of the making of this tutorial) 23 | - Now type `npm -v`, you should see 3.10.10 (or higher) 24 | 25 | ## MongoDB Instructions 26 | *(skip this section and see below for MySQL Instructions if coming from MySQL course)* 27 | 28 | - Enter `touch mongodb-org-3.6.repo` into the terminal 29 | - Now open the **mongodb-org-3.6.repo** file in your code editor (select it from the left-hand file menu) and paste the following into it then save the file: 30 | 31 | ``` 32 | [mongodb-org-3.6] 33 | name=MongoDB Repository 34 | baseurl=https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/3.6/x86_64/ 35 | gpgcheck=1 36 | enabled=1 37 | gpgkey=https://www.mongodb.org/static/pgp/server-3.6.asc 38 | ``` 39 | 40 | - Now run the following in your terminal: 41 | 42 | ``` 43 | sudo mv mongodb-org-3.6.repo /etc/yum.repos.d 44 | sudo yum install -y mongodb-org 45 | ``` 46 | - Close the **mongodb-org-3.6.repo** file and press **Close tab** when prompted 47 | - Change directories back into root ~ by entering `cd` into the terminal then enter the following commands: 48 | 49 | ``` 50 | mkdir data 51 | echo 'mongod --dbpath=data --nojournal' > mongod 52 | chmod a+x mongod 53 | ``` 54 | 55 | - Now test mongod with `./mongod` 56 | - Remember, you must first enter `cd` to change directories into root ~ before running `./mongod` 57 | - Don't forget to shut down ./mongod with `ctrl + c` each time you're done working 58 | 59 | That's it! You're all set :) 60 | 61 | ## MySQL Instructions 62 | 63 | - Enter `sudo service mysqld start` into the terminal 64 | - Enter `/usr/libexec/mysql55/mysql_secure_installation` and follow the steps for setting up your root account and password. 65 | - When prompted for the initial password press enter 66 | - If this step fails then enter `/usr/libexec/mysql55/mysqladmin -u root password 'new-password'` 67 | - Be sure to replace `'new-password'` with your password 68 | - Now start the secure installation over again with `/usr/libexec/mysql55/mysql_secure_installation` and enter the password you just created 69 | - Disable remote root access and remove test database and anonymous user during the secure installation steps 70 | 71 | - Start the mysql shell with root user access by entering: `mysql -uroot -p` and typing in your root password when prompted 72 | - Password will be hidden while typing it in, press enter when done typing and the shell will start if the password is correct 73 | - Once inside of the shell test it out with the following commands: 74 | 75 | 76 | 77 | ``` 78 | CREATE database test; 79 | USE test; 80 | CREATE TABLE pet (name VARCHAR(20), owner VARCHAR(20), species VARCHAR(20)); 81 | INSERT INTO pet (name, owner, species) VALUES('Loki', 'Ian', 'Dog'); 82 | SELECT * FROM pet; 83 | ``` 84 | 85 | **Result:** 86 | 87 | ``` 88 | +------+-------+---------+ 89 | | name | owner | species | 90 | +------+-------+---------+ 91 | | Loki | Ian | Dog | 92 | +------+-------+---------+ 93 | ``` 94 | - When you're done working you can exit the shell by typing `exit` or pressing `ctrl + c` 95 | - Stop the mysql daemon with `sudo service mysqld stop` 96 | --------------------------------------------------------------------------------