[SOLVED] can't access Centos 7 apache server default page (Server not found)
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.
can't access Centos 7 apache server default page (Server not found)
Hello friends.
I installed httpd server package in my centos7 on vmware and i wanted test it to see apache default page from windows using browser
(e.g: http://192.168.1.128). I configed both vm and windows vmnet8 to get an automatic dhcp ip addresses. now my centos have 192.168.1.128 and windows vmnet8 have 192.168.1.1.
My httpd service is running and The netstat -ntpl | grep -i httpd output says that httpd listening on port *:80. I have ping of my centos from windows cmd but i can't ping windows from centos.
when i typing http://192.168.1.128 in firefox in windows to see apache default page it says server not found! also my centos hadn't any iptables installed and i used dhclient -r command to realease ip address.
I know that real estate agents like to say 'Location, location, location!' when selling properties. But I would tell you this: 'Logs, logs, logs' check your logs.
Check/post, from both, netstat -rn (yes, win 'run cmd' should be able to do this)
What exact win IPaddress# doesn't respond from centos?
Maybe look into `tcpdump` to make sure that win is *really* pinging centos
To me, it seems strange=bad that ping pkts [two-way: both paths *must* route ok!]
only work from win but not your centos: this may be the clue to what's wrong.
(on your centos, I assume: `telnet localhost 80` GET / works ok)
More: I don't know vmware, so I don't know how to configure; a web-search of:
vmware guest can't ping host but host can ping guest
returned lots, but wasn't precise enough, sorry. Here's one, of just two matches!, from quoting search: (but it has tons of vmware details)
vmware "guest can't ping host" but "host can ping guest"
Again, I'm not even sure I'm 'on the right track'. Other LQ'ers advice welcome here.
Check/post, from both, netstat -rn (yes, win 'run cmd' should be able to do this)
What exact win IPaddress# doesn't respond from centos?
Maybe look into `tcpdump` to make sure that win is *really* pinging centos
To me, it seems strange=bad that ping pkts [two-way: both paths *must* route ok!]
only work from win but not your centos: this may be the clue to what's wrong.
[root@localhost etc]# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.2.2 0.0.0.0 UG 0 0 0 eno16777736
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eno16777736
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
The ip address of windows vmnet8 interface is 192.168.2.1 , i saw it in its status --> details .and when i ping this ip from centos it doesn't response , just thinking , anything will not appear and then i press ctrl+c to stop it. one of my friends told me do these step by step but didn't worked :
Oooops, I added this (which will let you 'semi-see' your webserver!) while you were replying!
On your centos: (hopefully it has telnet installed)
telnet localhost 80
GET /
(there's no prompt!, where you type the GET / Don't let that confuse...)
I don't know/understand vmware "virbr0"; maybe posting about your vmware guest net config might enable *other* LQ'ers to advise...
that rm -rf command was for my friends system to delete previous alterations , let's skip that i didn't run it
that rm -rf was because some other alterations on his system was made and he not told me run that command on mine! so let's skip that , i didn't run itit's
I don't understand why you `rm -rf /var/www/html/index.html` (sounds [to me] like killing the homepage! But again, I don't know. *I'm learning too!*)
Awaiting your response about the above telnet localhost 80
p.s. try tcpdump
[root@localhost etc]# tcpdump
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on virbr0, link-type EN10MB (Ethernet), capture size 65535 bytes
^C
0 packets captured
0 packets received by filter
0 packets dropped by kernel
telnet output is this with no other output :
[root@localhost etc]# telnet localhost 80
Trying ::1...
Connected to localhost.
Escape character is '^]'.
GET/
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>501 Not Implemented</title>
</head><body>
<h1>Not Implemented</h1>
<p>GET/ to / not supported.<br />
</p>
</body></html>
Connection closed by foreign host.
can't access Centos 7 apache server default page (Server not found) Reply to Thread
that rm -rf command i didn't run , my friend said if any prevoius alteration you made run it do delete that, so i'm trying first time httpd and just installed it so i skipped that command!
That's your webserver replying! Cool! (research "telnet localhost 80" on the web!)
I think you need a space after the GET, before the / (GET / not GET/)
Now=next, put in a 'homepage' (to GET ... default is index.html). This should get you started as a 'webmaster'! Do you have a web-browser on your centos?
While that tcpdump was running, try the 'win firefox'. Then, add -i eno16777736 and try on win again.
tcpdump -i eno16777736
(sorry, I wish I knew vmware networking 'bridge magic'. I use VirtualBox [on my XP host]...)
by the way, I hope you're using actual .2. (on 'win firefox', not the example .1. net in OP):
"when I type http://192.168.2.128 in firefox in windows ..."
One more ...: see if win host can still ping centos guest with virbr0 down [other 192.168.122. net]:
win> ping 192.168.2.128 (to make sure it's still working)
# ifconfig virbr0 down
win> ping 192.168.2.128 (to see if it stops working)
IF it still works[!], try=check the 'firefox ...' (just in case it works now)
Assuming the ping stopped working,
# ifconfig virbr0 up; ifconfig (to check it's back)
win> ping 192.168.2.128 (to make sure it's back working)
This will confirm that something is going on with the ..122. that I don't understand.
Look at the *win host* `netstat -rn` What device is 192.168.2.2?
You're learning the basics of IP routing, and at least now have CLI access to your webserver
(while waiting for more expertise on the vmware networking). Also, you now have some webserver logs to study/learn.
by the way, I hope you're using actual .2. (on 'win firefox', not the example .1. net in OP):
"when I type http://192.168.2.128 in firefox in windows ..."
One more ...: see if win host can still ping centos guest with virbr0 down [other 192.168.122. net]:
win> ping 192.168.2.128 (to make sure it's still working)
# ifconfig virbr0 down
win> ping 192.168.2.128 (to see if it stops working)
IF it still works[!], try=check the 'firefox ...' (just in case it works now)
Assuming the ping stopped working,
# ifconfig virbr0 up; ifconfig (to check it's back)
win> ping 192.168.2.128 (to make sure it's back working)
This will confirm that something is going on with the ..122. that I don't understand.
Look at the *win host* `netstat -rn` What device is 192.168.2.2?
You're learning the basics of IP routing, and at least now have CLI access to your webserver
(while waiting for more expertise on the vmware networking). Also, you now have some webserver logs to study/learn.
on both cases (with and without virbr0) ping worked on windows --> ping 192.168.2.128
i think problem it's not because of virbr0.
can't access Centos 7 apache server default page (Server not found) Reply to Thread
[root@localhost html]#
[root@localhost html]# telnet localhost 80
Trying ::1...
Connected to localhost.
Escape character is '^]'.
GET /
<html>
<body>
<center> This is Fardad! </b> </center>
</body>
</html>
Connection closed by foreign host.
[root@localhost html]#
i tested on my centos firefox and showed "THIS IS FARDAD!" on both 127.0.0.1 and 192.168.2.128
i still have ping of 192.168.2.128 on my windows . i think the connectivity between win and centos have problem.
Oh! why not ipV4? Maybe 'normal' but I don't know, sorry...
maybe this [?] ... web-searching: tcp6 LISTEN httpd
...likely ok/normal.
Check with like putty on win: Does [host->guest] ssh work?
Oh! why not ipV4? You've almost solved it, maybe/hopefully!
(check with like putty on win)
i'm using puTTY currently . i think one thing on my windows doesn't allow tcp out connections. but it's strange that i have ping of centos 192.168.2.128 and while my windows is 192.168.2.1 , both are in same subnet so that they should ping each other. I Really don't know why i can't see my sample page i created on my windows firefox!!!! while trying: http://192.168.2.128
is i doing wrong?? my brain exploding
after loading so much windows firefox says: The connection has timed out
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.