{"id":2977,"date":"2012-05-07T22:10:32","date_gmt":"2012-05-07T14:10:32","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=2977"},"modified":"2023-06-23T18:16:32","modified_gmt":"2023-06-23T18:16:32","slug":"how-to-install-apache-httpd-on-centos-5-8","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-install-apache-httpd-on-centos-5-8\/","title":{"rendered":"How to Install Apache Httpd on CentOS 5.8"},"content":{"rendered":"<p>Apache HTTPD, one of the most popular web servers, is known for its extensibility and versatility, making it an excellent choice for various types of websites.<\/p>\n<p>This guide will walk you through the process of installing Apache HTTPD on CentOS 5.8, a widely-used Linux distribution. This tutorial assumes that you have installed the minimal installation type CentOS 5.8 and have set up your local yum repository. However, if your server has a direct internet connection, you can use the internet CentOS yum repository instead.<\/p>\n<p>For more information on Apache HTTPD and other web servers, you can visit our pages on <a href=\"https:\/\/webhostinggeeks.com\/blog\/apache-http-server-explained\/\">Apache<\/a>, <a href=\"https:\/\/webhostinggeeks.com\/blog\/nginx-server-explained\/\">Nginx<\/a>, and <a href=\"https:\/\/webhostinggeeks.com\/blog\/litespeed-web-server-explained\/\">LiteSpeed<\/a>. You can also learn more about the <a href=\"https:\/\/webhostinggeeks.com\/best\/web-server\/\">best web servers<\/a> available today.<\/p>\n<h2>Installing Apache HTTPD<\/h2>\n<p>To install Apache HTTPD, you need to run the following command:<\/p>\n<pre>\r\n[root@centos58 ~]# yum install httpd -y\r\n<\/pre>\n<p>This command will initiate the installation process. The system will first determine the fastest mirrors to use for the download. It will then resolve dependencies and install the necessary packages. The packages include httpd, apr, apr-util, mailcap, and postgresql-libs.<\/p>\n<p>Example:<\/p>\n<pre>\r\n[root@centos58 ~]# yum install httpd -y\r\nLoaded plugins: fastestmirror\r\nDetermining fastest mirrors\r\n * base: mirror.oscc.org.my\r\n * extras: mirror.oscc.org.my\r\n * updates: mirror.oscc.org.my\r\nbase                                                                         | 1.1 kB     00:00\r\nextras                                                                       | 2.1 kB     00:00\r\nupdates                                                                      | 1.9 kB     00:00\r\nupdates\/primary_db                                                           | 263 kB     00:01\r\nSetting up Install Process\r\nResolving Dependencies\r\n--> Running transaction check\r\n---> Package httpd.i386 0:2.2.3-63.el5.centos.1 set to be updated\r\nbase\/filelists                                                               | 3.0 MB     00:28\r\nextras\/filelists_db                                                          | 212 kB     00:02\r\nupdates\/filelists_db                                                         | 1.1 MB     00:09\r\n--> Processing Dependency: \/etc\/mime.types for package: httpd\r\n--> Processing Dependency: libapr-1.so.0 for package: httpd\r\n--> Processing Dependency: libaprutil-1.so.0 for package: httpd\r\n--> Running transaction check\r\n---> Package apr.i386 0:1.2.7-11.el5_6.5 set to be updated\r\n---> Package apr-util.i386 0:1.2.7-11.el5_5.2 set to be updated\r\n--> Processing Dependency: libpq.so.4 for package: apr-util\r\n---> Package mailcap.noarch 0:2.1.23-1.fc6 set to be updated\r\n--> Running transaction check\r\n---> Package postgresql-libs.i386 0:8.1.23-1.el5_7.3 set to be updated\r\n--> Finished Dependency Resolution\r\n\r\nDependencies Resolved\r\n\r\n====================================================================================================\r\n Package                   Arch             Version                         Repository         Size\r\n====================================================================================================\r\nInstalling:\r\n httpd                     i386             2.2.3-63.el5.centos.1           updates           1.2 M\r\nInstalling for dependencies:\r\n apr                       i386             1.2.7-11.el5_6.5                base              124 k\r\n apr-util                  i386             1.2.7-11.el5_5.2                base               80 k\r\n mailcap                   noarch           2.1.23-1.fc6                    base               14 k\r\n postgresql-libs           i386             8.1.23-1.el5_7.3                base              197 k\r\n\r\nTransaction Summary\r\n====================================================================================================\r\nInstall       5 Package(s)\r\nUpgrade       0 Package(s)\r\n\r\nTotal download size: 1.6 M\r\nDownloading Packages:\r\n(1\/5): mailcap-2.1.23-1.fc6.noarch.rpm                                       |  14 kB     00:00\r\n(2\/5): apr-util-1.2.7-11.el5_5.2.i386.rpm                                    |  80 kB     00:00\r\n(3\/5): apr-1.2.7-11.el5_6.5.i386.rpm                                         | 124 kB     00:00\r\n(4\/5): postgresql-libs-8.1.23-1.el5_7.3.i386.rpm                             | 197 kB     00:01\r\n(5\/5): httpd-2.2.3-63.el5.centos.1.i386.rpm                                  | 1.2 MB     00:12\r\n----------------------------------------------------------------------------------------------------\r\nTotal                                                               108 kB\/s | 1.6 MB     00:15\r\nRunning rpm_check_debug\r\nRunning Transaction Test\r\nFinished Transaction Test\r\nTransaction Test Succeeded\r\nRunning Transaction\r\n  Installing     : apr                                                                          1\/5\r\n  Installing     : postgresql-libs                                                              2\/5\r\n  Installing     : mailcap                                                                      3\/5\r\n  Installing     : apr-util                                                                     4\/5\r\n  Installing     : httpd                                                                        5\/5\r\n\r\nInstalled:\r\n  httpd.i386 0:2.2.3-63.el5.centos.1\r\n\r\nDependency Installed:\r\n  apr.i386 0:1.2.7-11.el5_6.5                 apr-util.i386 0:1.2.7-11.el5_5.2\r\n  mailcap.noarch 0:2.1.23-1.fc6               postgresql-libs.i386 0:8.1.23-1.el5_7.3\r\n\r\nComplete!\r\n<\/pre>\n<h2>Starting and Stopping the Apache HTTPD Service<\/h2>\n<p>After the installation, you can start the Apache HTTPD service using the following command:<\/p>\n<pre>\r\n[root@centos58 ~]# service httpd start\r\n<\/pre>\n<p>To stop the service, use this command:<\/p>\n<pre>\r\n[root@centos58 ~]# service httpd stop\r\n<\/pre>\n<p>You can check the status of the Apache HTTPD service with this command:<\/p>\n<pre>\r\n[root@centos58 ~]# service httpd status\r\n<\/pre>\n<h2>Setting Apache HTTPD to Auto-Start at Boot<\/h2>\n<p>To ensure that the Apache HTTPD service starts automatically whenever your server boots, run the following command:<\/p>\n<pre>\r\n[root@centos58 ~]# chkconfig httpd on\r\n<\/pre>\n<p>This command will set the Apache HTTPD service to start automatically at boot.<\/p>\n<h2>Commands Mentioned<\/h2>\n<ul>\n<li><span class=\"fw-bold\">yum install httpd -y<\/span> \u2013 Installs Apache HTTPD<\/li>\n<li><span class=\"fw-bold\">service httpd start<\/span> \u2013 Starts the Apache HTTPD service<\/li>\n<li><span class=\"fw-bold\">service httpd stop<\/span> \u2013 Stops the Apache HTTPD service<\/li>\n<li><span class=\"fw-bold\">service httpd status<\/span> \u2013 Checks the status of the Apache HTTPD service<\/li>\n<li><span class=\"fw-bold\">chkconfig httpd on<\/span> \u2013 Sets Apache HTTPD to auto-start at boot<\/li>\n<\/ul>\n<h2>Conclusion<\/h2>\n<p>Installing Apache HTTPD on CentOS 5.8 is a straightforward process that involves running a few commands. This guide has provided step-by-step instructions to help you install Apache HTTPD, start and stop the service, check its status, and set it to auto-start at boot.<\/p>\n<p>Remember, whether you&#8217;re using a <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-dedicated-server-hosting\/\">dedicated server<\/a>, a <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-vps-hosting\/\">VPS server<\/a>, <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-cloud-hosting\/\">cloud hosting<\/a>, or <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-shared-hosting\/\">shared hosting<\/a>, understanding how to install and manage your web server is crucial for maintaining a successful website.<\/p>\n<p>With this guide, you should now be able to install Apache HTTPD on CentOS 5.8 and manage the service effectively.<\/p>\n<p>Happy hosting!<\/p>\n<h2>Frequently Asked Questions<\/h2>\n<ol itemscope itemtype=\"https:\/\/schema.org\/FAQPage\">\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What is Apache HTTPD?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">Apache HTTPD is a widely-used and extensibleweb server. It is known for its robustness, flexibility, and many features that make it suitable for a variety of website types.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What is CentOS?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">CentOS is a popular Linux distribution that is used as a reliable platform for many servers. It is community-supported and is a free alternative to Red Hat Enterprise Linux.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What is the yum command?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">Yum is a package manager for RPM-compatible Linux systems. It is used to install, update, and remove software packages.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">How can I check if Apache HTTPD is running?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">You can check if Apache HTTPD is running by using the command &#8216;service httpd status&#8217;. This will display the status of the Apache HTTPD service.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">How can I make Apache HTTPD start automatically at boot?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">You can make Apache HTTPD start automatically at boot by using the command &#8216;chkconfig httpd on&#8217;. This sets the Apache HTTPD service to start automatically whenever the server boots.<\/span>\n            <\/p>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Apache HTTPD, one of the most popular web servers, is known for its extensibility and versatility, making it an excellent choice for various types of websites. This guide will walk&#8230;<\/p>\n","protected":false},"author":6,"featured_media":349,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[1103,2055],"tags":[1199,1244,1249,1473,1536,1546],"class_list":["post-2977","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apache","category-centos","tag-apache","tag-centos","tag-centos-5-8","tag-httpd","tag-linux","tag-linux-utilities"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/2977","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/comments?post=2977"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/2977\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media\/349"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=2977"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=2977"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=2977"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}