Question: There is a static website running within a container named nautilus, this container is running on App Server 1. Suddenly, we started facing some issues with the static website on App Server 1. Look into the issue to fix the same, you can find more details below:
Container's volume /usr/local/apache2/htdocs is mapped with the host's volume /var/www/html.
The website should run on host port 8080 on App Server 1 i.e command curl http://localhost:8080/ should work on App Server 1.
Please Note:- Perform the below commands based on your question server, user name & other details that might differ. So please read the task carefully before executing it. All the Best 👍
Solution:
1. At first login on app server as per the task & switch to root user
thor@jump_host ~$ ssh tony@stapp01 The authenticity of host 'stapp01 (172.16.238.10)' can't be established. ECDSA key fingerprint is SHA256:+GEXixL2LtA06sRZ5OqTHyuSpltvLhCR6X5gmrNY3xs. ECDSA key fingerprint is MD5:84:02:c0:6a:91:18:66:7b:d2:be:97:a3:c0:70:0e:10. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'stapp01,172.16.238.10' (ECDSA) to the list of known hosts. tony@stapp01's password: [tony@stapp01 ~]$ sudo su - We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things: #1) Respect the privacy of others. #2) Think before you type. #3) With great power comes great responsibility. [sudo] password for tony: [root@stapp01 ~]# |
2. Run the Below command to check the existing docker Images & container running
[root@stapp01 ~]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES [root@stapp01 ~]# [root@stapp01 ~]# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 4354381ba1d0 httpd "httpd-foreground" 6 minutes ago Exited (0) 6 minutes ago nautilus [root@stapp01 ~]# |
[root@stapp01 ~]# docker restart nautilus [root@stapp01 ~]# |
[root@stapp01 ~]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 4354381ba1d0 httpd "httpd-foreground" 7 minutes ago Up 8 seconds 0.0.0.0:8080->80/tcp nautilus [root@stapp01 ~]# |
[root@stapp01 ~]# curl http://localhost:8080 <!DOCTYPE html> <html> Welcome to xFusionCorp Industries! [root@stapp01 ~]# |
Happy Learning!!!!
0 Comments