Finally found a solution for my own problem. And that too in some modsecurity configuration files. The culprit here was a file named modsecurity_crs_21_protocol_anomalies.conf in /etc/httpd/ directory. Checked through the logs just to find an error marked as SEVERE which had a message "Host header is a numeric IP address".
To get rid of it, I commented out the line which filtered out requests coming for specific IP address, 127.0.0.1 included. I'd like to mention here that my apache web server showed up on the same machine on hitting http://localhost
but not after hitting on http://127.0.0.1
. The line that I commented out was as follows:
# Check that the host header is not an IP address
SecRule REQUEST_HEADERS:Host "^[\d\.]+$" "phase:2,t:none,deny,log,auditlog,status:400,msg:'Host header is a numeric IP address', severity:'2',id:'960017',tag:'PROTOCOL_VIOLATION/IP_HOST'"
Thanks for all those who actively participated in the discussion!