1

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.

2 Answers 2

1

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.

2
  • 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
    Commented Jun 15, 2012 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
    Commented Jun 15, 2012 at 8:54
0

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.

You must log in to answer this question.