Sharing Ilmu

Sharing for useful things

How To configure web server with container on Linux CentOS/RedHat

Hello everyone, in this exercise I’ll discuss about how to configure web server with Container on linux centos/redhat. In preceding tutorial Running Simple Container with podman and in this tutorial I want to explain more advance about it.

The following that are step by step to do that :

Login to registry first so that you can pull images from those registry.

podman login registry.redhat.io

create running container using podman run with name webcont, mapping port 8181 to container port 8080 and -d option. -d option that means are detached for return podman ID to background screen and check running podman with podman ps. 

$ podman run -d –name webcont -p 8181:8080 registry.redhat.io/rhel8/httpd-24

$ podman ps

use podman port -a command for get information about port containers.

As the shown image above, the container run on 8080 port before, then mapped to 8181 port.

Configure firewall-cmd for 8181 port so that firewall not blocking the service port.  

Now test web server via web browser.

The configuration has been successfull.

Leave a Reply

Your email address will not be published. Required fields are marked *.

*
*
You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>