Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am using Centos 5 to run linux server.

I restart the Apache server with this command

service httpd restart

Usually, it works fine. It didn't work at this time and showed me this error.

yum install php-devel 

I believe I used 'yum' to install php-devel

httpd (À»)¸¦ ½ÃÀÛ Áß: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs

I used to have ServerName in httpd.conf file.

I searched google to find the answer and most people said that put 'ServerName localhost'

I did it and got same error message.

The server is running now, but can't restart Apache server.

share|improve this question

migrated from stackoverflow.com Jun 16 '12 at 12:09

This question came from our site for professional and enthusiast programmers.

2 Answers 2

from your logs it looks like you have two problems:

  1. "Address already in use" error - it seems you have twice specified "Listen" parameter in the apache configuration files.
  2. Unable to open logs - check that apache have rw permissions to log files.
share|improve this answer
up vote 1 down vote accepted

The localhost fix should have ideally solved the problem. Just make sure that where you added the localhost in front of ServerName, that line is not commented.

Also make sure there are no duplicate files of the httpd.conf file. I had the same problem once and when I googled, I found that -

/etc/httpd/conf/httpd.conf and /etc/httpd/conf.d/system-config-httpd.conf

deleting the second one, fixed the issue for me.

If that is not the case, I hope you have already tried this -

instead of direct restart, do

/sbin/service httpd stop
/sbin/service httpd start

If that doesn't work, try

apachectl restart

or

apache2ctl restart

This ideally shouldn't make a difference, it executes the same command, but worth a try.

share|improve this answer
    
When I do 'Service httpd retsart', the server use '/etc/httpd/conf/httpd.conf' file instead of using '/usr/local/apache/conf/httpd.conf' file. –  Jake Jun 15 '12 at 8:54
    
I used to change '/usr/local/apache/conf/httpd.conf' this file before, and I don't know why it reads the other file. –  Jake Jun 15 '12 at 8:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.