How to Configure Httpd web server inside the Docker

Hola Everyone, Today I am going to explain to you how to configure httpd web server inside the docker.

Step by step instructions

Command used to download centos:8 image is docker pull centos:8

2. Now, launch the container on the docker.

Command used: docker run -it — name webserveros centos:8

3. Now, to configure the httpd web server, you need to download httpd package.

Note: See the below image for proper instructions.

launch the container on the docker
launch the container on the docker
launch the container on the docker

4. Now, go to the HTML folder and create a file of extension .html.

Command used: cd /var/www/html

vi index.html,

write the content in it,

cat index.html

Note: See the below image for proper instructions.

creating index.html file
creating index.html file
creating index.html file
content in the file

5. Now, you have to enable the httpd service.

Command Used: /usr/sbin/httpd

Note: See the below image for proper instructions.

6. Now to check the IP address, you have to download the net-tools package.

Command Used: dnf install net-tools -y

Note: See the below image for proper instructions.

7. All set now, just go to the firefox or any web browser, type the IP with the file name, and hit Enter.

Note: http://172.17.0.2/index.html

Final Output →

Follow me on Medium if you like my article.

Thank you so much for reading my article.