Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
# httpd -v
Server version: Apache/2.2.15 (Unix)
Server built: May 13 2013 22:11:16
I can access Apache by entering 127.0.0.1 on the local machine, but not by any other means. Not even by entering the systems IP address (192.168.1.109) from the local machine.
The system's name is "fir" I tried putting that in the config file.
Code:
# apachectl -k restart
[Wed Jul 17 03:12:00 2013] [error] (EAI 2)Name or service not known: Could not resolve host name fir -- ignoring!
[Wed Jul 17 03:12:00 2013] [error] (EAI 2)Name or service not known: Could not resolve host name fir -- ignoring!
httpd: apr_sockaddr_info_get() failed for Fir
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
I can access Apache by entering 127.0.0.1 on the local machine, but not by any other means. Not even by entering the systems IP address (192.168.1.109) from the local machine.
Check httpd.conf for the "Listen" directive and make sure it looks like:
This is likely an issue with your firewall which I addressed in this post. Though, that post does not address your issues of accessing the web service via local terminal since your rule "-A INPUT -i lo -j ACCEPT" addresses that correctly.
192.168.1.109 fir.somedomain fir #fir.somedomain (if their is any domain set up) otherwise fir only would suffice
127.0.0.1 localhost.localdomain localhost
**Note that the 127.0.0.1 is by default set up as localhost in /etc/hosts file, there is no sense of changing that.
This could be a firewall issue if still not resolved by above check as @Sag47 suggested. Also check if you are using any proxy.
Since this is CentOS, not Debian, do I edit /etc/hosts or /etc/sysconfig/network?
What does that mean ?
we are talking about linux.. whatever distro you have that doesnt makes a difference in the nature of the files and configuration that happens on linux.
See i have set up a test server and did'nt set up a hostname using /etc/sysconfig/network still i have my hostname set up as server.abhi.com and DNS too.
Code:
server ~]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=localhost.localdomain
server ~]# hostname
server.abhi.com
server ~]# host 192.168.31.128
128.31.168.192.in-addr.arpa domain name pointer server.abhi.com.
you want your machine to be identified by a specific name on a network then you should setup a DNS server and if just locally identification is the requirement then an entry in /etc/hosts would suffice.
Hope you got it now, this is how it works.
As an aside not related to your "ping" troubles, in iptables order in which the rules are implemented matters. Since "-A INPUT -j REJECT --reject-with icmp-host-prohibited" appears before "-A INPUT -p tcp --dport 80 -j ACCEPT" then it will get blocked before it ever reaches that rule. Reorganize it so that the "REJECT" rules are at the very bottom of your rule set.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.