{"id":20562,"date":"2023-08-31T15:59:08","date_gmt":"2023-08-31T15:59:08","guid":{"rendered":"https:\/\/linuxways.net\/?p=20562"},"modified":"2023-08-31T15:59:08","modified_gmt":"2023-08-31T15:59:08","slug":"how-to-install-apache2-web-server-on-debian-12","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/debian\/how-to-install-apache2-web-server-on-debian-12\/","title":{"rendered":"How to Install Apache2 Web Server on Debian 12"},"content":{"rendered":"<p><strong>Apache Server <\/strong>is used to host websites as well as to make sure that the content of the websites is loading correctly. Apache server is the most commonly used HTTP server due to its compatibility and versatility with most operating systems. It is the favorite web server of developers.<\/p>\n<p>In this particular article, we\u2019ll elaborate on how to install <strong>Apache Web Server <\/strong>from the terminal.<\/p>\n<h2><strong>How to Install Apache-2 Web Server on Debian 12?<\/strong><\/h2>\n<p><strong>Apache Server <\/strong>is the most common, free-to-use web server. It provides reliable services for hosting websites. Proceed with the following steps for installing Apache2 Web Server.<\/p>\n<h3><strong>Step 1: Update the Libraries<\/strong><\/h3>\n<p>Type the below-mentioned command to update the libraries and packages of Debian:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">sudo<\/span> apt update<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"478\" class=\"wp-image-20563\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-1.jpeg\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-1.jpeg 2048w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-1-300x70.jpeg 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-1-1024x239.jpeg 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-1-768x179.jpeg 768w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-1-1536x359.jpeg 1536w\" sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/p>\n<p>The command displays the message that packages are up to date. But in your case, it may update the packages.<\/p>\n<h3><strong>Step 2: Install Apache2 Server Using Terminal<\/strong><\/h3>\n<p>Type command that installs the Apache2 Web Server :<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> apache2 <span class=\"re5\">-y<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"781\" class=\"wp-image-20564\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-2.jpeg\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-2.jpeg 2048w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-2-300x114.jpeg 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-2-1024x391.jpeg 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-2-768x293.jpeg 768w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-2-1536x586.jpeg 1536w\" sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/p>\n<p>Apache2 will be installed after the execution of the above command.<\/p>\n<h3><strong>Step 3: Installation Verification <\/strong><\/h3>\n<p>For the confirmation of installation type the following command in the terminal:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">sudo<\/span> systemctl status apache2<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"1149\" class=\"wp-image-20565\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-3.jpeg\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-3.jpeg 2048w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-3-300x168.jpeg 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-3-1024x575.jpeg 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-3-768x431.jpeg 768w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-3-1536x862.jpeg 1536w\" sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/p>\n<p>The command will confirm that the Apache2 Server has<strong> loaded, enabled, <\/strong>and is <strong>active<\/strong> (running). Type the below-mentioned command and start the server if the server is not active:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">sudo<\/span> systemctl start apache2<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"305\" class=\"wp-image-20566\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-4.jpeg\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-4.jpeg 2048w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-4-300x45.jpeg 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-4-1024x153.jpeg 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-4-768x114.jpeg 768w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-4-1536x229.jpeg 1536w\" sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/p>\n<p>The above-mentioned command will activate the Apache Server. To stop the Server&#8217;s active state, type the following command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">sudo<\/span> systemctl stop apache2<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"301\" class=\"wp-image-20567\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-5.jpeg\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-5.jpeg 2048w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-5-300x44.jpeg 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-5-1024x151.jpeg 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-5-768x113.jpeg 768w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-5-1536x226.jpeg 1536w\" sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/p>\n<p>If you want to interact with <strong>Apache Server<\/strong> for managing any task, open your <strong>Web Browser<\/strong> and type localhost in the search bar. It will open the following window:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"1094\" class=\"wp-image-20568\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-6.jpeg\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-6.jpeg 2048w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-6-300x160.jpeg 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-6-1024x547.jpeg 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-6-768x410.jpeg 768w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-6-1536x821.jpeg 1536w\" sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>From here you can interact with the Apache server.<\/p>\n<h2><strong>How to Uninstall Apache2<\/strong><\/h2>\n<p>If you have no need to use Apache2 on a regular basis, you can uninstall it by using the \u201c<strong>sudo apt remove apache2 -y<\/strong>\u201d command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">sudo<\/span> apt remove apache2 <span class=\"re5\">-y<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"381\" class=\"wp-image-20569\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-7.jpeg\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-7.jpeg 2048w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-7-300x56.jpeg 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-7-1024x191.jpeg 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-7-768x143.jpeg 768w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-7-1536x286.jpeg 1536w\" sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/p>\n<p>The command will remove Apache2 from the system. Remove all the files associated with the Apache server, by using the following command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">sudo<\/span> apt autoremove <span class=\"re5\">-y<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"358\" class=\"wp-image-20570\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-8.jpeg\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-8.jpeg 2048w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-8-300x52.jpeg 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-8-1024x179.jpeg 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-8-768x134.jpeg 768w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20562-8-1536x269.jpeg 1536w\" sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/p>\n<p>The command will delete all the files of the Apache web server.<\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>To install Apache on Debian 12, open the terminal, update existing packages, and execute the \u201csudo apt install apache2 -y\u201d command. Users can confirm the Apache\u2019s installation by executing the \u201csudo systemctl status apache2\u201d command. The server can be managed through the terminal by the use of <strong>systemctl <\/strong>utility. This article has presented a series of steps on how you can install the Apache Web server using a terminal.<\/p>","protected":false},"excerpt":{"rendered":"<p>To install Apache on Debian 12, launch the terminal, update system packages, and execute the \u201csudo apt install apache2 -y\u201d command.<\/p>","protected":false},"author":110,"featured_media":20571,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-20562","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-debian"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/20562","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/110"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=20562"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/20562\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/20571"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=20562"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=20562"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=20562"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}