LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions
User Name
Password
Linux - Distributions This forum is for Distribution specific questions.
Red Hat, Slackware, Debian, Novell, LFS, Mandriva, Ubuntu, Fedora - the list goes on and on... Note: An (*) indicates there is no official participation from that distribution here at LQ.

Notices

Reply
 
Search this Thread
Old 01-14-2008, 10:52 PM   #1
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,400

Rep: Reputation: 53
How to get Apache 2 Test Page back - CentOS 5


Hi folks,


CentOS 5.0 x86_64 (Guest OS)
VMware Server
Ubuntu 7.04 server amd64 (Host OS)


On Firefox running
https://localhost (or http://localhost)

it switches automatically to http://en.wikipedia.org/wiki/Localhost. Not "Apache 2 Test Page powered by CentOS"


Previously it worked without problem. After playing around on networking trying to solve the problem of one way traffic "CentOS can connect Internet BUT Internet can't get in CentOS", it comes to present situation.


Please advise how to get the Test Page back. I need it for testing. TIA


B.R.
satimis
 
Old 01-15-2008, 12:59 AM   #2
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 73
The first thing to check is whether there is a correct entry for localhost in /etc/hosts.
 
Old 01-15-2008, 01:20 AM   #3
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,400

Original Poster
Rep: Reputation: 53
Quote:
Originally Posted by reddazz View Post
The first thing to check is whether there is a correct entry for localhost in /etc/hosts.
Thanks for your advice.


$ cat /etc/hosts
Code:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               centos.satimis.com centos
192.168.0.20            centos.satimis.com centos
::1             centos6.satimis.com6 centos6
$ hostname -f
Code:
centos.satimis.com

IP addr 192.168.0.20 is not working yet. I'm still trying making it to work on this virtual machine.


# ifconfig
Code:
eth0      Link encap:Ethernet  HWaddr 00:0C:29:1D:65:AD  
          inet addr:172.16.103.128  Bcast:172.16.103.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe1d:65ad/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:650 errors:0 dropped:0 overruns:0 frame:0
          TX packets:565 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:228188 (222.8 KiB)  TX bytes:88056 (85.9 KiB)
          Base address:0x1070 Memory:ec820000-ec840000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:560 (560.0 b)  TX bytes:560 (560.0 b)
"inet addr:172.16.103.128" is NAT IP. It only allow CentOS connect Internet BUT NOT the other way round.


B.R.
satimis
 
Old 01-15-2008, 01:30 AM   #4
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 73
Code:
127.0.0.1               centos.satimis.com centos
This is the cause of your problems. Try changing this to
Code:
127.0.0.1               centos.satimis.com centos localhost
 
Old 01-15-2008, 02:20 AM   #5
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,400

Original Poster
Rep: Reputation: 53
Quote:
Originally Posted by reddazz View Post
Code:
127.0.0.1               centos.satimis.com centos
This is the cause of your problems. Try changing this to
Code:
127.0.0.1               centos.satimis.com centos localhost
Your advice works for me. Thanks

Why it needs localhost there? Why w/o it changing to "http://en.wikipedia.org/wiki/Localhost"


satimis
 
Old 01-15-2008, 04:46 AM   #6
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 73
127.0.0.1 and localhost should be in your /etc/hosts because they are used to define the local machine hence the name localhost. Since you had removed the localhost name from the 127.0.0.1 IP address and replaced it with centos, the system could not resolve the name "localhost" to your local machine. I guess you were sent to wikipedia, because your browser searched on google for localhost and you were sent to the first available result.
 
  


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
CentOS apache test page geosko Linux - Server 21 10-14-2006 12:52 PM
Apache test page mpalazzini Linux - Software 2 10-03-2004 10:13 AM
Apache test page mpalazzini Linux - General 2 10-03-2004 10:12 AM
Apache test page mpalazzini Linux - Newbie 4 10-03-2004 12:21 AM
I cant change the default test page in apache server to add my page.y nhemapriya Linux - Newbie 3 05-13-2004 12:35 PM


All times are GMT -5. The time now is 09:39 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration