{"id":15,"date":"2021-10-27T11:42:55","date_gmt":"2021-10-27T11:42:55","guid":{"rendered":"http:\/\/host2day.in\/blog\/?p=15"},"modified":"2021-10-28T06:58:31","modified_gmt":"2021-10-28T06:58:31","slug":"how-to-install-apache-server-on-cent-os","status":"publish","type":"post","link":"https:\/\/host2day.in\/blog\/how-to-install-apache-server-on-cent-os\/","title":{"rendered":"How to? Install Apache Server on CentOS&#8230;"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">What is Apache Server<\/h2>\n\n\n\n<p>Apache Server provides secure, efficient and extensible server that provides HTTP services.<\/p>\n\n\n\n<p>Apache Server is available in Cent OS repository.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo yum update httpd<\/code><\/pre>\n\n\n\n<p>Once packages are up-to date<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo yum install httpd -y<\/code><\/pre>\n\n\n\n<p>Once apache is installed, it is time to open the port 80 to allow apache server request over HTTP.<\/p>\n\n\n\n<p>To allow apache server request over HTTPS  open port 443 by enabling https service.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo firewall-cmd --permanent --add-service=http\nsudo firewall-cmd --permanent --add-service=https<\/code><\/pre>\n\n\n\n<p>Now reload the services<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo firewall-cmd --reload\nsudo systemctl start httpd\nsudo systemctl enable httpd\nsudo systemctl status httpd<\/code><\/pre>\n\n\n\n<p>That is it. Apache is successfully installed and services are allowed in firewall.<\/p>\n\n\n\n<p>Confirm the same by landing the Apache default page in a Webpage. First find your system local IP address in which Apache is configured.<\/p>\n\n\n\n<p>Use the following command,<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>hostname -I<\/code><\/pre>\n\n\n\n<p>If multiple IP addresses are displayed try them in different pages in your browser.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>http:&#47;&#47;your_local_server_ip<\/code><\/pre>\n\n\n\n<p>You should see the below default Apache Webpage:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"585\" src=\"http:\/\/host2day.in\/blog\/wp-content\/uploads\/2021\/09\/apache-test-page-1024x585.png\" alt=\"\" class=\"wp-image-83\" srcset=\"https:\/\/host2day.in\/blog\/wp-content\/uploads\/2021\/09\/apache-test-page-1024x585.png 1024w, https:\/\/host2day.in\/blog\/wp-content\/uploads\/2021\/09\/apache-test-page-300x171.png 300w, https:\/\/host2day.in\/blog\/wp-content\/uploads\/2021\/09\/apache-test-page-768x439.png 768w, https:\/\/host2day.in\/blog\/wp-content\/uploads\/2021\/09\/apache-test-page-816x466.png 816w, https:\/\/host2day.in\/blog\/wp-content\/uploads\/2021\/09\/apache-test-page.png 1345w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>That is it, Apache has been configured successfully in your server&#8230;<\/p>\n\n\n\n<p>Additional httpd service commands are,<\/p>\n\n\n\n<p>Check Apache status,<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl status httpd<\/code><\/pre>\n\n\n\n<p>Stop Apache Webs Server<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl stop httpd<\/code><\/pre>\n\n\n\n<p>Start Apache Webs Server<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl start httpd<\/code><\/pre>\n\n\n\n<p>Restart Apache Webs Server <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl restart httpd<\/code><\/pre>\n\n\n\n<p>Reload Apache Webs Server <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl reload httpd<\/code><\/pre>\n\n\n\n<p>Disable Apache Webs Server <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl disable httpd<\/code><\/pre>\n\n\n\n<p>Enable Apache Webs Server <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl enable httpd<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>What is Apache Server Apache Server provides secure, efficient and extensible server that provides HTTP services. Apache Server is available in Cent OS repository. Once packages are up-to date Once apache is installed, it is time to open the port 80 to allow apache server request over HTTP. To allow apache server request over HTTPS&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"categories":[4,10,9],"tags":[6,7,5,8],"class_list":["post-15","post","type-post","status-publish","format-standard","hentry","category-cent-os","category-lamp","category-linux","tag-apache","tag-apache-server","tag-cent-os","tag-lamp"],"_links":{"self":[{"href":"https:\/\/host2day.in\/blog\/wp-json\/wp\/v2\/posts\/15","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/host2day.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/host2day.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/host2day.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/host2day.in\/blog\/wp-json\/wp\/v2\/comments?post=15"}],"version-history":[{"count":18,"href":"https:\/\/host2day.in\/blog\/wp-json\/wp\/v2\/posts\/15\/revisions"}],"predecessor-version":[{"id":107,"href":"https:\/\/host2day.in\/blog\/wp-json\/wp\/v2\/posts\/15\/revisions\/107"}],"wp:attachment":[{"href":"https:\/\/host2day.in\/blog\/wp-json\/wp\/v2\/media?parent=15"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/host2day.in\/blog\/wp-json\/wp\/v2\/categories?post=15"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/host2day.in\/blog\/wp-json\/wp\/v2\/tags?post=15"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}