You are viewing an old revision of this post, from October 24, 2017 @ 18:41:01. See below for differences between this version and the current revision.

Centos – How to Install The Latest Apache Server

By default of Centos, you only can install Apache version 2.4.6, because Centos uses Security Backporting Practice to apply most recent fixes to older versions of a software package. As a result, it doesn’t mean that an older version provided by default repositories is vulnerable. But I need the latest version of Apache so that I can speed up my website. There is a great custom repo created by these guys CodeIT It provides latest versions of web servers (Apache & Nginx).

Before setting up the CodeIT repository, you need to enable the EPEL. It satisfies some dependencies required by the CodeIT repo.

sudo yum install -y epel-release
cd /etc/yum.repos.d && wget https://repo.codeit.guru/codeit.el`rpm -q --qf "%{VERSION}" $(rpm -q --whatprovides redhat-release)`.repo

Then verify the Apache package version again, and you should see something like that.

yum info httpd

Now you should have everything set up to install the latest Apache package.

yum install httpd
systemctl start httpd

Finally, tell systemd to start the Apache service automatically at boot.

systemctl enable httpd

That’s all if you have any troubles, please feel free to leave comments below.

Hope it is useful to you 🙂

Revisions

Revision Differences

October 24, 2017 @ 18:41:01Current Revision
Content
Deleted: <p> 
 Added: By default of Centos, you only can install Apache version 2.4.6, because Centos uses <a href="https:/ /access.redhat.com/security/ updates/backporting/">Security Backporting Practice</a> to apply most recent fixes to older versions of a software package. As a result, it doesn’t mean that an older version provided by default repositories is vulnerable. But I need the latest version of Apache so that I can speed up my website.
Deleted: Apache is the most widely used web server software for serving web applications and it is an essential part of any server. To have the latest version installed means that your software package will probably have more new features and known bugs fixes.Added: There is a great custom repo created by these guys <a class="article- content__link" href="https:/ /codeit.guru/en_US/" rel="noopener" >CodeIT</a> It provides latest versions of web servers (Apache &amp; Nginx).
Deleted: </p> 
Deleted: <h3> 
Deleted: Introduction 
Deleted: </h3> 
Deleted: <p> 
Deleted: In this tutorial, I am going to describe simple steps to install the latest Apache (httpd) version on your Centos 7 system. 
Deleted: </p> 
Deleted: <p> 
Deleted: By default Centos 7 has few predefined repositories for installing packages, but unfortunately, a lot of packages are out of date there. 
Deleted: </p> 
Deleted: <h2> 
 Added: <p class="article- content__paragraph">Before setting up the CodeIT repository, you need to enable the <a class="article- content__link" href="https:/ /fedoraproject.org/wiki/EPEL" rel="noopener">EPEL</a>. It satisfies some dependencies required by the CodeIT repo.</p>
Deleted: Step 1 &mdash; Find out the Apache version in default reposAdded: <pre>sudo yum install -y epel-release</pre>
Deleted: </h2> 
Deleted: <p> 
Deleted: In order to check the current version of&nbsp;<strong> httpd</strong> &nbsp;package available in repositories &ndash; type the following command: 
Deleted: </p> 
Deleted: <table> 
Deleted: <tbody> 
Deleted: <tr> 
Deleted: <td> 
Deleted: <pre> 
Deleted: 1</pre> 
Deleted: </td> 
Deleted: <td> 
Deleted: <pre> 
Deleted: yum info httpd 
 Added: <div class="highlighted-source native bash">
 Added: <pre><span class="nb">cd</span> /etc/yum.repos.d <span class="o">&amp; &amp;</span> wget <a class="vglnk" href="https:/ /repo.codeit.guru/codeit.el" rel="nofollow" >https://repo.codeit.guru/ codeit.el</a><span class="sb">`</span>rpm -q --qf <span class="s2">"%{VERSION}"</span> <span class="k">$(</span>rpm -q --whatprovides redhat-release<span class="k">)</span><span class="sb">`</span>.repo
Unchanged: </pre>Unchanged: </pre>
Deleted: </td> 
Deleted: </tr> 
Deleted: </tbody> 
Deleted: </table> 
Deleted: <p> 
Deleted: If you have default installation, you will most likely see similar output. 
Deleted: </p> 
Deleted: <table> 
Deleted: <tbody> 
Deleted: <tr> 
Deleted: <td> 
Deleted: <pre> 
Deleted: 1 
Deleted: 2 
Deleted: 3 
Deleted: 4 
Deleted: 5 
Deleted: 6 
Deleted: 7 
Deleted: 8 
Deleted: 9 
Deleted: 10 
Deleted: 11 
Deleted: 12 
Deleted: 13 
Deleted: 14 
Deleted: 15 
Deleted: 16 
Deleted: 17 
Deleted: 18 
Deleted: 19 
Deleted: 20 
Deleted: 21 
Deleted: 22 
Deleted: 23 
Deleted: 24</pre> 
Deleted: </td> 
Deleted: <td> 
Deleted: <pre> 
 Added: <p class="article- content__paragraph">Then verify the Apache package version again, and you should see something like that.</p>
Deleted: [root@crosp ~]# yum info httpd Added: <pre>yum info httpd
Deleted: Loaded plugins: fastestmirror 
Deleted: epel/x86_64/metalink | 19 kB 00:00 
Deleted: epel | 4.3 kB 00:00 
Deleted: (1/3): epel/x86_64/group_gz | 170 kB 00:00 
Deleted: (2/3): epel/x86_64/primary_db | 4.6 MB 00:00 
Deleted: (3/3): epel/x86_64/updateinfo | 780 kB 00:00 
Deleted: Loading mirror speeds from cached hostfile 
Deleted: * base: mirrors.ircam.fr 
Deleted: * epel: mirrors.ircam.fr 
Deleted: * extras: centos.mirror.fr.planethoster.net 
Deleted: * updates: centos.mirror.fr.planethoster.net 
Deleted: Available Packages 
Deleted: Name : httpd 
Deleted: Arch : x86_64 
Deleted: Version : 2.4.6 
Deleted: Release : 45.el7.centos.4 
Deleted: Size : 2.7 M 
Deleted: Repo : updates/7/x86_64 
Deleted: Summary : Apache HTTP Server 
Deleted: URL : http://httpd.apache.org/ 
Deleted: License : ASL 2.0 
Deleted: Description : The Apache HTTP Server is a powerful, efficient, and extensible 
Deleted: : web server. 
Unchanged: </pre>Unchanged: </pre>
Deleted: </td> 
Deleted: </tr> 
Deleted: </tbody> 
Deleted: </table> 
Deleted: <p> 
Deleted: As you can see from the output above, there is only 2.4.6 Apache version available in default repos.Added: <p class="article- content__paragraph">Now you should have everything set up to install the latest Apache package.</p>
Deleted: </p> 
Deleted: <p> 
 Added: </div>
Deleted: <strong>Please note:</strong>Added: <pre>yum install httpd</pre>
Deleted: </p> 
Deleted: <p> 
Deleted: Centos uses&nbsp;<a href="https:/ /access.redhat.com/security/ updates/backporting/" target="_blank">Security Backporting Practice</a>&nbsp;in order to apply most recent fixes to older versions of a software package, as a result it doesn&rsquo;t mean that an older version provided by default repositories is vulnerable. But in my case I didn&rsquo;t have a required update. 
Deleted: </p> 
Deleted: <p> 
Deleted: You can see a changelog using these commands : 
Deleted: </p> 
Deleted: <table> 
Deleted: <tbody> 
Deleted: <tr> 
Deleted: <td> 
Deleted: <pre> 
Deleted: 1 
Deleted: 2</pre> 
Deleted: </td>  
Deleted: <td> 
Deleted: <pre> 
Deleted: sudo yum install yum-changelog 
Deleted: yum changelog httpd 
 Added: <pre>systemctl start httpd
Unchanged: </pre>Unchanged: </pre>
Deleted: </td> 
Deleted: </tr> 
Deleted: </tbody> 
Deleted: </table> 
Deleted: <h2> 
Deleted: Step 2 &mdash; Set up CodeIT repositories 
Deleted: </h2> 
Deleted: <p> 
Deleted: There is a great custom repo created by these guys&nbsp;<a href="https:/ /codeit.guru/en_US/" target="_blank" >CodeIT</a>&nbsp;It provides latest versions of web servers (Apache &amp; Nginx).Added: <p class="article- content__paragraph">Finally, tell <strong> systemd</strong> to start the Apache service automatically at boot.</p>
Deleted: </p> 
Deleted: <p> 
Deleted: Before setting up the CodeIT repository first of all you need to enable the&nbsp;<a href="https:/ /fedoraproject.org/wiki/EPEL" target="_blank">EPEL</a>. It satisfies some dependencies required by the CodeIT repo. 
Deleted: </p> 
Deleted: <table> 
Deleted: <tbody> 
Deleted: <tr> 
Deleted: <td> 
Deleted: <pre> 
Deleted: 1</pre> 
Deleted: </td> 
Deleted: <td> 
Deleted: <pre> 
Deleted: sudo yum install -y epel-releaseAdded: <pre>systemctl enable httpd
Unchanged: </pre>Unchanged: </pre>
Deleted: </td> 
Deleted: </tr> 
Deleted: </tbody> 
Deleted: </table> 
Deleted: <p> 
Deleted: Finally enable the CodeIT repository. 
Deleted: </p> 
Deleted: <table> 
Deleted: <tbody> 
Deleted: <tr> 
Deleted: <td> 
Deleted: <pre> 
Deleted: 1</pre> 
Deleted: </td> 
Deleted: <td> 
Deleted: <pre> 
Deleted: cd /etc/yum.repos.d &amp;&amp; wget https://repo.codeit.guru/ codeit.el`rpm -q --qf &quot;%{VERSION}&quot; $(rpm -q --whatprovides redhat-release)`.repo 
Deleted: </pre> 
Deleted: </td> 
Deleted: </tr> 
Deleted: </tbody> 
Deleted: </table> 
Deleted: <p> 
Deleted: Then verify the Apache package version again and you should see something like that. 
Deleted: </p> 
Deleted: <table> 
Deleted: <tbody> 
Deleted: <tr> 
Deleted: <td> 
Deleted: <pre> 
Deleted: 1 
Deleted: 2 
Deleted: 3 
Deleted: 4 
Deleted: 5 
Deleted: 6 
Deleted: 7 
Deleted: 8 
Deleted: 9 
Deleted: 10 
Deleted: 11 
Deleted: 12 
Deleted: 13 
Deleted: 14 
Deleted: 15 
Deleted: 16 
Deleted: 17 
Deleted: 18 
Deleted: 19</pre> 
Deleted: </td> 
Deleted: <td> 
Deleted: <pre> 
Deleted: [root@crosp ~]# yum info httpd 
Deleted: Loaded plugins: changelog, fastestmirrorAdded: <div class="article-content">
Deleted: Loading mirror speeds from cached hostfile 
Deleted: * base: centos.crazyfrogs.org 
Deleted: * epel: mirror.23media.de 
Deleted: * extras: mirrors.ircam.fr 
Deleted: * updates: centos.mirror.fr.planethoster.net 
Deleted: Available Packages 
Deleted: Name : httpd 
Deleted: Arch : x86_64 
Deleted: Version : 2.4.25 
Deleted: Release : 3.el7.codeit 
Deleted: Size : 1.4 M 
Deleted: Repo : CodeIT/x86_64 
Deleted: Summary : Apache HTTP Server 
Deleted: URL : http://httpd.apache.org/ 
Deleted: License : ASL 2.0 
Deleted: Description : The Apache HTTP Server is a powerful, efficient, and extensible 
Deleted: : web server. 
Deleted: </pre> 
Deleted: </td> 
Deleted: </tr> 
Deleted: </tbody> 
Deleted: </table> 
Deleted: <h2> 
Deleted: Step 3 &mdash; Install the Apache web-server 
Deleted: </h2> 
Deleted: <p> 
Deleted: Now you should have everything set up to install the latest Apache package. 
Deleted: </p> 
Deleted: <table> 
Deleted: <tbody> 
Deleted: <tr> 
Deleted: <td> 
Deleted: <pre> 
Deleted: 1</pre> 
Deleted: </td> 
Deleted: <td> 
Deleted: <pre> 
Deleted: yum install httpd 
Deleted: </pre> 
Deleted: </td> 
Deleted: </tr> 
Deleted: </tbody> 
Deleted: </table> 
Deleted: <p> 
Deleted: Once Apache is installed, let&rsquo;s start it and test whether it is working. 
Deleted: </p> 
Deleted: <table> 
Deleted: <tbody> 
Deleted: <tr> 
Deleted: <td> 
Deleted: <pre> 
Deleted: 1</pre> 
Deleted: </td> 
Deleted: <td> 
Deleted: <pre> 
Deleted: [root@crosp ~]# systemctl start httpd 
Deleted: </pre> 
Deleted: </td> 
Deleted: </tr> 
Deleted: </tbody> 
Deleted: </table> 
Deleted: <p> 
 Added: <p class="article- content__paragraph">Thats all if you have any troubles, please feel free to leave comments below.</p>
Deleted: The output should be similar to the following:Added: Hope it is useful to you :)</div>
Deleted: </p> 
Deleted: <table> 
Deleted: <tbody> 
Deleted: <tr> 
Deleted: <td> 
Deleted: <pre> 
Deleted: 1 
Deleted: 2 
Deleted: 3 
Deleted: 4 
Deleted: 5 
Deleted: 6 
Deleted: 7 
Deleted: 8</pre> 
Deleted: </td> 
Deleted: <td> 
Deleted: <pre> 
Deleted: [root@crosp ~]# curl localhost 
Deleted: &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.1//EN&quot; &quot;http:// www.w3.org/TR/ xhtml11/DTD/ xhtml11.dtd&quot;&gt; 
Deleted: &lt;html xmlns=&quot;http: //www.w3.org/ 1999/xhtml&quot; xml:lang=&quot; en&quot;&gt; 
Deleted: &lt;head&gt; 
Deleted: &lt;title&gt;Test Page for the Apache HTTP Server on CentOS&lt;/title&gt; 
Deleted: &lt;meta http-equiv=&quot; Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt; 
Deleted: ... 
Deleted: </pre> 
Deleted: </td> 
Deleted: </tr> 
Deleted: </tbody> 
Deleted: </table> 
Deleted: <p> 
Deleted: Finally, tell&nbsp;<strong> systemd</strong>&nbsp;to start the Apache service automatically at boot. 
Deleted: </p> 
Deleted: <table> 
Deleted: <tbody> 
Deleted: <tr> 
Deleted: <td> 
Deleted: <pre> 
Deleted: 1</pre> 
Deleted: </td> 
Deleted: <td> 
Deleted: <pre> 
Deleted: [root@crosp ~]# systemctl enable httpd 
Deleted: </pre> 
Deleted: </td> 
Deleted: </tr> 
Deleted: </tbody> 
Deleted: </table> 
Deleted: <p> 
Deleted: That&rsquo;s all, if you have any troubles please feel free to leave comments below.  
Deleted: </p> 

Note: Spaces may be added to comparison text to allow better line wrapping.

No comments yet.

Leave a Reply