DEV Community

Banoth Upender
Banoth Upender

Posted on

What is Webserver, httpd, Yum repository, Installing Web Package & Bootstrap scripts

What is Webserver :

A Web server is a program that uses HTTP (Hypertext Transfer Protocol) to serve the files that from Web pages to users, in response to their request.

Ex:
1) Apache HTTP Server
2) Internet Information Services (IIS)
3) nginx
4) httpd by Apache

What is httpd :

HTTP Daemon is a software program that runs in the background as a web server.
It waits for the incoming server requests. The daemon answers the request and serves the hypertext and multimedia documents over the Internet using HTTP.

Creating Web Server :

We need to install web package, it is called web server.
package is nothing but software.

Step 1: Launch Linux machine - Amazon Linux 2 ( Delete any keypair, and security groups except default ) Name - MyLinux, Security Group Name - LinuxSG , View Instances.

TO Connect to the machine
Open puttygen --- generate ppk file.
Open putty and connect to the machine.

What is Yum repository :

YUM Repositories are warehouses of Linux software.
Sometimes the software we want to install is not available in Linux OS default.
In such situations , we can use YUM Repositories.
We can install new software on Linux with
"yum install packagename" command from console.

Installing Web Package :

sudo su
yum update -y
yum install httpd -y
cd /var/www/html
echo "MyGoogle" > index.html
service httpd start
chkconfig httpd on ( This command will help to start httpd service automatically, whenever machine is restarted )

Now, Our Linux machine is webserver.

Now, Lets test are we able to access the web pages?

Copy the public IP and paste in browser
We are unable to access?

Browser communicates using http port
We should also open http port

Lets open http port

IN AWS Dashboard, click on security groups
Select our security group ( LinuxSG ) ---> Inbound --> Edit --> Add rule
Select Type - HTTP -- Save.

Observation: We get two entries for HTTP port.
One for ipv4 and other for ipv6


Now, Lets test are we able to access the web pages?
Yes!!!

+++++++++++++++++++++

Bootstrap scripts :

When you launch an instance in Amazon EC2, you have the option of passing user data to the instance that can be used to perform common automated configuration tasks.

!/bin/bash

sudo su
yum update -y
yum install httpd -y
cd /var/www/html
echo "MyGoogle-2" > index.html
service httpd start
chkconfig httpd on

Top comments (0)