{"id":23986,"date":"2021-10-02T12:56:21","date_gmt":"2021-10-02T12:56:21","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=23986"},"modified":"2022-04-13T15:56:38","modified_gmt":"2022-04-13T15:56:38","slug":"installation-of-apache-http-web-server","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/installation-of-apache-http-web-server\/","title":{"rendered":"Installation Of Apache HTTP Web Server"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">How many ways you can install Apache?<\/h2>\n\n\n\n<p><strong>Installation Types<\/strong><br>1.Yum Based<br>2.RPM Based<br>3.Source code\/ Tar ball Based<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2021\/10\/ways-of-install-apache-server.png\" alt=\"\" class=\"wp-image-23987\" width=\"651\" height=\"397\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2021\/10\/ways-of-install-apache-server.png 646w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2021\/10\/ways-of-install-apache-server-300x183.png 300w\" sizes=\"auto, (max-width: 651px) 100vw, 651px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Apache install on Centos 7 (Yum Base)<\/h2>\n\n\n\n<p>1.Check OS version<\/p>\n\n\n\n<p><strong># cat \/etc\/*release<\/strong><\/p>\n\n\n\n<p>2.Install apache<\/p>\n\n\n\n<p><strong>#  yum install httpd httpd-devel<\/strong><\/p>\n\n\n\n<p>3.Start Service<\/p>\n\n\n\n<p><strong># systemctl start httpd<br># systemctl status httpd<\/strong><\/p>\n\n\n\n<p>4.Test URL<\/p>\n\n\n\n<p>Browse for <strong>http:\/\/ip-addr<\/strong> from web client system and same system<\/p>\n\n\n\n<p>5.Add firewall rules<\/p>\n\n\n\n<p><strong># Firewall-cmd \u2013add-port=80\/tcp \u2013permanent<br># Firewall-cmd \u2013add-port=80\/udp \u2013permanent<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Apache install on Centos 7 (Tar ball Base)<\/h2>\n\n\n\n<p>1.Check OS version<\/p>\n\n\n\n<p><strong># cat \/etc\/*release<\/strong><\/p>\n\n\n\n<p>2.Install compilation tools<\/p>\n\n\n\n<p><strong># yum groupinstall &#8216;development tools&#8217;<\/strong><\/p>\n\n\n\n<p>3.Download dependencies source code and Apache source code Tarballs<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>APR \u2013<\/strong> wget https:\/\/dlcdn.apache.org\/apr\/apr-1.7.0.tar.gz<\/li><li><strong>APR-UTILS \u2013<\/strong> wget https:\/\/dlcdn.apache.org\/apr\/apr-util-1.6.1.tar.gz<\/li><li><strong>EXPAT \u2013<\/strong> yum install expat expat-devel<\/li><li><strong>PCRE \u2013<\/strong> wget http:\/\/ftp.pcre.org\/pub\/pcre\/pcre-8.00.tar.gz<\/li><li><strong>OpenSSL \u2013<\/strong> wget https:\/\/www.openssl.org\/source\/openssl-1.0.2t.tar.gz<\/li><li><strong>HTTP Apache \u2013<\/strong> wget https:\/\/dlcdn.apache.org\/httpd\/httpd-2.4.46.tar.gz<\/li><\/ul>\n\n\n\n<p>4.Unzip, compile and Install dependencies<br><strong>Common steps<\/strong><\/p>\n\n\n\n<p><strong># tar -zxvf<br># cd<br># .\/configure<br># make<br># make install<\/strong><\/p>\n\n\n\n<p>5.Compile and install apr tool<\/p>\n\n\n\n<p><strong># export LC_ALL=en_US.UTF-8<br># export LC_CTYPE= en_US.UTF-8<br># cd \/opt\/tarball<br># tar -zxvf apr-1.7.0.tar.gz<br># cd apr-1.7.0<\/strong><\/p>\n\n\n\n<p><strong># replace &#8220;$RM &#8220;$cfgfile&#8221; with $RM -f &#8220;$cfgfile&#8221; in configure file<\/strong><\/p>\n\n\n\n<p><strong># .\/configure &#8211; -prefix=\/APPS\/Apache2446\/apr<br># make<br># make install<\/strong><\/p>\n\n\n\n<p>6.Compile and install apr-util tool<\/p>\n\n\n\n<p><strong># cd \/opt\/tarball<br># tar -zxvf apr-util-1.6.1.tar.gz<br># cd apr-util-1.6.1<br># .\/configure &#8211;prefix=\/APPS\/Apache2446\/apr-util &#8211;with-apr=\/APPS\/Apache2446\/apr<br># make<br># make install<\/strong><\/p>\n\n\n\n<p>7.Compile and install pcre tool<\/p>\n\n\n\n<p><strong># cd \/opt\/tarball<br># tar -zxvf pcre-8.00.tar.gz<br># cd pcre-8.00<br># .\/configure &#8211;prefix=\/APPS\/Apache2446\/pcre<br># make<br># make install<\/strong><\/p>\n\n\n\n<p>8.Compile and install openssl tool<\/p>\n\n\n\n<p><strong># cd \/opt\/tarball<br># tar -zxvf openssl-1.0.2t.tar.gz<br># cd openssl-1.0.2t<br># .\/config -fPIC &#8211;prefix=\/APPS\/Apache2446\/openssl<br># make<br># make install<\/strong><\/p>\n\n\n\n<p>9.Compile and install httpd<\/p>\n\n\n\n<p><strong># cd \/opt\/tarball<br># tar -zxvf httpd-2.4.46.tar.gz<br># cd httpd-2.4.46<br># .\/configure &#8211;prefix=\/APPS\/Apache2446 &#8211;with-apr=\/APPS\/Apache2446\/apr &#8211;with-apr-util=\/APPS\/Apache2446\/apr-# util &#8211;with-pcre=\/APPS\/Apache2446\/pcre &#8211;with-ssl=\/APPS\/Apache2446\/openssl<br># make<br># make install<br># \/APPS\/Apache2446\/bin\/apachect start<\/strong><\/p>\n\n\n\n<p>10.Add 80 port in firewall and reload<\/p>\n\n\n\n<p><strong># firewall-cmd &#8211;add-port=80\/tcp &#8211;permanent<br># firewall-cmd &#8211;add-port=80\/udp &#8211;permanent<br># firewall-cmd &#8211;reload<\/strong><\/p>\n\n\n\n<p>11.Test URL<\/p>\n\n\n\n<p>Browse for <strong>http:\/\/ip-addr<\/strong> from web client system and same system<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Apache install on Ubuntu (Apt Base)<\/h2>\n\n\n\n<p>1.Check OS version<\/p>\n\n\n\n<p><strong># cat \/etc\/*release<\/strong><\/p>\n\n\n\n<p>2.Install Apache using Apt<\/p>\n\n\n\n<p><strong># apt install apache2<\/strong><\/p>\n\n\n\n<p>3.Start Apache2 service<\/p>\n\n\n\n<p><strong># systemctl start apache2<\/strong><\/p>\n\n\n\n<p>4.White list apache2 on firewall ufw<\/p>\n\n\n\n<p><strong># ufw allow apache2<\/strong><\/p>\n\n\n\n<p>5.Test URL<\/p>\n\n\n\n<p>Browse for <strong>http:\/\/ip-addr<\/strong> from web client system and same system<\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_30779\"><figure class=\"wp-block-embed wp-block-embed-youtube is-type-video is-provider-youtube epyt-figure\"><div class=\"wp-block-embed__wrapper\"><iframe loading=\"lazy\"  id=\"_ytid_43045\"  width=\"760\" height=\"427\"  data-origwidth=\"760\" data-origheight=\"427\" src=\"https:\/\/www.youtube.com\/embed\/?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;\" class=\"__youtube_prefs__  no-lazyload\" title=\"YouTube player\"  data-epytgalleryid=\"epyt_gallery_30779\"  allow=\"fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen data-no-lazy=\"1\" data-skipgform_ajax_framebjll=\"\"><\/iframe><\/div><\/figure><div class=\"epyt-gallery-list\"><div>Sorry, there was a YouTube error.<\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>How many ways you can install Apache? Installation Types1.Yum Based2.RPM Based3.Source code\/ Tar ball Based Apache install on Centos 7 (Yum Base) 1.Check OS version # cat&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[4957],"tags":[460],"class_list":["post-23986","post","type-post","status-publish","format-standard","hentry","category-linux","tag-linux"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/23986","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=23986"}],"version-history":[{"count":3,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/23986\/revisions"}],"predecessor-version":[{"id":24178,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/23986\/revisions\/24178"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=23986"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=23986"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=23986"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}