Red HatThis forum is for the discussion of Red Hat Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I messed up the config on my CentOS 6.2 box and want to reinstall the httpd.conf from scratch.
According to this below, the config file nor the webserver itself is not owned by an RPM package.
Code:
# rpm -qf /etc/httpd/conf/httpd.conf
file /etc/httpd/conf/httpd.conf is not owned by any package
rpm -qf `which httpd`
file /usr/sbin/httpd is not owned by any package
Did I do something wrong, I don't understand why httpd is not packaged.
How can I get the original configuration file back ?
From the output that you have pasted it does not appear that you have got httpd installed. What is the output of:
Code:
rpm -qa | grep httpd
If it does not show anything then you have to install httpd. Appears like it has been removed. You can install httpd using the following command:
Code:
yum install httpd
Before you install httpd I would suggest that you make a copy of existing /var/www directory and /etc/httpd directory. It is better to be safe then sorry :-)
Thanks, reading your comment about yum made me check the yum.conf and httpd was in the exclude list :-(
That's now fixed. I presume that httpd is in the exclude list so that you don't accidentally wipe out your web content :-)
Unfortunately the webserver still refuses to start up.
The error_log says :
Code:
[Tue Mar 13 00:21:14 2012] [notice] SSL FIPS mode disabled
[Tue Mar 13 00:21:14 2012] [warn] RSA server certificate CommonName (CN) `localhost' does NOT match server name!?
[Tue Mar 13 00:21:14 2012] [emerg] (28)No space left on device: Couldn't create accept lock (/var/log/httpd/accept.lock.9831) (5)
service httpd configtest
[Tue Mar 13 00:59:52 2012] [crit] (22)Invalid argument: alloc_listener: failed to get a socket for (null)
Syntax error on line 136 of /etc/httpd/conf/httpd.conf:
Listen setup failed
Code:
# rpm -q httpd apr
httpd-2.2.15-15.el6.centos.1.i686
apr-1.3.9-3.el6_1.2.i686
# service httpd configtest
[Tue Mar 13 00:31:20 2012] [crit] (22)Invalid argument: alloc_listener: failed to get a socket for (null)
Syntax error on line 136 of /etc/httpd/conf/httpd.conf:
Listen setup failed
Line 136 says :
Code:
Listen 80
I also tried IP:80 which made no difference. I dont see the syntax error.
Hi, it's a stock configuration, so httpd should start up afaik, nothing has been changed. It did work originally and I could connect to the web server.
I will send you my hosts file privately if these files below are of no use.
Code:
httpd -t
[Tue Mar 13 01:37:13 2012] [crit] (22)Invalid argument: alloc_listener: failed to get a socket for (null)
Syntax error on line 136 of /etc/httpd/conf/httpd.conf:
Listen setup failed
Compare the version of apr and httpd are they at the same level? If not then upgrade either of them to bring them both at the same level and then restart httpd services.
No need for /etc/hosts.
You can find out the version apr in the same way you did for httpd, that is:
Hi, I can't see an update for apr but I did for CentOS 6.2 httpd, when I installed that, it made no difference.
Could you please be more specific with version numbers that I should sync or up/down-grade to, afaik all should work with the currently installed versions.
What do you mean by the same level, I can't see an update to apr.
From the output that you have pasted the version seems to be fine as I can see the same version online. But it appears that there is something wrong which I cannot pinpoint. Things that I can suggest are:
1. Make a backup of existing /etc/httpd directory.
2. Rename existing /etc/httpd directory /etc/httpd.old
3. Make a backup of existing /var/www directory.
4. Rename existing /var/www /var/www.old.
5. Remove apr (this will automatically remove httpd as well). Command:
Code:
yum remove apr
6. Check if the packages have been removed or not by running the following commands:
Code:
rpm -qa | grep apr
Code:
rpm -qa | grep httpd
7. Once verified that the packages have been removed. Install httpd (this will automatically install apr as well). Command:
Code:
yum install httpd
8. Check if you are able to start httpd services or not? If yes, then do not rename back earlier directories instead make the changes to existing file. Make sure you take a backup of new configuration files before making any changes.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.