ARTH Task 7.2
Vinit Sharma
Computer science Engineer || Data Science || DevOps practitioner || AWS CSA ||
Webserver:
A web server is a computer that runs websites. It's a computer program that distributes web pages as they are requisitioned. The basic objective of the web server is to store, process and deliver web pages to the users. This intercommunication is done using Hypertext Transfer Protocol (HTTP). These web pages are mostly static content that includes HTML documents, images, style sheets, test etc. Apart from HTTP, a web server also supports SMTP (Simple Mail transfer Protocol) and FTP (File Transfer Protocol) protocol for emailing and for file transfer and storage.
Docker:-
Docker provides the ability to package and run an application in a loosely isolated environment called a container. The isolation and security allow you to run many containers simultaneously on a given host. Containers are lightweight because they don’t need the extra load of a hypervisor, but run directly within the host machine’s kernel. This means you can run more containers on a given hardware combination than if you were using virtual machines.
Task Description:-
* Configuring HTTPD Server on Docker Container
* Setting up Python Interpreter and running Python Code on Docker Container
Step1:- To install docker in our RHEL8 OS, we have to use the following command:-
yum install docker-ce --nobest
Step2:- After installing docker, docker images are pulled by using the following command and in this task CentOS is used
docker pull centos
Step3:- Now we launch the docker container by using the command given below:-
docker run -it — name=mywebserver centos
Step4:- To configure webserver, httpd package should be installed in our docker container:-
Step5:- Now we create a file with extension .html in the /var/www/html folder by using following commands:-
cd /var/www/html
vi index.html
Step6:- Now we use the given command to enable the httpd service:-
/usr/sbin/httpd
Step7: - Now to check the IP address, we have to install the net-tools package by using the given command:-
yum install net-tools -y
To check IP address. we use the following command:-
ip addr
Step8:- We can see in the below image that our webserver is working fine:-
Step9:- To run python code in our docker container, we have to install python package by using the following command:-
yum install python3
Step10:- After installing python3, we can run python code as we can see in the image given below:-
Thankyou!!