In this lesson we're going to run our server setup script on our new ec2
instance to set it up and install all the required applications and our REST
API app. So let's get started. Make sure that you're logged into the ec2 instance
like I explained in the previous lesson. So head over to your AWS console, copy
the address, the DNS address of our server and type SSH ubuntu
@ and then paste in the address
Oops...Didn't copy properly... SSH ubuntu @ and hit enter. Okay so once we're
connected to the server and we logged in as the Ubuntu user we're going to make
sure we have a tool called wget installed on the server. This is a tool
that we can use to download files from a HTTP server on our Linux server using
the command line. So type sudo apt-get install wget and hit enter. You can see
it already came installed with Ubuntu so we don't need to install it. Alright
so next we need to identify the file on github that we want to download to
our server. So we want to head over to our Github page and when you load it up
you'll see this home page here or this main project page. When I click on the
deploy folder and then we want to choose this server setup .sh script. Ok so
once you've found this file we want to get the URL to download the raw file so
click on the raw button here and you can see it just outputs the plain text file
copy the URL of that file and then head back to our SSH and then type wget
and then paste the URL and hit enter. If you type ls it will show you that it is
downloaded the file to our home directory on the server. So now you can
type... or we want to make this file executable so we can run this file on
our server. The way that you do that is you use the chmod command so c-h-m-o-d
+ x and then the name of the file. What this does is it uses the chmod
command to add the executable permission to this file. So if we were to put a -
instead of a + here it would take away the executable permissions. But we want to
add it so we use a +x and then hit enter. If you type ls again you can see that
it's turned green and may not turn green if you're using a different operating
system such as Linux or Mac it may be a different color but the point is that it
changes because it's become executable. Finally let's run this script to set up
our rest api on the server. So type sudo and then the name of the script sorry
sudo . / and then the name of the script server_setup
.sh hit enter and this is going to run the script that we
created in one of the previous lessons, it's going to run it on our server and
this should install all the dependencies and all the applications we require to
get our REST API working. So let's go ahead and wait for that to finish it
should take a few minutes to install all the dependencies and then we can
continue to the next lesson. Okay you can see that the script is done because it
output this done smiley face at the bottom. So our server should now be set
up to run our API. Thank you so much for watching and I'll see you the next
lesson.