{"id":4056,"date":"2022-10-10T11:01:32","date_gmt":"2022-10-10T11:01:32","guid":{"rendered":"https:\/\/arzhost.com\/blogs\/?p=4056"},"modified":"2023-10-04T14:39:49","modified_gmt":"2023-10-04T14:39:49","slug":"centos-7-apache-start","status":"publish","type":"post","link":"https:\/\/arzhost.com\/blogs\/centos-7-apache-start\/","title":{"rendered":"Step-by-Step Guide Centos 7 Apache Start"},"content":{"rendered":"<p>This guide will explain how to install Apache, a totally free, open-source, and wildly popular web server, on <span style=\"color: #0000ff;\"><strong><a style=\"color: #0000ff;\" href=\"https:\/\/arzhost.com\/blogs\/centos-7-apache-start\/\">Centos 7 Apache Start<\/a><\/strong><\/span>. This setup will make it possible to test websites that are provided by the Apache web server.<\/p>\n<ol>\n<li>On CentOS 7, set up a non-root user with sudo rights.<\/li>\n<li>A CentOS 7 server update<\/li>\n<li>Set up a fundamental firewall in CentOS 7<\/li>\n<\/ol>\n<p><iframe title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/tOVLav3kTSQ\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_74 counter-hierarchy ez-toc-counter ez-toc-grey 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-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/arzhost.com\/blogs\/centos-7-apache-start\/#Step_1_upgrade_the_server\" >Step 1: upgrade the server.<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/arzhost.com\/blogs\/centos-7-apache-start\/#Step_2_Set_up_a_fundamental_firewall\" >Step 2: Set up a fundamental firewall<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/arzhost.com\/blogs\/centos-7-apache-start\/#Step_3_Install_Apache_and_set_up_the_firewall\" >Step 3: Install Apache and set up the firewall<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/arzhost.com\/blogs\/centos-7-apache-start\/#Step_4_Verify_that_Apache_is_active\" >Step 4: Verify that Apache is active.<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/arzhost.com\/blogs\/centos-7-apache-start\/#Step_5_Verify_Apache_is_operating_correctly\" >Step 5: Verify Apache is operating correctly.<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Step_1_upgrade_the_server\"><\/span><strong>Step 1: upgrade the server.<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><u>Run the following command to upgrade the <a href=\"https:\/\/en.wikipedia.org\/wiki\/CentOS\" target=\"_blank\" rel=\"noopener\">Centos<\/a> 7 Apache Start server:<\/u><\/p>\n<ul>\n<li><code>yum update $<\/code><\/li>\n<\/ul>\n<p><a href=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/update-the-server.png\"><img fetchpriority=\"high\" decoding=\"async\" title=\"update the server\" class=\"wp-image-4066 \" src=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/update-the-server.png\" alt=\"update the server\" width=\"801\" height=\"327\" srcset=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/update-the-server.png 720w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/update-the-server-300x123.png 300w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/update-the-server-640x261.png 640w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/update-the-server-400x163.png 400w\" sizes=\"(max-width: 801px) 100vw, 801px\" \/><\/a><\/p>\n<p>This command will guarantee that all software is current and running the most recent versions. It should just take a few minutes to complete. When you see the following output in the terminal, the updates are finished:<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Step_2_Set_up_a_fundamental_firewall\"><\/span><strong>Step 2: Set up a fundamental firewall<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><u>This action enables Apache to send traffic across the Internet. To install the firewall, enter the command listed below.<\/u><\/p>\n<ul>\n<li><code>Install firewalld with sudo yum.<\/code><\/li>\n<\/ul>\n<p><u>The user will be prompted for a password and permission to install relevant packages after entering this command and pressing &#8220;Enter&#8221;.<\/u><\/p>\n<p><a href=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/confirm-appache-is-running.png\"><img decoding=\"async\" title=\"confirm appache is running\" class=\"wp-image-4067 \" src=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/confirm-appache-is-running.png\" alt=\"confirm appache is running\" width=\"806\" height=\"357\" srcset=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/confirm-appache-is-running.png 720w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/confirm-appache-is-running-300x133.png 300w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/confirm-appache-is-running-640x284.png 640w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/confirm-appache-is-running-400x177.png 400w\" sizes=\"(max-width: 806px) 100vw, 806px\" \/><\/a><\/p>\n<p><u>The installation is complete when the screen says &#8220;Complete!&#8221; Run the following command to enable the firewall next:<\/u><\/p>\n<ul>\n<li><code>systemctl enable firewalld with sudo<\/code><\/li>\n<\/ul>\n<p><u>Run the following command to launch the firewall:<\/u><\/p>\n<ul>\n<li><code>systemctl start firewalld with sudo<\/code><\/li>\n<\/ul>\n<p><u>Run a status check on the firewall using the following command to make sure it&#8217;s functioning properly:<\/u><\/p>\n<ul>\n<li><code>systemctl status firewalld with sudo<\/code><\/li>\n<\/ul>\n<p><u>The firewall should be listed as &#8220;active (operating)&#8221; in the output.<\/u><\/p>\n<p><a href=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/firewall.png\"><img decoding=\"async\" title=\"firewall\" class=\"wp-image-4068 \" src=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/firewall.png\" alt=\"firewall\" width=\"808\" height=\"185\" srcset=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/firewall.png 720w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/firewall-300x69.png 300w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/firewall-640x147.png 640w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/firewall-400x92.png 400w\" sizes=\"(max-width: 808px) 100vw, 808px\" \/><\/a><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Step_3_Install_Apache_and_set_up_the_firewall\"><\/span><strong>Step 3: Install Apache and set up the firewall <\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><u>To install the web server, start by using the following command:<\/u><\/p>\n<ul>\n<li><code>Yum install httpd with sudo<\/code><\/li>\n<\/ul>\n<p><u>Once finished, use the following commands to set up the firewall to allow traffic to pass through HTTP (port 80) and HTTPS (port 443) by default:<\/u><\/p>\n<ul>\n<li><code>the command line firewall-cmd \u2014permanent \u2014add-service=http<\/code><\/li>\n<li><code>$ Run firewall-cmd with the permanent and add-service options.<\/code><\/li>\n<\/ul>\n<p><u>After each entry, hitting &#8220;Enter&#8221; ought to result in &#8220;success&#8221;. The user needs to perform a reload using the following command for the modifications to take effect:<\/u><\/p>\n<ul>\n<li><code>firewall-cmd \u2014reload in sudo<\/code><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Step_4_Verify_that_Apache_is_active\"><\/span><strong>Step 4: Verify that Apache is active.<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><u>After refreshing the firewall and getting &#8220;success&#8221;, use the commands below to start Apache and verify that it is &#8220;active (running)&#8221;:<\/u><\/p>\n<ul>\n<li><code>Systemctl start httpd with sudo<\/code><\/li>\n<li><code>systemctl status httpd $<\/code><\/li>\n<\/ul>\n<p><u>The output will be as follows:<\/u><\/p>\n<p><a href=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/install-a-basic-firewall.png\"><img loading=\"lazy\" decoding=\"async\" title=\"install a basic firewall\" class=\"wp-image-4069 \" src=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/install-a-basic-firewall.png\" alt=\"install a basic firewall\" width=\"838\" height=\"208\" srcset=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/install-a-basic-firewall.png 720w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/install-a-basic-firewall-300x75.png 300w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/install-a-basic-firewall-640x159.png 640w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/install-a-basic-firewall-400x99.png 400w\" sizes=\"(max-width: 838px) 100vw, 838px\" \/><\/a><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Step_5_Verify_Apache_is_operating_correctly\"><\/span><strong>Step 5: Verify Apache is operating correctly.<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Find the user&#8217;s public IP address using this command to check the connectivity of the Centos 7 Apache Start server:<\/p>\n<ul>\n<li><code>curl ifconfig. me with sudo.<\/code><\/li>\n<\/ul>\n<p><u>The next line of the report should show the public IP address.<\/u><\/p>\n<p><a href=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/appache-is-working-properly.png\"><img loading=\"lazy\" decoding=\"async\" title=\"appache is working properly\" class=\"wp-image-4070 \" src=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/appache-is-working-properly.png\" alt=\"appache is working properly\" width=\"804\" height=\"96\" srcset=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/appache-is-working-properly.png 720w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/appache-is-working-properly-300x36.png 300w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/appache-is-working-properly-640x76.png 640w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/appache-is-working-properly-400x48.png 400w\" sizes=\"(max-width: 804px) 100vw, 804px\" \/><\/a><\/p>\n<p>Copy the IP address, then test it in the browser&#8217;s search box by typing http:\/\/your server. Public ip. The installation was successful after the test page appeared!<\/p>\n<p><strong>Related Article\u00a0<\/strong><\/p>\n<p><span style=\"color: #0000ff;\"><a style=\"color: #0000ff;\" href=\"https:\/\/arzhost.com\/blogs\/restart-web-server-centos\/\">restart web server centos<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This guide will explain how to install Apache, a totally free, open-source, and wildly popular web server, on Centos 7 Apache Start. This setup will make it possible to test websites that are provided by the Apache web server. On CentOS 7, set up a non-root user with sudo rights. A CentOS 7 server update [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":6350,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26,69],"tags":[],"table_tags":[],"class_list":["post-4056","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","category-software"],"_links":{"self":[{"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/posts\/4056","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/comments?post=4056"}],"version-history":[{"count":8,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/posts\/4056\/revisions"}],"predecessor-version":[{"id":6351,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/posts\/4056\/revisions\/6351"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/media\/6350"}],"wp:attachment":[{"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/media?parent=4056"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/categories?post=4056"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/tags?post=4056"},{"taxonomy":"table_tags","embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/table_tags?post=4056"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}