Followers

Linux- apt package manager and service commands

apt 

   It is a package manager that stores the reference to the packages which we need to install on our Linux system.

Example

  To Install a webserver (apache2 on ubuntu system)

  Run the below command to update the apt repository.

Step 1:-> Update apt repo

     sudo apt update  

     OR

     sudo apt-get update

Step2: -> Install apache2 from apt repo reference.

   sudo apt install apche2 -y

Step 3:-> Verify apache is installed or not (apache is installed as a service)

    sudo service apache2 status

    OR

    sudo systemctl status apache2

  Step 4:-> By default, apache2 is running on port 80 (http).

            Portr 22 :- SSH 

            Port 80 :- HTTP

            Port 443:- HTTPS

Step 5:- Access apache default web page

       curl command:- It returns http respose

       curl localhost:80

        Got to the browser and check you are able to access the Apache default page

Step 6:- Stop apache service and check whether you are able to access apache webpage or not.(You should not be able to access the web page)

           systemctl stop apache2


Step 7:- Start apache service and refresh your browser.restart command is to stop the service and start it again if it is in the started mode whereas if the service is in the stopped mode then it will just start the service.

           systemctl start apache2

           OR

          systemctl restart apache2

Step 8:- Create an HTML file and host it on the apache server.

    When you install apache then there is a special type of directory get created (/var/www/html)  where we can host html,php...other types of files


sudo echo "<h1> This is super cool html file </h1>" >> /var/www/html/sample.html


Step 9:- Browse sample.html file to the browser

    curl localhost/sample.html

    OR

    got to the browser and browse URL localhost/sample.html

Step 10:- Uninstall apache2 from ubuntu system

    apt purge apache2 -y

    systemctl status apache2







COMMENTS

Name

Ansible,6,AWS,1,Azure DevOps,1,Containerization with docker,2,DevOps,2,Docker Quiz,1,Docker Swarm,1,DockerCompose,1,ELK,2,git,2,Jira,1,Kubernetes,1,Kubernetes Quiz,5,SAST DAST Security Testing,1,SonarQube,3,Splunk,2,vagrant kubernetes,1,YAML Basics,1,
ltr
static_page
DevOpsWorld: Linux- apt package manager and service commands
Linux- apt package manager and service commands
DevOpsWorld
https://www.devopsworld.co.in/p/linux-apt-package-manager-and-service.html
https://www.devopsworld.co.in/
https://www.devopsworld.co.in/
https://www.devopsworld.co.in/p/linux-apt-package-manager-and-service.html
true
5997357714110665304
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content