You are on page 1of 9

Linux Services Assignment

Installing various packages for frontend and backend with text editor:

For this part, I am installing NodeJS in AWS EC2.


NodeJS is Javascript engine which is used mainly for web development.

For installing we need to first install node version manager(NVM)

The command to install it is:


curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash

To check if its working:

So we have installed the NodeJS for our web development project


After this we need to activate the nvm with command:
. ~/.nvm/nvm.sh

And to install NodeJs we use:


nvm install --lts

For text editor

We are installing vim editor in our ec2 instance


First we need to update
Using APT package manager install vim
Command for installing vim:
sudo apt-get install vim

To check the version of vim, use vim –version


The nginx web server for application hosting:

NGINX is a web server that helps deliver content from a website to your web browser.
It's like a traffic cop that directs your browser to the right place so you can see the website
you want.

NGINX is known for its speed and reliability, and it's often used by websites that have a lot of
traffic or need to handle a lot of requests at once. It's also free and open-source, meaning
anyone can use and modify it.

For using NGINX we need to add keypair to our EC2 instance

After that we need to update and install NGINX using:


sudo apt install nginx

To start NGINX service we us following command

Sudo systemctl start nginx.service

And to check status of NGINX

Sudo systemctl status nginx.service


After that we can visit the ip of EC2 instance where we can see our NGINX is started
For updating we use:

sudo apt update

To remove the tools we use

Sudo apt-get remove TOOLNAME


Bash scripting to count the number of files in a given directory:

To count the number of files we can use:


ls DirectoryName | wc –l

we are piping the ls command with wc command which is used for counting the words

Another way to count files is by using find method which recursively goes in every directory
and with piping it with wc we can count the number of files

Network troubleshooting commands using shell scripting:

Ping
Checks if the remote server is reachable using ICMP protocol. It also shows the round trip
time of packets.

Host
To get host DNS details
Curl
A cross-platform utility that is used to transfer data. It can be used for troubleshooting
several network issues.

Wget
Utility to download files. Can be used for troubleshooting proxy connections and connectivity.

IP
Shows the ipaddress

Traceroute
This utility uses the ICMP protocol and finds the hops involved in reading the destination
server. It also shows the time it takes between hops.

You might also like