Apache httpd starting issue regarding ServerName directive
After fresh installation of apache httpd 2.4, while starting the service I got this error:
# /etc/init.d/httpd restart
* Starting web server httpd
... waiting httpd: apr_sockaddr_info_get() failed for server
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
HOSTNAME=hs2.example.com
...
ServerName localhost
...
* Starting web server httpd
... waiting httpd: apr_sockaddr_info_get() failed for server
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
Even though my hostname in RHEL 6 is setup properly in /etc/sysconfig/network file:
# cat /etc/sysconfig/network
NETWORKING=yesHOSTNAME=hs2.example.com
To solve this issue, ServerName directive in the main httpd.conf need to be commented out and set as localhost:
# vim /etc/httpd/conf/httpd.confServerName ...
ServerName localhost
...
And now apache httpd restarting properly:
# /etc/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
Comments
Post a Comment