<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Shivam Bansal on Medium]]></title>
        <description><![CDATA[Stories by Shivam Bansal on Medium]]></description>
        <link>https://medium.com/@shivam__bansal?source=rss-4726632eff77------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*5xlDipNb375b1RgzkqBJ8w.jpeg</url>
            <title>Stories by Shivam Bansal on Medium</title>
            <link>https://medium.com/@shivam__bansal?source=rss-4726632eff77------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 06:09:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shivam__bansal/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Kubernetes On Linux]]></title>
            <link>https://medium.com/@shivam__bansal/kubernetes-on-linux-3265356a0c61?source=rss-4726632eff77------2</link>
            <guid isPermaLink="false">https://medium.com/p/3265356a0c61</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[vagrant]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Shivam Bansal]]></dc:creator>
            <pubDate>Thu, 19 Jan 2023 07:59:53 GMT</pubDate>
            <atom:updated>2023-01-19T08:16:09.968Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>DevOps: Install Kubernetes on Linux using Shell scripting</strong></h3><p>By — Shivam Bansal</p><p><strong>Pre-requisite:-</strong></p><p>VagrantBox</p><p>Vagrant</p><p><strong>What is Kubernetes?</strong></p><p><strong>Kubernetes </strong>(also known as k8s or “Kube”) is an open-source container orchestration platform that automates many manual processes in deploying, managing, and scaling containerized applications.</p><p><strong>What is Kubernetes Cluster?</strong></p><p>A<strong> Kubernetes cluster</strong> is a set of nodes that run containerized applications. Containerizing applications package an app with its dependencies and some necessary services. They are more lightweight and flexible than virtual machines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*5FSEuOPoypHNzZvm0wWXRA.png" /></figure><p>For more information about Kubernetes Cluster <a href="https://www.redhat.com/en/topics/containers/what-is-a-kubernetes-cluster">Click here</a></p><p>Vagrantfile code to create Kubernetes Cluster</p><p><strong>Step — 1:- Creating Vagrantfile</strong></p><p>Create a Folder in your system’s desired location and create a new file with the name “Vagrantfile”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*AUB0O_C_gr2yXPtZ" /></figure><p><strong>Step- 2:- Write Vagrantfile and shell scripts for kubernetes cluster</strong></p><p>Write your Vagrantfile to Create a Virtual Machine</p><pre>NUM_WORKER_NODES=2<br><br>Vagrant.configure(&quot;2&quot;) do |config|<br>config.vm.box=&quot;ubuntu/bionic64&quot;<br>config.vm.define &quot;master&quot; do |master|<br>master.vm.hostname = &quot;master-node&quot;<br>master.vm.network &quot;private_network&quot;, type: &quot;dhcp&quot;<br>master.vm.provider &quot;virtualbox&quot; do |vb|<br>  vb.memory = 2048<br>  vb.cpus= 1<br>  vb.customize [&quot;modifyvm&quot;, :id, &quot;--natdnshostresolver1&quot;, &quot;on&quot;]<br>  vb.customize [&quot;modifyvm&quot;, :id, &quot;--natdnsproxy1&quot;, &quot;on&quot;]<br> end<br>master.vm.provision &quot;shell&quot;, path: &quot;scripts/common.sh&quot;<br>master.vm.provision &quot;shell&quot;, path: &quot;scripts/master.sh&quot;<br>end<br><br>(1..NUM_WORKER_NODES).each do |i|<br> config.vm.define &quot;node0#{i}&quot; do |node|<br>  node.vm.hostname=&quot;worker-node0#{i}&quot;<br>  node.vm.network &quot;private_network&quot;,type: &quot;dhcp&quot;<br>  node.vm.provider &quot;virtualbox&quot; do |vb|<br>    vb.memory=2048<br>    vb.cpus = 1<br>    vb.customize [&quot;modifyvm&quot;, :id, &quot;--natdnshostresolver1&quot;, &quot;on&quot;]<br>           vb.customize [&quot;modifyvm&quot;, :id, &quot;--natdnsproxy1&quot;, &quot;on&quot;]  <br>  end <br>        node.vm.provision &quot;shell&quot;, path: &quot;scripts/common.sh&quot;<br>        node.vm.provision &quot;shell&quot;, path: &quot;scripts/node.sh&quot;<br>end<br>end<br>end</pre><p>In this Vagrantfile, we declared 1 master node and 2 worker nodes by “NUM_WORKER_NODES=2” and after that, we define their memory and CPUs.</p><p><strong>{ master.vm.provision “shell”, path: “scripts/common.sh” } </strong>In this line we define some shell scripting in which it will install the docker and Kubernetes in the master and every worker node automatically user doesn’t have to do it by himself.</p><p><strong>Common.sh</strong></p><pre>#!/bin/bash<br>set -euxo pipefail<br>sudo swapoff -a<br>#echo &quot;nameserver 8.8.8.8&quot; &gt;&gt; /etc/resolv.conf<br>sudo apt-get update -y<br>sudo modprobe overlay<br><br>sudo modprobe br_netfilter<br><br>cat &lt;&lt;EOF | sudo tee /etc/sysctl.d/99-kubernetes-cri.conf<br>net.bridge.bridge-nf-call-iptables  = 1<br>net.ipv4.ip_forward                 = 1<br>net.bridge.bridge-nf-call-ip6tables = 1<br>EOF<br><br># install docker<br><br>sudo apt-get install -y  ca-certificates curl gnupg lsb-release<br>sudo mkdir -p /etc/apt/keyrings<br>curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg  --dearmor &gt;&gt; /etc/apt/keyrings/docker.gpg<br>echo &quot;deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable&quot; | sudo tee /etc/apt/sources.list.d/docker.list &gt; /dev/null<br>sudo apt-get update<br>sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin<br><br><br># install kublet kubectl and kubeadm<br><br>sudo apt-get update<br>sudo apt-get install -y apt-transport-https ca-certificates curl<br>sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg<br><br>echo &quot;deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main&quot; | sudo tee /etc/apt/sources.list.d/kubernetes.list<br>sudo apt-get update <br>sudo apt-get install -y kubelet kubectl kubeadm<br><br>sudo apt-get install -y jq<br><br>local_ip=&quot;$(ip --json a s | jq -r &#39;.[] | if .ifname == &quot;enp0s8&quot; then .addr_info[] | if .family == &quot;inet&quot; then .local else empty end else empty end&#39;)&quot;<br>  cat &gt; /etc/default/kubelet &lt;&lt; EOF<br>KUBELET_EXTRA_ARGS=--node-ip=$local_ip<br>EOF<br><br>systemctl status docker<br>  cat &lt;&lt;EOF &gt;&gt; /etc/docker/daemon.json<br>{<br>&quot;exec-opts&quot;: [&quot;native.cgroupsdriver=systemd&quot;],<br>&quot;log-driver&quot;: &quot;json-file&quot;,<br>&quot;log-opts&quot;: {<br>&quot;max-size&quot; : &quot;100m&quot;<br>},<br>&quot;storage-driver&quot; : &quot;overlay2&quot;<br>}<br>EOF<br><br>systemctl daemon-reload<br>systemctl restart docker<br>systemctl enable docker<br>systemctl restart containerd<br>rm /etc/containerd/config.toml || true<br>systemctl restart containerd<br><br></pre><p><strong>Note:- Common.sh file is common for both master and worker nodes.</strong></p><p><strong>master.sh</strong></p><pre>#!/bin/bash<br><br>set -euxo pipefail<br><br>NODENAME=$(hostname -s)<br>POD_CIDR=&quot;192.168.0.0/16&quot;<br><br>MASTER_IP=&quot;$(ip --json a s | jq -r &#39;.[] | if .ifname == &quot;enp0s8&quot; then .addr_info[] | if .family == &quot;inet&quot; then .local else empty end else empty end&#39;)&quot;<br><br><br>sudo kubeadm init --apiserver-advertise-address=$MASTER_IP --apiserver-cert-extra-sans=$MASTER_IP --pod-network-cidr=$POD_CIDR --node-name &quot;$NODENAME&quot; --ignore-preflight-errors all<br><br>mkdir -p &quot;$HOME&quot;/.kube<br>sudo cp -i /etc/kubernetes/admin.conf &quot;$HOME&quot;/.kube/config<br>sudo chown &quot;$(id -u)&quot;:&quot;$(id -g)&quot; &quot;$HOME&quot;/.kube/config<br><br>config_path=&quot;/vagrant/configs&quot;<br><br>if [ -d $config_path ]; then<br>  rm -f $config_path/*<br>else<br>  mkdir -p $config_path<br>fi<br><br>cp -i /etc/kubernetes/admin.conf /vagrant/configs/config<br>touch /vagrant/configs/join.sh<br>chmod +x /vagrant/configs/join.sh<br><br>kubeadm token create --print-join-command &gt; /vagrant/configs/join.sh<br><br># Install Calico Network Plugin<br><br>curl https://docs.projectcalico.org/manifests/calico.yaml -O<br><br>kubectl apply -f calico.yaml<br><br></pre><p><strong>Note:- master.sh file is for the master node only</strong></p><p><strong>node.sh</strong></p><pre>#!/bin/bash<br>#<br># Setup for Node servers<br><br>set -euxo pipefail<br><br>/bin/bash /vagrant/configs/join.sh -v<br><br><br></pre><p><strong>Note:- node.sh is for worker node only</strong></p><p>Now by using these Shell scripts we create 1 master node and 2 worker nodes and create Kubernetes cluster but not only that we also connect them by given the token to master node.</p><p>After Writing these Scripts put them into a new folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/0*ZRAzg8zUKjWK4wGf" /></figure><p><strong>Step- 3:- Run Vagrant</strong></p><p>After all, run your vagrant file by using the command</p><p>Vagrant up → For creating and running the Vagrant</p><p>Vagrant ssh master → For using your Virtual Machine on your command line but this time we use VM as the master node.</p><p><strong>Step- 4:- Check if Kubernetes cluster build successfully</strong></p><p>Check if your nodes and master are connected and ready</p><p>Run the command “<strong>kubectl get nodes”</strong> and check if the worker node is ready or not.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/462/0*mfTNadq1q-xPgbv6" /></figure><p>If the worker node is not visible, so delete the vagrant by using the <strong>“vagrant delete” </strong>command and run the <strong>“vagrant up”</strong> once again with a stable internet connection.</p><p>But if it is not ready then run commands ➖</p><pre>journalctl -xeu kubelet<br><br>    systemctl status docker<br><br>    cat /etc/docker/daemon.json<br><br>    systemctl status kubelet<br><br>    cat /etc/default/kubelet<br><br>    echo $MASTER_IP<br><br>   POD_CIDR=192.168.0.0/16<br><br>   sudo kubeadm init --apiserver-advertise-address=$MASTER_IP --apiserver-cert-extra-sans=$MASTER_IP --pod-network-cidr=$POD_CIDR --node-name &quot;$NODENAME&quot; --ignore-preflight-errors all<br><br>   systemctl restart kubelet <br><br>   systemctl status kubelet<br><br>   systemctl start kubelet<br><br>   systemctl status kubelet<br><br>   kubelet --version<br><br>   apt-get remove --purge kubelet kubeadm kubectl<br><br>   sudo apt-get install -y kubelet kubeadm kubectl<br><br>   systemctl status kubelet<br><br>   systemctl restart kubelet<br><br>   systemctl status kubelet<br><br>   journalctl -xeu kubelet<br><br>   cat /etc/default/kubelet<br><br>   sudo kubeadm init --apiserver-advertise-address=$MASTER_IP --apiserver-cert-extra-sans=$MASTER_IP --pod-network-cidr=$POD_CIDR --node-name &quot;$NODENAME&quot; --ignore-preflight-errors all<br><br>   kubeadm --help<br><br>   kubeadm reset<br><br></pre><p><strong>Step -5:- Creating a Kubernetes cluster pod</strong></p><p>By using the command “<strong>kubectl create deploy test — image httpd:latest”</strong></p><p>You will get output like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/0*DBj1UBm_-v86wBA3" /></figure><p><strong>Step -6:- Now check Kubernetes Cluster pods</strong></p><p>By using this command<strong> “kubectl get po” </strong>and wait till it gets ready.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/0*7oWQvgxrPcwELWH6" /></figure><p><strong>What are Pods in Kubernetes?</strong></p><p><strong>Pods </strong>are the smallest, most basic deployable objects in Kubernetes. It represents a single instance of a running process in your cluster. It contains one or more containers, such as<strong> Docker containers</strong>. When it runs multiple containers, the containers are managed as a single entity and share the Pod’s resources.</p><p><strong>What is a container?</strong></p><p>A <strong>container</strong> is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another. A Docker container image is a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime, system tools, system libraries, and settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BDX_ZJxxGkHAdpBh" /></figure><p>Now if you want to see every pod working behind the scene which is displayed in the figure above the paragraph, So, run the command <strong>“Kubectl get pod -n Kube-system -o wide”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Lp4wbqnZwgbqkI-D" /></figure><p>In this figure you can see that <strong>kube-proxy, etcd-master-node, kube-apiserver-master-node, kube-controller-manager-master-node </strong>all are running<strong>.</strong></p><p><strong>Now let’s run a new pod using the yml file</strong></p><p>Run the command:- “<strong>nano pod.yml”</strong></p><p>and write this yml syntax.</p><pre>apiVersion: v1<br>kind: Pod<br>metadata:<br>  name: httpd<br>  labels:<br>    app: webserver<br>spec:<br> containers:<br> - name : test<br>   image: httpd:latest<br><br></pre><p>Note:- Exit this by using keys (ctrl+x)</p><p>Now run command <strong>kubectl apply -f pod.yml</strong></p><p>And check if the new pod is created or running or not using command</p><p>“<strong>Kubectl get po”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/0*RIWbZR-L1LtsQ-cG" /></figure><p><strong>Step -6:- Now create a docker container</strong></p><p>First, learn some basic commands of the docker</p><p>→docker ps -a (To see all the containers of the docker)</p><p>→docker run -it -p 80:80 httpd:latest (To create and run any docker container)</p><p>→docker run -dit -p 80:80 — name first ubuntu:20.04 (To create and run docker but this time with the given name by you)</p><p>→docker stop $(docker ps -aq) (To stop all docker containers at once )</p><p>→docker stop container_ID</p><p>→docker rm container_ID</p><p>→docker exec -it container_ID/Name bash (To run a command in a running container)</p><p>creating a docker container using the command</p><p><strong>docker run -dit -p 80:80 — name first ubuntu:20.04</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*p62oRyY1mM7Anq0i" /></figure><p>Now your container is ready to use.</p><p>To work inside that container Run command:-</p><p><strong>docker exec -it 5a59f314c9fb bash</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/583/0*qrTj2A75Ec0NQ13d" /></figure><p>Now you can do anything in this docker container.</p><p>To close the container type <strong>“exit”</strong>.</p><p>Conclusion:- In This Article, we have learned</p><ul><li>Creating Vagrantfile for master and worker node</li><li>Writing shell script for installing docker and Kubernetes automatically</li><li>Learning some basic Kubernetes commands, creating Kubernetes clusters and pods</li><li>Learning some Docker commands and Creating a Docker Container</li></ul><p>In the next article, I will show you how to work on Docker Container.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3265356a0c61" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DevOps On Linux]]></title>
            <link>https://medium.com/@shivam__bansal/devops-on-linux-98116e3075a6?source=rss-4726632eff77------2</link>
            <guid isPermaLink="false">https://medium.com/p/98116e3075a6</guid>
            <dc:creator><![CDATA[Shivam Bansal]]></dc:creator>
            <pubDate>Thu, 12 Jan 2023 11:29:53 GMT</pubDate>
            <atom:updated>2023-01-12T11:29:53.361Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>DevOps On Linux</strong></p><p>By — Shivam Bansal</p><p>You must need Linux installed in your system to work on DevOps on Linux. If you have windows so you can use Virtual devices for the same</p><ul><li>VMware</li><li>Vagrant</li><li>Azure Virtual Machine</li><li>Terraform</li></ul><p>We are going to use Vagrant in this Article.</p><p>In computing, a <strong>virtual machine</strong> (<strong>VM</strong>) is the virtualization/emulation of a computer system. Virtual machines are based on computer architectures and provide the functionality of a physical computer. Their implementations may involve specialized hardware, software, or a combination.</p><p>What is a Vagrant?</p><p><strong>Vagrant</strong> is an open-source software product for building and maintaining portable virtual software development environments; e.g., for VirtualBox, KVM, Hyper-V, Docker containers, VMware, and AWS. It tries to simplify the software configuration management of virtualization in order to increase development productivity. Vagrant is written in the Ruby language, but its ecosystem supports development in a few other languages.</p><p>Steps to create Vagrantfile to create a Virtual Machine</p><p><strong>Step — 1</strong>:-</p><p>Create a Folder in your system’s desired location and create a new file with the name “Vagrantfile”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/0*-n4ODjjKuydPDezq" /></figure><p><strong>Step -2:</strong></p><p>Write your Vagrantfile to Create a Virtual Machine</p><p><strong>Vagrant.configure(“2”) do |config| <br> config.vm.box = “ubuntu/bionic64” <br>end</strong></p><p>The “2” in the first line above represents the version of the configuration object that will be used for configuration for that block (the section between the do and the end). This object can be very different from version to version.</p><p><strong>Step-3:</strong></p><p>Now some Commands for starting Vagrant on your local machine</p><p>Vagrant up → For creating and running the Vagrant</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/0*Z_3mPyFzaEo0rNxi" /></figure><p>Now Vagrant is up and running</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*ZAKlLZnaK3uRkhcK" /></figure><p>This shows the description of the Virtual Machine you created</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/0*FhigMoo7yLgxP8hc" /></figure><p>Vagrant ssh → For using your Virtual Machine on your command line as</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/990/0*Gn-MhyNeC44aOuUB" /></figure><p>Now you are ready for using Virtual Desktop</p><p>Vagrant destroy → For destroying your Virtual machine</p><p><strong>Step-4:</strong></p><p>Use Command:</p><p>-sudo su: This Command allows you to run commands as root.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/385/0*-5hmtTVw3yvkkt3t" /></figure><p><strong>Step-5:</strong></p><p>Now update by using the command and install apache2 in that virtual machine.</p><p>apt update &amp;&amp; apt install apache2</p><p>While doing this may be you will get an error</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/0*8mYQCAEgmzYaHDtP" /></figure><p>To resolve this error write a command:-</p><p><strong>nano /etc/resolv.conf</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/484/0*iYlEC_GrYJQejK7z" /></figure><p>add nameserver 8.8.8.8</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/0*k--8fNQNObbJeDOU" /></figure><p>And then run that command again:-</p><p><strong>apt update &amp;&amp; apt install apache2</strong></p><p><strong>Step -6:</strong></p><p>Now go to the directory with the command</p><p>cd /var/www/html</p><p>and delete the file name index.html using the command</p><p>rm index.html</p><p>and then create new file name index.html using command</p><p>nano index.html</p><p>A new page will appear and then write some html syntax in that:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/471/0*9cYXLENRaz97kDf6" /></figure><p>Now ctrl+s (for save) and ctrl + x (for exit) from the window</p><p>In this we created a virtual machine for Ubuntu.</p><p><strong>Now let’s install docker in your Virtual Machine Manually.</strong></p><p>Installing Docker:-</p><p><strong>If you are working in a (sudo su) then you don’t have to add sudo in any commands</strong></p><p>1- sudo apt-get update</p><p>2- sudo apt-get install \<br> ca-certificates \<br> curl \<br> gnupg \<br> lsb-release</p><p>3- sudo mkdir -p /etc/apt/keyrings</p><p>4- curl -fsSL <a href="https://download.docker.com/linux/ubuntu/gpg">https://download.docker.com/linux/ubuntu/gpg</a> | sudo gpg — dearmor -o /etc/apt/keyrings/docker.gpg</p><p>5- echo \<br> “deb [arch=$(dpkg — print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] <a href="https://download.docker.com/linux/ubuntu">https://download.docker.com/linux/ubuntu</a> \<br> $(lsb_release -cs) stable” | sudo tee /etc/apt/sources.list.d/docker.list &gt; /dev/null</p><p>6- sudo apt-get update</p><p>7- sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin</p><p><strong>Now we will Install apache2 using Shell Scripting:-</strong></p><p>Step-1:- let’s uninstall apache2 from your server.</p><p>1- sudo service apache2 stop<br>2- sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common<br>3- sudo apt-get autoremove<br>4- whereis apache2<br>apache2: /etc/apache2<br>5- sudo rm -rf /etc/apache2</p><p>Step-2 :- Now install apache2 using shell scripting</p><p>nano shell.sh</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dEY-WvJ_7nknvYqC" /></figure><p>#!/bin/bash<br>if [ -z $(dpkg -l |grep ‘apache’) ]<br>then<br>sudo apt update <br>sudo apt install apache2 -y<br>sed -i ‘s/80/8080/g’ /etc/apache2/ports.conf<br>echo “my name is shivam bansal” &gt;&gt; /var/www/html/index.html<br>systemctl restart apache2</p><p>else <br>echo “apache exist”<br>Fi</p><p>Chmod +x shell.sh</p><p>Bash shell.sh</p><p>(Now apache2 will be installed automatically)</p><p>Conclusion:- In This Article, we have learned</p><ul><li>Creating Vagrantfile</li><li>Installing server on Linux</li><li>Learn some Linux Commands</li><li>Install Docker manually</li></ul><p>In this article we have learned how to start Vagrant and install server and docker on vagrant manually but in next article I will show you how to install those things with the help of shell scripting.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=98116e3075a6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>