2

I've installed httpd in CentOS 6.3

yum install httpd

After successfully installing it, I tried to start it

service httpd start

Nothing happend. I opened the browser and typed my IP address but could not connect.

Update:

Now I've reinstalled httpd

when i run

service httpd start

message displayed

Starting httpd: no listening sockets available, shutting down
Unable to open logs
  • 1
    Your Apache logs can be found in /var/log/httpd. What does the error log say? – larsks Dec 27 '12 at 23:41
  • Little bit confusing, you say it won't start then you say you a 404, a 404 would suggest that it is running. Do you see the httpd process when you do a "ps aux"? If not then what does the error log show (/var/log/httpd/error.log)? – Epaphus Dec 27 '12 at 23:41
  • i'm sorry Unable to connect message is displayed in mozilla lol – codinginsane Dec 27 '12 at 23:47
  • there is no error.log file – codinginsane Dec 27 '12 at 23:51
  • Ah might be error_log, should be an error log /var/log/httpd folder. If not try running "httpd" in a terminal and it should give an output in the terminal – Epaphus Dec 28 '12 at 0:00
4

There could be few issues over here.

  1. Selinux -selinux is enabled in your machine, and that is preventing from starting the Apache. You can try disabling selinux and try restarting the httpd. You can do that by this command setenforce 0

  2. You are not running this command with root privileges. To do that, use sudo and execute the command like this $ sudo service httpd start

  3. Also, there might be something already running on port 80. To check that use this command netstat -npl | grep 80 If this command is showing something then that means some other application is running on that port.

One last thing you can try is that, you have already http running, and the connection is refused may be because of some firewall or something else.

To check the same, use command with restart and simply with start.

So, give this command $ sudo service httpd restart

If this command doesn't give any error this time, which you are seeing normally, that means that httpd is running but the connection refused is may be because of something else.

  • I've tried all what you said but the same error service httpd start Starting httpd: no listening sockets available, shutting down Unable to open logs [FAILED] – codinginsane Dec 28 '12 at 15:05
  • Can you tell me what do you see in the error logs – GeekRide Dec 28 '12 at 15:07
  • 1
    setenforce 0 - Worked in my case – Mohd. Umar Feb 13 '17 at 6:18
2

I solved the problem.

yum update

then removed httpd

yum erase httpd

then installed it again

yum install httpd

and typed

service httpd start

Now it works!

0

Make sure your /etc/hosts file is configured with a fully-qualified domain name and the server's IP address, as per this suggestion.

/etc/hosts:

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

172.16.100.13   Rizzo.ifp.com rizzo
  • 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 172.16.100.13 Rizzo.ifp.com rizzo – codinginsane Dec 28 '12 at 0:51
0

Looks like there is an issue with libaprutil, I believe it is provided by the apr package on CentOS 6.3

yum reinstall apr-util

If that fails then try

yum provides libaprutil-1.so.0

Which will give you correct package to install/reinstall

  • Starting httpd: no listening sockets available, shutting down Unable to open logs – codinginsane Dec 28 '12 at 0:39
  • That would suggest it is running or something else is listen is on the port httpd is wanting to use (TCP 80 by default) You can see what is running on port 80 by using the command "netstat -tpln" – Epaphus Dec 28 '12 at 13:51
0

Same error.

I found in my ssl_error_log this string:

No such file or directory: could not open transfer log file /etc/httpd/logs/ssl_request_log.

At /etc/httpd/ was no directory /logs, but strange file '!logs'. I removed it, created 'logs' directory, restart httpd... and it started.

May be it be useful for you.

0

There might be something running on port 80. You can check it by

fuser -n tcp 80

or use

ss -plnt sport eq :80

Kill the offending process and you are done.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.