{"id":4247,"date":"2022-07-18T10:54:51","date_gmt":"2022-07-18T17:54:51","guid":{"rendered":"https:\/\/SUMMALAI.COM\/?p=4247"},"modified":"2022-07-18T10:54:52","modified_gmt":"2022-07-18T17:54:52","slug":"how-to-install-apache-on-centos-9-stream","status":"publish","type":"post","link":"https:\/\/SUMMALAI.COM\/?p=4247","title":{"rendered":"How to Install Apache on CentOS 9 Stream"},"content":{"rendered":"\n<p>In this tutorial, we will show you how to install Apache in the sequence of<a href=\"https:\/\/codepre.com\/en\/tips\/centos\/\">&nbsp;CentOS&nbsp;<\/a>9. For those of you who didn&#8217;t know, Apache aka Apache HTTP Server is a free, open source, cross-platform HTTP server that includes powerful features and can be extended with a wide variety of modules. It is part of the LAMP (Linux, ApacheMySQL, PHP) stack that powers much of the Internet.<\/p>\n\n\n\n<p>This article assumes that you have at least a basic understanding of Linux, know how to use the shell, and most importantly, host your site on your own VPS. Installation is pretty simple and assumes you are running under the root account, if not you may need to add &#8216;<code>&nbsp;sudo&nbsp;<\/code>&#8216; to the commands to gain root privileges. I will show you the step by step installation of the Apache web server on CentOS 9 Stream.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Install on pc Apache on streaming CentOS 9<\/h2>\n\n\n\n<p>Step 1. First, let&#8217;s start by making sure your system is up to date.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo dnf update                    <\/pre>\n\n\n\n<p>Step 2. Installing Apache on the CentOS 9 stream.<\/p>\n\n\n\n<p>By default, Apache is available in the CentOS 9 Stream base repository. Now we run the following command to install Apache HTTP Server to your system:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo dnf install httpd httpd-tools\nsudo dnf install mod_ssl<\/pre>\n\n\n\n<p>Once the installation is complete, now enable Apache (to start automatically at system boot), start the web server and check the status with the following commands:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo systemctl start httpd\nsudo systemctl enable httpd\nsudo systemctl status httpd                  <\/pre>\n\n\n\n<p>To check the Apache version, use the following command to confirm:<\/p>\n\n\n\n<p>httpd -v                     <\/p>\n\n\n\n<p>Step 3. Configure the firewall.<\/p>\n\n\n\n<p>If your server is protected by the firewall and you have not opened the HTTP and HTTPS ports. Enable them with the following command below:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo firewall-cmd --permanent --zone=public --add-service=http \nsudo firewall-cmd --permanent --zone=public --add-service=https\nsudo firewall-cmd --reload                    <\/pre>\n\n\n\n<p>Step 4. Verify Apache Installation.<\/p>\n\n\n\n<p>Once successfully installed, open your favorite web browser and enter the URL<code>&nbsp;https:\/\/your-IP-address&nbsp;<\/code>and you will see the default Apache HTTP Server Welcome Page as shown in the following image:<\/p>\n\n\n\n<p>Step 5. Apache Configuration File Structure.<\/p>\n\n\n\n<p>You need to know the location of the configuration files and the Apache root directory in case you need to modify the configuration:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>All Apache configuration files are located in the<code>&nbsp;\/etc\/httpd&nbsp;<\/code>directory.<\/li><li>The main Apache configuration file is<code>&nbsp;\/etc\/httpd\/conf\/httpd.conf&nbsp;<\/code>.<\/li><li>Configuration files ending in<code>&nbsp;.conf&nbsp;<\/code>Located in the<code>&nbsp;\/etc\/httpd\/conf.d&nbsp;<\/code>the directory is included in the main Apache configuration file.<\/li><li>Configuration files that are responsible for loading various Apache modules are located in the<code>&nbsp;\/etc\/httpd\/conf.modules.d&nbsp;<\/code>directory.<\/li><li>Apache vhost files must end with<code>&nbsp;.conf&nbsp;<\/code>and be stored in<code>&nbsp;\/etc\/httpd\/conf.d&nbsp;<\/code>directory. You can have as many vhosts as you need. Creating a separate configuration file (vhost) for each domain makes server maintenance easier.<\/li><\/ul>\n\n\n\n<p>Ref: https:\/\/codepre.com\/en\/como-instalar-apache-en-la-transmision-de-centos-9.html<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we will show you how to install Apache in the sequence of&nbsp;CentOS&nbsp;9. For those of you who didn&#8217;t know, Apache aka Apache HTTP Server is a free, open source, cross-platform HTTP server that includes powerful features and can be extended with a wide variety of modules. It is part of the LAMP <a class=\"read-more\" href=\"https:\/\/SUMMALAI.COM\/?p=4247\">Read More<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[104,262,5,178],"tags":[1242,1241],"class_list":["post-4247","post","type-post","status-publish","format-standard","hentry","category-apache","category-centos","category-linux","category-wordpress","tag-install-apache-on-centos-9","tag-install-apache-on-centos-9-stream"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/4247","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4247"}],"version-history":[{"count":2,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/4247\/revisions"}],"predecessor-version":[{"id":4249,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/4247\/revisions\/4249"}],"wp:attachment":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4247"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4247"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4247"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}