Ask Your Question

Problem setting up Apache web server on CentOS 6.5

asked 2014-02-25 12:40:04 -0500

ping pong gravatar image

updated 2014-02-26 06:09:27 -0500

mether gravatar image

I have problem setup Apache web server. Below is the commands I input and the result. Webrower reports error on localhost

[root@localhost ~]# yum install httpd -y

Loaded plugins: fastestmirror, refresh-packagekit, security

Loading mirror speeds from cached hostfile

 * base:

 * extras:

 * updates:

Setting up Install Process

Package httpd-2.2.15-29.el6.centos.x86_64 already installed and latest version

Nothing to do

[root@localhost ~]# chkconfig httpd on

**error reading information on service httpd: Invalid argument**

[root@localhost ~]# service httpd start

[root@localhost ~]#

No reposne to the last command.

Web browser report error on http://localhost

Any idea would be appreciated.


The CentOS is running on VirtualBox on Windows 7.

I tried to uninstall httpd, but failed using

yum remove httpd

httpd-2.2.15-29.el6.centos.x86_64 was supposed to be removed but is not!

  Verifying  : httpd-2.2.15-29.el6.centos.x86_64                                                                                   1/1 

  httpd.x86_64 0:2.2.15-29.el6.centos

Note 2

The first time I try to install httpd (yum install httpd), the OS frozen. I restarted it, which might corupt the kernel.

edit retag flag offensive close merge delete


Which browser error (see Does curl return anything su -c "yum -y install curl"curl http://localhost . See for an introduction to running apache on CentOS6.

marcindulak gravatar imagemarcindulak ( 2014-02-25 12:57:36 -0500 )edit

I tied the curl, it returns below. I will have a look at the link you provided. Thank you very much!

[root@localhost ~]# curl http://locahost

curl: (6) Couldn't resolve host 'locahost'
ping pong gravatar imageping pong ( 2014-02-25 13:23:49 -0500 )edit

I followed the commands on the link, but it still doesn't work. Any idea.

ping pong gravatar imageping pong ( 2014-02-25 14:24:49 -0500 )edit

I tried the link provided, but it still deosn't work. Any idea?

ping pong gravatar imageping pong ( 2014-02-25 14:35:34 -0500 )edit

As the comment below says your system is most likely in an broken state, so start with a fresh reinstall. localhost and not locahost - when trying any command copy it instead of typing - this is also the purpose of giving the commands explicitly in the answers on this and other fora. Document every command you perform on a system also for yourself.

marcindulak gravatar imagemarcindulak ( 2014-02-26 02:01:20 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2014-02-25 15:09:18 -0500

linux.alder gravatar image

updated 2014-02-25 15:10:49 -0500

Yum, though great, is still basically a wrapper for RPM. Rebooting, halting, etc during a package install/removal can cause all kinds of problems. Up to and including the need to just re-build the box.

Run 'rpm -qa | grep httpd' to confirm RPM sees the package installed.
If you see the httpd package installed, then you probably have a corrupted installation and need to clean it off completely first and re-install.

Run 'rpm --verify httpd' to verify the contents of the package.
This should tell you what you are missing.

Run 'rpm -e httpd' to remove the package.
If that runs without any issues, you can attempt to re-install with 'yum install httpd'. If it fails. My suggestion is to re-install the base OS and start from scratch. What is 10-15 minutes to be make it is working correctly? And don't consider rpm complaining of missing files (during the removal) as a failure. It is reporting the issue.

Good Luck!

edit flag offensive delete link more

answered 2014-02-25 15:20:21 -0500

Glenn gravatar image

I think yum reinstall httpd would be a better choice than yum install httpd, in this case, assuming that it is already installed as the OP stated.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-02-25 12:40:04 -0500

Seen: 4,212 times

Last updated: Feb 25 '14