LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Distributions (https://www.linuxquestions.org/questions/linux-distributions-5/)
-   -   How to get Apache 2 Test Page back - CentOS 5 (https://www.linuxquestions.org/questions/linux-distributions-5/how-to-get-apache-2-test-page-back-centos-5-a-613607/)

satimis 01-14-2008 10:52 PM

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

reddazz 01-15-2008 12:59 AM

The first thing to check is whether there is a correct entry for localhost in /etc/hosts.

satimis 01-15-2008 01:20 AM

Quote:

Originally Posted by reddazz (Post 3022791)
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

reddazz 01-15-2008 01:30 AM

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

satimis 01-15-2008 02:20 AM

Quote:

Originally Posted by reddazz (Post 3022813)
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

reddazz 01-15-2008 04:46 AM

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.


All times are GMT -5. The time now is 05:41 PM.