LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-12-2007, 11:39 AM   #1
esimuro
LQ Newbie
 
Registered: Nov 2007
Posts: 4

Rep: Reputation: 0
Question Can't get Firefox to connect to localhost but can get to outside web sites


I just installed fedora Core 7 and out of the box firefox was able to connect to both localhost and to outside web sites. I attempted to change the hostname from localhost.localdomain to linuxserver.localdomain and rebooted the system. Now firefox can no longer resolve localhost but can go to external sites. I have attempted to restore everything to the way it was at installation but have not been able to connect to the localhost address again. Does anyone know how to restore to the install configuration, I can of course repeat the install but would prefer not to because I installed PHP mySql and Apache and have data in the database.
 
Old 11-12-2007, 11:59 AM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
The output of the following commands would be useful to read.
cat /etc/hosts
cat /etc/hostname

And welcome to LQ!
 
Old 11-12-2007, 03:15 PM   #3
esimuro
LQ Newbie
 
Registered: Nov 2007
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by tredegar View Post
The output of the following commands would be useful to read.
cat /etc/hosts
cat /etc/hostname

And welcome to LQ!
A cat of /etc/hosts gives the following relevant data

127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6


There is no hostname file in /etc
 
Old 11-12-2007, 04:08 PM   #4
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Quote:
There is no hostname file in /etc
Then things are not as they should be I am surprised your computer is running at all.
Unless FC is completely different from "normal" linux distros (which I doubt, but I am not familiar with FC), the following might sort it out:
All this has to be done as root:
First create the hostname file:
Code:
touch /etc/hostname
Than give it the right permissions:
Code:
chmod 644 /etc/hostname
And ownership:
Code:
chown root:root /etc/hostname
Now either edit /etc/hostname with your preferred editor to read like this (it's just one line):
linuxserver
Or, even easier because it is just one line:
Code:
echo linuxserver > /etc/hostname
Now edit /etc/hosts and make it look like this:
Code:
127.0.0.1 linuxserver.localdomain  localhost  linuxserver
That means that 127.0.0.1 (the "loopback address") is pointed to by linuxserver.localdomain and localhost and linuxserver
If you are not using IPv6 (and nobody seems to be, yet, I am awaiting the "Great Migration" (and possible "Great Chaos")) you do not need the next line that starts with ::1 and you can safely delete it, or leave it, until chaos hits us

Now reboot. Linux doesn't often need rebooting like windows does, but it does need a reboot if you have changed the hostname, because this is essential to many processes.

Then you should be good to go
If further problems, please come back here.
 
Old 11-12-2007, 08:14 PM   #5
esimuro
LQ Newbie
 
Registered: Nov 2007
Posts: 4

Original Poster
Rep: Reputation: 0
Thumbs down

Quote:
Originally Posted by tredegar View Post
Then things are not as they should be I am surprised your computer is running at all.
Unless FC is completely different from "normal" linux distros (which I doubt, but I am not familiar with FC), the following might sort it out:
All this has to be done as root:
First create the hostname file:
Code:
touch /etc/hostname
Than give it the right permissions:
Code:
chmod 644 /etc/hostname
And ownership:
Code:
chown root:root /etc/hostname
Now either edit /etc/hostname with your preferred editor to read like this (it's just one line):
linuxserver
Or, even easier because it is just one line:
Code:
echo linuxserver > /etc/hostname
Now edit /etc/hosts and make it look like this:
Code:
127.0.0.1 linuxserver.localdomain  localhost  linuxserver
That means that 127.0.0.1 (the "loopback address") is pointed to by linuxserver.localdomain and localhost and linuxserver
If you are not using IPv6 (and nobody seems to be, yet, I am awaiting the "Great Migration" (and possible "Great Chaos")) you do not need the next line that starts with ::1 and you can safely delete it, or leave it, until chaos hits us

Now reboot. Linux doesn't often need rebooting like windows does, but it does need a reboot if you have changed the hostname, because this is essential to many processes.

Then you should be good to go
If further problems, please come back here.


Did what you suggested but the situation persists, I can contact outside web sites but I am unable to connect to the local machine "localhost". Any other suggestions?
 
Old 11-12-2007, 08:20 PM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
Fedora Core doesn't use /etc/hostname or /etc/HOSTNAME. Look at /etc/sysconfig/network. There should be a line defining the hostname.

Can you double check that the apache service is running?

Also try pinging localhost.

Last edited by jschiwal; 11-12-2007 at 08:22 PM.
 
Old 11-14-2007, 02:54 PM   #7
esimuro
LQ Newbie
 
Registered: Nov 2007
Posts: 4

Original Poster
Rep: Reputation: 0
Thumbs down

I appreciate all the help but I am still having grief.
A cat of /etc/hosts gives the following:
# Do not remove the following line, or various programs
# that require network functionality will fail.
#
127.0.0.1 linuxserver.localdomain localhost linuxserver
# ::1 localhost6.localdomain6

A cat of /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=linuxserver.localdomain

if I ping localhost I get the following:
ping localhost
PING linuxserver.localdomain (127.0.0.1) 56(84) bytes of data.
64 bytes from linuxserver.localdomain (127.0.0.1): icmp_seq=1 ttl=64 time=0.130 ms
64 bytes from linuxserver.localdomain (127.0.0.1): icmp_seq=2 ttl=64 time=0.128 ms

--- linuxserver.localdomain ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.127/0.128/0.130/0.009 ms


A cat of error_log (I believe this is the apache error log file shows the following error:
[Tue Nov 13 09:25:04 2007] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "localhost.localdomain"


Any Ideas on what I could have (*($(&$ up to produce this problem.
 
Old 11-14-2007, 04:51 PM   #8
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Apologies from me - my advice was not applicable to your distro (FC), as jschiwal pointed out.

Different linux distros do things differently. It's a pain, but you get used to it.

Here's a link that I think should help you, it spells out the differences between FC and Debian ((K)ubuntu): http://www.yolinux.com/TUTORIALS/Lin...etworking.html

Please read it, follow it, and get back here if you have further problems reconfiguring your hostname
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Debian4. Won`t connect to web sites. AlanL Debian 12 06-23-2007 04:15 AM
Internet Explorer web sites on Firefox alawor Linux - General 2 06-09-2007 06:37 PM
Cannot connect to secure sites after update to Firefox 1.5.0.7 solar1951 Linux - Software 3 09-17-2006 07:19 AM
Firefox cannot read Greek web sites props666999 Linux - General 1 06-22-2005 11:20 AM
I Can Connect to Some Web Sites, But Not Others oostevo Linux - General 5 10-29-2001 09:57 PM


All times are GMT -5. The time now is 03:51 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration