LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-17-2013, 04:28 PM   #1
walterbyrd
Member
 
Registered: Apr 2004
Posts: 734

Rep: Reputation: 46
Apache not reachable on local network


I am running CentOS 6.4 x86_64

Code:
# 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
 
Old 07-17-2013, 05:09 PM   #2
Sydney
Member
 
Registered: Mar 2012
Distribution: Scientific Linux
Posts: 147

Rep: Reputation: 36
Try a /etc/hosts entry for fir. Do not remove or replace any entries.
127.0.0.1 fir
 
Old 07-18-2013, 08:31 AM   #3
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
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:
Code:
Listen 80
You may also add a
Code:
ServerName fir
so it stops complaining about it.
 
Old 07-25-2013, 10:49 AM   #4
sag47
Senior Member
 
Registered: Sep 2009
Location: Raleigh, NC
Distribution: Ubuntu, PopOS, Raspbian
Posts: 1,899
Blog Entries: 36

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
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.

Is the service listening on a port you expect?
Code:
netstat -nlp | grep '80\|httpd'
SAM

Last edited by sag47; 07-25-2013 at 10:53 AM.
 
Old 07-25-2013, 12:47 PM   #5
#root
Member
 
Registered: Mar 2013
Location: in my house
Distribution: Ubuntu,Backtrack,Fedora
Posts: 38

Rep: Reputation: 5
consider re installing apache
 
Old 07-26-2013, 12:11 AM   #6
SAbhi
Member
 
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 665

Rep: Reputation: Disabled
The entry in /etc/hosts should be :

Code:
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.
 
Old 07-26-2013, 10:45 AM   #7
walterbyrd
Member
 
Registered: Apr 2004
Posts: 734

Original Poster
Rep: Reputation: 46
Thanks for all the responses.

Listen in httpd.conf was already set to 80.

As to

ServerName fir

Do I just add that to the end of the file? There is no ServerName in my httpd.conf


Code:
# netstat -nlp | grep '80\|httpd'
tcp        0      0 :::80                       :::*                        LISTEN      2436/httpd          
unix  2      [ ACC ]     STREAM     LISTENING     18008  3111/clock-applet   /tmp/orbit-walter/linc-c27-0-77613d29e8734
unix  2      [ ACC ]     STREAM     LISTENING     18057  3171/gconf-im-setti /tmp/orbit-walter/linc-c63-0-795a43be8e7de


This was surprising. I feel certain I set the server name to 'fir' when I installed it.

Code:
[root@Fir conf]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
 
Old 07-27-2013, 02:31 AM   #8
SAbhi
Member
 
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 665

Rep: Reputation: Disabled
just set the entry in /etc/hosts as i suggested see the output:
your localhost entry is correct.
 
Old 07-27-2013, 12:03 PM   #9
walterbyrd
Member
 
Registered: Apr 2004
Posts: 734

Original Poster
Rep: Reputation: 46
Since this is CentOS, not Debian, do I edit /etc/hosts or /etc/sysconfig/network?

According to this, is should be network:

http://www.cyberciti.biz/faq/linux-s...-of-my-server/

Also, what do I use for a domain name? My DNS server is comcast (75.75.75.75) so do I use comcast.com or comcast.net or do I just make something up?

Should I set up my own DNS server?
 
Old 07-28-2013, 05:01 AM   #10
SAbhi
Member
 
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 665

Rep: Reputation: Disabled
Quote:
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.
 
Old 08-01-2013, 09:53 AM   #11
sag47
Senior Member
 
Registered: Sep 2009
Location: Raleigh, NC
Distribution: Ubuntu, PopOS, Raspbian
Posts: 1,899
Blog Entries: 36

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
Quote:
Originally Posted by walterbyrd View Post
Thanks for all the responses.

Listen in httpd.conf was already set to 80.

As to

ServerName fir

Do I just add that to the end of the file? There is no ServerName in my httpd.conf


Code:
# netstat -nlp | grep '80\|httpd'
tcp        0      0 :::80                       :::*                        LISTEN      2436/httpd          
unix  2      [ ACC ]     STREAM     LISTENING     18008  3111/clock-applet   /tmp/orbit-walter/linc-c27-0-77613d29e8734
unix  2      [ ACC ]     STREAM     LISTENING     18057  3171/gconf-im-setti /tmp/orbit-walter/linc-c63-0-795a43be8e7de


This was surprising. I feel certain I set the server name to 'fir' when I installed it.

Code:
[root@Fir conf]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
Did you not see my response? You have port 80 firewalled according to your own config.

https://www.linuxquestions.org/quest...6/#post4996603

Quote:
Originally Posted by sag47 View Post
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.

Last edited by sag47; 08-01-2013 at 09:55 AM.
 
  


Reply

Tags
apache, centos



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Network was Reachable, But ..... _ AsiF Linux - Networking 1 06-25-2007 11:06 PM
Install Apache on Local Network zdienos Linux - Networking 9 09-16-2006 10:31 AM
apache server not reachable from out of lan huntermix *BSD 6 08-04-2006 02:40 PM
Apache server works, but only on my local network munchies Linux - Networking 4 04-07-2004 09:18 AM
Getting a network not reachable in suse 8.1 TyrranzzX Linux - Networking 1 12-22-2003 09:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration