Configuring Apache Server on Docker

Configuring Apache Server on Docker

We will learn how to configure Apache server on Docker in RHEL 8

Docker

According to Wikipedia Docker is a set of platform as a service products that use OS-level virtualization to deliver software in packages called containers. Containers are isolated from one another and bundle their own software, libraries and configuration files; they can communicate with each other through well-defined channels.

First we will install docker in our Linux i.e. RHEL8 with the help of the following command:

# yum install docker-ce --nobest

To check if it is installed use the command:

# yum list docker-ce

# rpm -q docker-ce

Now, to start the docker

# systemctl start docker

To check docker information

# docker info

To launch any OS in docker, first we have to download it's image and we will use ubuntu OS to do that so for the follow the command-

# docker pull ubuntu:20.10

In the above command ubuntu:20.10 ubuntu is the image name and 20.10 is the tagline of the image. Just like the tagline 20.10 there are many more taglines if you search in google.

Now, we will launch the OS with the help of the command-

# docker run -i -t ubuntu:20.10

You can also give name to your OS with the help of the command-

# docker run -i -t --name pikoOS ubuntu:20.10

Now open another tab and to check whether the OS is running use the command:

# docker ps

To get inside the OS use the command-

# docker attach pikoOS

Now lets start with configuring Apache

After getting inside the OS we have to install several software and commands with the help of apt-get command, it works like yum command just like in RHEL8. We also have to stop the firewall of RHEL8 to install all the software so that it allows them to enter the system.

# apt-get update

No alt text provided for this image

# apt-get install apache2

No alt text provided for this image

# apt-get install systemctl

No alt text provided for this image

# apt-get install net-tools (this command helps to run ifconfig command)

No alt text provided for this image

Now we will get the IP of the OS

# ifconfig

No alt text provided for this image

Now we will install vim command

# apt-get install vim

No alt text provided for this image

Now for configuring Apache web server-

No alt text provided for this image
No alt text provided for this image

We will check if it is active or not

No alt text provided for this image

At last open the firefox and type the IP/your file name

No alt text provided for this image


To view or add a comment, sign in

Others also viewed

Explore content categories