Unable to restart apache on centos

I have a centos VM and httpd -v gives me following output

Server version: Apache/2.2.15 (Unix)
Server built:   Oct 16 2014 14:48:21

I shut down the server by using command: sudo /etc/init.d/httpd stop

Now when I try to start the server, I get following error:

Starting httpd: httpd: apr_sockaddr_info_get() failed for bslm-022.corp.day.com
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
no listening sockets available, shutting down
Unable to open logs
                                                           [FAILED]

What I have read online here is that I should add ServerName localhost in /etc/apache2/httpd.conf file. But there is no directory named /etc/apache2 on my VM.

The content of /etc/hosts file are:

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

The result of $hostname command is:

bslm-022.corp.day.com

I want the apache server to run on localhost for me.

Upvotes: 0

Views: 1615

Answers (1)

ashleymaloney
ashleymaloney

Reputation: 26

Make sure in your httpd.conf has "Listen 80" or in any of your conf files in /etc/httpd/conf.d/*

If it does then look at netstat to see what's listening

netstat -tunlp

Upvotes: 1

Related Questions