{"id":3930,"date":"2023-09-22T12:56:31","date_gmt":"2023-09-22T09:56:31","guid":{"rendered":"https:\/\/www.virtono.com\/community\/?p=3930"},"modified":"2023-09-22T12:56:48","modified_gmt":"2023-09-22T09:56:48","slug":"how-to-install-apache-on-almalinux-9-2","status":"publish","type":"post","link":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-apache-on-almalinux-9-2\/","title":{"rendered":"How to Install Apache on AlmaLinux 9.2"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"422\" data-attachment-id=\"3935\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-apache-on-almalinux-9-2\/attachment\/install-apache-on-almalinux-9-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Install-Apache-on-AlmaLinux-9.2.png?fit=1920%2C1080&amp;ssl=1\" data-orig-size=\"1920,1080\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Install-Apache-on-AlmaLinux-9.2\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Install-Apache-on-AlmaLinux-9.2.png?fit=750%2C422&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Install-Apache-on-AlmaLinux-9.2.png?resize=750%2C422&#038;ssl=1\" alt=\"How to Install Apache on AlmaLinux 9.2\" class=\"wp-image-3935\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Install-Apache-on-AlmaLinux-9.2.png?resize=1024%2C576&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Install-Apache-on-AlmaLinux-9.2.png?resize=300%2C169&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Install-Apache-on-AlmaLinux-9.2.png?resize=768%2C432&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Install-Apache-on-AlmaLinux-9.2.png?resize=1536%2C864&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Install-Apache-on-AlmaLinux-9.2.png?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This guide will walk you through setting up virtual hosts to run multiple websites on a single server and installing Apache on AlmaLinux 9.2. Whether you&#8217;re running a personal blog, a small business website, or a complex web application, having a robust web server is essential. Apache, one of the most popular and reliable web servers available, can help you achieve this.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_73 counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-apache-on-almalinux-9-2\/#Requirements\" title=\"Requirements\">Requirements<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-apache-on-almalinux-9-2\/#Installing_Apache_on_AlmaLinux_92\" title=\"Installing Apache on AlmaLinux 9.2\">Installing Apache on AlmaLinux 9.2<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-apache-on-almalinux-9-2\/#Step_1_Update_the_System\" title=\"Step 1: Update the System\">Step 1: Update the System<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-apache-on-almalinux-9-2\/#Step_2_Install_Apache_on_AlmaLinux_92\" title=\"Step 2: Install Apache on AlmaLinux 9.2\">Step 2: Install Apache on AlmaLinux 9.2<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-apache-on-almalinux-9-2\/#Step_3_Start_and_Enable_Apache\" title=\"Step 3: Start and Enable Apache\">Step 3: Start and Enable Apache<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-apache-on-almalinux-9-2\/#Step_4_Configure_the_Firewall\" title=\"Step 4: Configure the Firewall\">Step 4: Configure the Firewall<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-apache-on-almalinux-9-2\/#Step_5_Verify_Apache_Installation\" title=\"Step 5: Verify Apache Installation\">Step 5: Verify Apache Installation<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-apache-on-almalinux-9-2\/#Configuring_Virtual_Hosts\" title=\"Configuring Virtual Hosts\">Configuring Virtual Hosts<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-apache-on-almalinux-9-2\/#Step_1_Create_a_Directory_Structure\" title=\"Step 1: Create a Directory Structure\">Step 1: Create a Directory Structure<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-apache-on-almalinux-9-2\/#Step_2_Set_Permissions\" title=\"Step 2: Set Permissions\">Step 2: Set Permissions<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-apache-on-almalinux-9-2\/#Step_3_Create_Virtual_Host_Configuration_Files\" title=\"Step 3: Create Virtual Host Configuration Files\">Step 3: Create Virtual Host Configuration Files<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-apache-on-almalinux-9-2\/#Final_Thoughts\" title=\"Final Thoughts\">Final Thoughts<\/a><\/li><\/ul><\/nav><\/div>\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Requirements\"><\/span><strong>Requirements<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s make sure you have everything you need before we start the installation process:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong><a href=\"https:\/\/virtono.com\/cloud-vps\" target=\"_blank\" rel=\"noopener\">AlmaLinux 9.2 Virtono Server<\/a><\/strong>: Make sure you have AlmaLinux 9.2 installed on your server. If not, you can download it from the official AlmaLinux website.<\/li>\n\n\n\n<li><strong>Root or Sudo Access<\/strong>: You&#8217;ll need root or sudo access to execute commands with administrative privileges.<\/li>\n\n\n\n<li><strong>Basic Command Line Skills<\/strong>: Familiarity with the Linux command line will be helpful.<\/li>\n\n\n\n<li><strong><a href=\"https:\/\/www.virtono.com\/cart.php?a=add&amp;domain=register\">Domain or Subdomains<\/a><\/strong>: Decide on the domain names or subdomains you want to host on your server.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Installing_Apache_on_AlmaLinux_92\"><\/span><strong>Installing Apache on AlmaLinux 9.2<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To get started, log in to your AlmaLinux server and follow these steps:<\/p>\n\n\n\n<h4 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_1_Update_the_System\"><\/span><strong>Step 1: Update the System<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Update your system&#8217;s package repositories and upgrade any existing packages before installing Apache. Run the following commands:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo dnf update<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This will ensure that your system is up to date with the latest security patches and software updates.<\/p>\n\n\n\n<h4 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_2_Install_Apache_on_AlmaLinux_92\"><\/span><strong>Step 2: Install Apache<\/strong> <strong>on AlmaLinux 9.2<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">To install Apache on AlmaLinux 9.2, use the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo dnf install httpd<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After entering this command, the system will prompt you to confirm the installation. Type &#8216;y&#8217; and press Enter to proceed. AlmaLinux will then download and install Apache on your server.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"264\" data-attachment-id=\"3931\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-apache-on-almalinux-9-2\/attachment\/screenshot-2023-09-22-at-12-02-20\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-22-at-12.02.20.png?fit=2844%2C1004&amp;ssl=1\" data-orig-size=\"2844,1004\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot-2023-09-22-at-12.02.20\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-22-at-12.02.20.png?fit=750%2C264&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-22-at-12.02.20.png?resize=750%2C264&#038;ssl=1\" alt=\"How to Install Apache on AlmaLinux 9.2\" class=\"wp-image-3931\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-22-at-12.02.20.png?resize=1024%2C361&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-22-at-12.02.20.png?resize=300%2C106&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-22-at-12.02.20.png?resize=768%2C271&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-22-at-12.02.20.png?resize=1536%2C542&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-22-at-12.02.20.png?resize=2048%2C723&amp;ssl=1 2048w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-22-at-12.02.20.png?w=2250&amp;ssl=1 2250w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h4 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_3_Start_and_Enable_Apache\"><\/span><strong>Step 3: Start and Enable Apache<\/strong> <span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Once the installation is complete, start the Apache on AlmaLinux 9.2 service and enable it to start automatically at boot:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo systemctl start httpd\nsudo systemctl enable httpd\nsudo systemctl status httpd<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"281\" data-attachment-id=\"3932\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-apache-on-almalinux-9-2\/attachment\/screenshot-2023-09-22-at-12-04-50\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-22-at-12.04.50.png?fit=2484%2C930&amp;ssl=1\" data-orig-size=\"2484,930\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot-2023-09-22-at-12.04.50\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-22-at-12.04.50.png?fit=750%2C281&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-22-at-12.04.50.png?resize=750%2C281&#038;ssl=1\" alt=\"Start and Enable Apache on AlmaLinux 9.2\" class=\"wp-image-3932\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-22-at-12.04.50.png?resize=1024%2C383&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-22-at-12.04.50.png?resize=300%2C112&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-22-at-12.04.50.png?resize=768%2C288&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-22-at-12.04.50.png?resize=1536%2C575&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-22-at-12.04.50.png?resize=2048%2C767&amp;ssl=1 2048w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-22-at-12.04.50.png?w=2250&amp;ssl=1 2250w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h4 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_4_Configure_the_Firewall\"><\/span><strong>Step 4: Configure the Firewall<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">You must permit HTTP traffic to pass through your server&#8217;s firewall if it is enabled. Use the following command to do this:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo firewall-cmd --permanent --add-service=http\nsudo firewall-cmd --reload<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h4 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_5_Verify_Apache_Installation\"><\/span><strong>Step 5: Verify Apache Installation<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Open a web browser and type the IP address or domain name of your server to check that Apache on AlmaLinux 9.2 is operational. The Apache default page should appear, indicating a successful installation.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"231\" data-attachment-id=\"3933\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-apache-on-almalinux-9-2\/attachment\/screenshot-2023-09-22-at-12-07-44\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-22-at-12.07.44.png?fit=2748%2C844&amp;ssl=1\" data-orig-size=\"2748,844\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot-2023-09-22-at-12.07.44\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-22-at-12.07.44.png?fit=750%2C231&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-22-at-12.07.44.png?resize=750%2C231&#038;ssl=1\" alt=\"Install Apache on AlmaLinux\" class=\"wp-image-3933\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-22-at-12.07.44.png?resize=1024%2C315&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-22-at-12.07.44.png?resize=300%2C92&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-22-at-12.07.44.png?resize=768%2C236&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-22-at-12.07.44.png?resize=1536%2C472&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-22-at-12.07.44.png?resize=2048%2C629&amp;ssl=1 2048w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/Screenshot-2023-09-22-at-12.07.44.png?w=2250&amp;ssl=1 2250w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Configuring_Virtual_Hosts\"><\/span><strong>Configuring Virtual Hosts<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Now that Apache is installed let&#8217;s configure virtual hosts to host multiple websites on a single server.<\/p>\n\n\n\n<h4 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_1_Create_a_Directory_Structure\"><\/span><strong>Step 1: Create a Directory Structure<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">It&#8217;s a good practice to create a directory structure for your virtual hosts. This will help keep your configuration organized. For example, you can create a directory for each website under the <code>\/var\/www<\/code> directory:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo mkdir -p \/var\/www\/example.com\/public_html\nsudo mkdir -p \/var\/www\/anotherdomain.com\/public_html<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Replace <code>example.com<\/code> and <code>anotherdomain.com<\/code> with your actual domain names.<\/p>\n\n\n\n<h4 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_2_Set_Permissions\"><\/span><strong>Step 2: Set Permissions<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Set the proper permissions to make sure Apache can serve files from these directories:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo chown -R apache:apache \/var\/www\/example.com<br>sudo chown -R apache:apache \/var\/www\/anotherdomain.com<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_3_Create_Virtual_Host_Configuration_Files\"><\/span><strong>Step 3: Create Virtual Host Configuration Files<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">To manage virtual hosts, Apache uses configuration files. Each virtual host can have its own configuration file. Create a configuration file, for example.com:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo nano \/etc\/httpd\/conf.d\/example.com.conf<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Add the following details to the configuration file:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>&lt;VirtualHost *:80&gt;\n    ServerAdmin webmaster@example.com\n    ServerName example.com\n    DocumentRoot \/var\/www\/example.com\/public_html\n    ErrorLog \/var\/log\/httpd\/example.com_error.log\n    CustomLog \/var\/log\/httpd\/example.com_access.log combined\n&lt;\/VirtualHost&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This configuration tells Apache to serve files from the <code>\/var\/www\/example.com\/public_html<\/code> directory when a request comes in for <code>example.com<\/code>. Don&#8217;t forget to replace <code>example.com<\/code> with your actual domain name.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After creating or modifying the virtual host configuration, restart Apache to apply the changes:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code><code>sudo systemctl restart httpd<\/code><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Final_Thoughts\"><\/span>Final Thoughts<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This tutorial has shown you how to install Apache on AlmaLinux 9.2 and set up virtual hosts to host multiple websites. This configuration makes hosting multiple web projects cost-effective because it enables you to effectively manage and serve multiple websites from a single server. To keep your websites secure and functioning properly, keep your server&#8217;s security updated and maintained on a regular basis. With Apache and AlmaLinux, you&#8217;re well on your way to creating a powerful and versatile web hosting environment.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This guide will walk you through setting up virtual hosts to run multiple websites on a single server and installing Apache on AlmaLinux 9.2. Whether you&#8217;re running a personal blog, a small business website, or a complex web application, having a robust web server is essential. Apache, one of the<\/p>\n","protected":false},"author":8,"featured_media":3936,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[3],"tags":[403,402,404,187,401],"class_list":["post-3930","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorial-how-to","tag-apache-almalinux","tag-apache-on-almalinux","tag-apache-on-almalinux-9-1","tag-install-apache","tag-install-apache-on-almalinux"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/How-to-Install-Apache-on-AlmaLinux-9.2.png?fit=360%2C240&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7ISfL-11o","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":3385,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-apache-on-almalinux-9-1\/","url_meta":{"origin":3930,"position":0},"title":"How to Install Apache on AlmaLinux 9.1","author":"George B.","date":"May 24, 2023","format":false,"excerpt":"In this step-by-step guide, we will walk you through the process of installing Apache on AlmaLinux 9.1. Additionally, we will explore how to configure virtual hosts, which allow you to host multiple websites on a single Apache installation. Apache is a widely-used and highly popular web server that powers a\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/Coding-Channel.png?fit=600%2C330&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/Coding-Channel.png?fit=600%2C330&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/Coding-Channel.png?fit=600%2C330&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":3947,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-configserver-security-firewall-csf-on-almalinux\/","url_meta":{"origin":3930,"position":1},"title":"How to install ConfigServer Security &#038; Firewall -CSF on Almalinux","author":"George B.","date":"September 28, 2023","format":false,"excerpt":"In this guide, we will walk you through the step-by-step process of installing CSF on AlmaLinux, ensuring that your system is fortified against potential threats. Every system administrator has a responsibility to protect their server from potential attacks and vulnerabilities. ConfigServer Security & Firewall (CSF) is a strong tool that\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/How-to-install-CSF-on-Almalinux.png?fit=360%2C240&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3210,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-plesk-on-almalinux-and-rocky\/","url_meta":{"origin":3930,"position":2},"title":"How to Install Plesk on Almalinux and Rocky","author":"George B.","date":"April 10, 2023","format":false,"excerpt":"Let's first understand what Plesk is and what it can be used before we dive into the guide on how to install Plesk. Plesk is a commercial web hosting control panel software that enables server administrators to manage web hosting accounts and websites from a single graphical interface. It was\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/How-to-Install-Plesk-on-Almalinux-and-Rocky.png?fit=600%2C330&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/How-to-Install-Plesk-on-Almalinux-and-Rocky.png?fit=600%2C330&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/How-to-Install-Plesk-on-Almalinux-and-Rocky.png?fit=600%2C330&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":3420,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-tensorflow-on-linux\/","url_meta":{"origin":3930,"position":3},"title":"How to Install TensorFlow On Linux","author":"George B.","date":"May 29, 2023","format":false,"excerpt":"Whether you're an aspiring data scientist or a seasoned professional, knowing how to install TensorFlow on Linux distribution is crucial. In this tutorial, we will guide you through the installation process on popular Linux distributions such as CentOS, Ubuntu, AlmaLinux, and Rocky Linux. TensorFlow is a versatile and powerful open-source\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/How-to-Install-TensorFlow-On-Linux.png?fit=600%2C330&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/How-to-Install-TensorFlow-On-Linux.png?fit=600%2C330&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/How-to-Install-TensorFlow-On-Linux.png?fit=600%2C330&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":143,"url":"https:\/\/www.virtono.com\/community\/knowledgebase\/difference-between-apache-http-and-apache-tomcat\/","url_meta":{"origin":3930,"position":4},"title":"Difference between Apache http and Apache Tomcat","author":"Daniel Draga","date":"July 23, 2016","format":false,"excerpt":"This article is part of series of articles on Apache. Here is the list: Introduction to Apache Web Server. Difference between Apache http and Apache Tomcat.(this one) How to Install and Run Apache Web Server on Ubuntu Linux How to Install and Run Apache Web Server on Windows 10. Original\u2026","rel":"","context":"In &quot;Knowledgebase&quot;","block_context":{"text":"Knowledgebase","link":"https:\/\/www.virtono.com\/community\/category\/knowledgebase\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/07\/apache-tomcat.png?fit=208%2C207&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":147,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-and-run-apache-web-server-on-ubuntu-linux-os\/","url_meta":{"origin":3930,"position":5},"title":"How to Install and Run Apache Web Server on Linux OS","author":"Daniel Draga","date":"July 23, 2016","format":false,"excerpt":"This article is part of series of articles on Apache. Here is the list: Introduction to Apache Web Server. Difference between Apache http and Apache Tomcat. How to Install and Run Apache Web Server on Ubuntu Linux.(this one) How to Install and Run Apache Web Server on Windows 10. Original\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/07\/CfXJWnZUsAACtrg2.png?fit=470%2C245&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/3930","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/comments?post=3930"}],"version-history":[{"count":2,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/3930\/revisions"}],"predecessor-version":[{"id":3937,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/3930\/revisions\/3937"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/media\/3936"}],"wp:attachment":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/media?parent=3930"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/categories?post=3930"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/tags?post=3930"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}