{"id":1661,"date":"2012-01-14T14:37:58","date_gmt":"2012-01-14T06:37:58","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=1661"},"modified":"2023-04-28T09:49:58","modified_gmt":"2023-04-28T09:49:58","slug":"how-to-install-httpd-on-centos-5-7","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-install-httpd-on-centos-5-7\/","title":{"rendered":"How to Install Httpd on CentOS 5.7"},"content":{"rendered":"<p>Apache httpd is one of the most popular web servers and has a lot of features that make it very extensible and useful for many different types of websites.This steps has been tested on CentOS 5.7 with direct internet connection.<\/p>\n<p>Simply run this command to install apache httpd service on CentOS 5.7:<\/p>\n<ol>\n<pre class=\"code\">\n[root@CentOS57 ~]# yum install httpd\nLoaded plugins: fastestmirror\nLoading mirror speeds from cached hostfile\n * base: mirror.yourconnect.com\n * extras: mirrors.sin1.sg.voxel.net\n * updates: mirror.yourconnect.com\nSetting up Install Process\nResolving Dependencies\n--> Running transaction check\n---> Package httpd.i386 0:2.2.3-53.el5.centos.3 set to be updated\nbase\/filelists                                                              | 2.9 MB     00:25\nextras\/filelists_db                                                         | 199 kB     00:03\nupdates\/filelists_db                                                        | 1.9 MB     00:22\n--> Processing Dependency: \/etc\/mime.types for package: httpd\n--> Processing Dependency: libapr-1.so.0 for package: httpd\n--> Processing Dependency: libaprutil-1.so.0 for package: httpd\n--> Running transaction check\n---> Package apr.i386 0:1.2.7-11.el5_6.5 set to be updated\n---> Package apr-util.i386 0:1.2.7-11.el5_5.2 set to be updated\n--> Processing Dependency: libpq.so.4 for package: apr-util\n---> Package mailcap.noarch 0:2.1.23-1.fc6 set to be updated\n--> Running transaction check\n---> Package postgresql-libs.i386 0:8.1.23-1.el5_7.3 set to be updated\n--> Finished Dependency Resolution\n\nDependencies Resolved\n\n===================================================================================================\n Package                  Arch            Version                           Repository        Size\n===================================================================================================\nInstalling:\n httpd                    i386            2.2.3-53.el5.centos.3             updates          1.2 M\nInstalling for dependencies:\n apr                      i386            1.2.7-11.el5_6.5                  base             124 k\n apr-util                 i386            1.2.7-11.el5_5.2                  base              80 k\n mailcap                  noarch          2.1.23-1.fc6                      base              14 k\n postgresql-libs          i386            8.1.23-1.el5_7.3                  updates          197 k\n\nTransaction Summary\n===================================================================================================\nInstall       5 Package(s)\nUpgrade       0 Package(s)\n\nTotal download size: 1.6 M\nIs this ok [y\/N]: y\nDownloading Packages:\n(1\/5): mailcap-2.1.23-1.fc6.noarch.rpm                                      |  14 kB     00:00\n(2\/5): apr-util-1.2.7-11.el5_5.2.i386.rpm                                   |  80 kB     00:00\n(3\/5): apr-1.2.7-11.el5_6.5.i386.rpm                                        | 124 kB     00:01\n(4\/5): postgresql-libs-8.1.23-1.el5_7.3.i386.rpm                            | 197 kB     00:02\n(5\/5): httpd-2.2.3-53.el5.centos.3.i386.rpm                                 | 1.2 MB     00:11\n---------------------------------------------------------------------------------------------------\nTotal                                                               99 kB\/s | 1.6 MB     00:16\nRunning rpm_check_debug\nRunning Transaction Test\nFinished Transaction Test\nTransaction Test Succeeded\nRunning Transaction\n  Installing     : apr                                                                         1\/5\n  Installing     : mailcap                                                                     2\/5\n  Installing     : postgresql-libs                                                             3\/5\n  Installing     : apr-util                                                                    4\/5\n  Installing     : httpd                                                                       5\/5\n\nInstalled:\n  httpd.i386 0:2.2.3-53.el5.centos.3\n\nDependency Installed:\n  apr.i386 0:1.2.7-11.el5_6.5                 apr-util.i386 0:1.2.7-11.el5_5.2\n  mailcap.noarch 0:2.1.23-1.fc6               postgresql-libs.i386 0:8.1.23-1.el5_7.3\n\nComplete!\n<\/pre>\n<\/ol>\n<p>Set httpd service to auto start at boot:<\/p>\n<ol>\n<pre class=\"code\">\n[root@CentOS57 ~]# chkconfig httpd on\n<\/pre>\n<\/ol>\n<p>Start and troubleshoot httpd start error:<\/p>\n<ol>\n<pre class=\"code\">\n[root@CentOS57 ~]# service httpd start\n<\/pre>\n<\/ol>\n<ol>\n<pre class=\"code\">\nStarting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName\n<\/pre>\n<\/ol>\n<p>Check the server hostname or server fully qualified domain name:<\/p>\n<ol>\n<pre class=\"code\">\n[root@CentOS57 ~]# hostname\nCentOS57\n<\/pre>\n<\/ol>\n<p>Change the ServerName on line 265 to your hostname above.<\/p>\n<ol>\n<pre class=\"code\">\n[root@CentOS57 ~]# vi \/etc\/httpd\/conf\/httpd.conf\n<\/pre>\n<\/ol>\n<ol>\n<pre class=\"code\">\n  263 # redirections work in a sensible way.\n    264 #\n    265 ServerName CentOS57:80\n    266\n    267 #\n<\/pre>\n<\/ol>\n<p>Start the Httpd service using the following command : <\/p>\n<ol>\n<pre class=\"code\">\n[root@CentOS57 ~]# service httpd start\nStarting httpd:                                            [  OK  ]\n<\/pre>\n<\/ol>\n<p>or<\/p>\n<ol>\n<pre class=\"code\">\n[root@CentOS57 ~]# \/etc\/init.d\/httpd start\nStarting httpd:                                            [  OK  ]\n<\/pre>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Apache httpd is one of the most popular web servers and has a lot of features that make it very extensible and useful for many different types of websites.This steps&#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,1248,1473,1975,1536],"class_list":["post-1661","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apache","category-centos","tag-apache","tag-centos","tag-centos-5-7","tag-httpd","tag-install","tag-linux"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/1661","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=1661"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/1661\/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=1661"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=1661"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=1661"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}