Docker EXEC Operations Kodekloud



 

Question:


 

Solution:

Log in to mentioned app server in the question

ssh banner@stapp03

Find the docker container

sudo docker ps

Enter inside the docker container

docker exec -it kkloud /bin/bash

Install the apache2 and update the configuration according to mention ports and hostname

apt install apache2 -y

cd  /etc/apache2

sed -i 's/Listen 80/Listen 3001/g' ports.conf

sed -i 's/:80/:3001/g' apache2.conf

sed -i 's/#ServerName www.example.com/ServerName localhost/g' apache2.conf

Restart and check the status of apache

service apache2 start

service apache2 enable

service apache2 status

 

Download Coding Interview Book and Get More Tutorials for Coding and Interview Solution: Click Here

Download System Design Interview Book and Get More Tutorials and Interview Solution: Click Here

Do you need more Guidance or Help? Then Book 1:1 Quick Call with Me: Click Here

Share on Google Plus

About Ashadullah Shawon

I am Ashadullah Shawon. I am a Software Engineer. I studied Computer Science and Engineering (CSE) at RUET. I Like To Share Knowledge. Learn More: Click Here
    Blogger Comment
    Facebook Comment

1 comments:

  1. cd /etc/apache2

    sed -i 's/Listen 80/Listen 3001/g' ports.conf

    sed -i 's/:80/:3001/g' apache2.conf

    sed -i 's/#ServerName www.example.com/ServerName localhost/g' apache2.conf

    ReplyDelete