LinuxQuestions.org
Visit Jeremy's Blog.
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 10-11-2016, 09:08 PM   #1
Fardad74
Member
 
Registered: Jan 2016
Posts: 50
Blog Entries: 1

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

Can anyone help me?
 
Old 10-12-2016, 01:00 AM   #2
c0wb0y
Member
 
Registered: Jan 2012
Location: Inside the oven
Distribution: Windows
Posts: 417

Rep: Reputation: 74
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.
 
Old 10-12-2016, 02:01 AM   #3
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
Blog Entries: 12

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

Last edited by Jjanel; 10-12-2016 at 02:28 AM.
 
Old 10-12-2016, 02:32 AM   #4
Fardad74
Member
 
Registered: Jan 2016
Posts: 50

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by Jjanel View Post
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 :

#ifconfig
#dhclient -r
#dhclient eno16777736
#ifconfig ------> vmnet8

Windows: Enable VMNET8 on Windows

Windows: ping <Linux_ip>


#service iptables stop ----> Disable Firewall(iptable)
#setenforce 0 (Disable SELinux)


#service httpd status
#service httpd start
#netstat -ntlp | grep -i httpd


#rm -rf /var/www/html/index.html

Windows: http://<LINUX_IP>


my current ifconfig status:

[root@localhost etc]# ifconfig
eno16777736: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.2.128 netmask 255.255.255.0 broadcast 192.168.2.255
inet6 fe80::20c:29ff:fe89:c9ea prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:89:c9:ea txqueuelen 1000 (Ethernet)
RX packets 22012 bytes 26637825 (25.4 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 11992 bytes 2148787 (2.0 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0


I just want see and test that Apache default page first in my life, i really want learn web servering

Last edited by Fardad74; 10-12-2016 at 02:33 AM.
 
Old 10-12-2016, 02:46 AM   #5
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
Blog Entries: 12

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

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

Last edited by Jjanel; 10-12-2016 at 02:54 AM.
 
1 members found this post helpful.
Old 10-12-2016, 02:58 AM   #6
Fardad74
Member
 
Registered: Jan 2016
Posts: 50

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by Jjanel View Post
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.

Last edited by Fardad74; 10-12-2016 at 03:03 AM.
 
Old 10-12-2016, 03:05 AM   #7
Fardad74
Member
 
Registered: Jan 2016
Posts: 50

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
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!
 
Old 10-12-2016, 03:07 AM   #8
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
Blog Entries: 12

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
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]...)

Last edited by Jjanel; 10-12-2016 at 04:06 AM.
 
1 members found this post helpful.
Old 10-12-2016, 03:40 AM   #9
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
Blog Entries: 12

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

Last edited by Jjanel; 10-12-2016 at 04:03 AM.
 
1 members found this post helpful.
Old 10-12-2016, 04:06 AM   #10
Fardad74
Member
 
Registered: Jan 2016
Posts: 50

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by Jjanel View Post
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.
 
Old 10-12-2016, 04:32 AM   #11
Fardad74
Member
 
Registered: Jan 2016
Posts: 50

Original Poster
Blog Entries: 1

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


[root@localhost html]# netstat -nplt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN 3087/dnsmasq
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1767/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1770/cupsd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2935/master
tcp6 0 0 :::80 :::* LISTEN 9960/httpd
tcp6 0 0 :::22 :::* LISTEN 1767/sshd
tcp6 0 0 ::1:631 :::* LISTEN 1770/cupsd
tcp6 0 0 ::1:25 :::* LISTEN 2935/master

Last edited by Fardad74; 10-12-2016 at 04:36 AM.
 
Old 10-12-2016, 04:37 AM   #12
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
Blog Entries: 12

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
You *ARE* a webmaster

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?

Last edited by Jjanel; 10-12-2016 at 05:03 AM.
 
1 members found this post helpful.
Old 10-12-2016, 04:51 AM   #13
Fardad74
Member
 
Registered: Jan 2016
Posts: 50

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
Angry

Quote:
Originally Posted by Jjanel View Post
You *ARE* a webmaster

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

Last edited by Fardad74; 10-12-2016 at 04:53 AM.
 
Old 10-12-2016, 04:55 AM   #14
Fardad74
Member
 
Registered: Jan 2016
Posts: 50

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by Jjanel View Post
You *ARE* a webmaster

Oh! why not ipV4? Maybe 'normal' but I don't know, sorry...

(check with like putty on win)
i don't know , i just installed httpd and then started this service , by default when i run netstat -nlpt it showed that v6!
 
Old 10-12-2016, 05:00 AM   #15
Fardad74
Member
 
Registered: Jan 2016
Posts: 50

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
...
Attached Thumbnails
Click image for larger version

Name:	Screenshot from 2016-10-12 13-27-53.jpg
Views:	358
Size:	56.0 KB
ID:	23224  
 
  


Reply

Tags
apache, httpd server, server


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
Virtual server only brings up default Apache page \/4A Linux - Server 2 12-29-2014 03:02 AM
web page on apache server query a MS Access database chackercon Programming 2 01-19-2010 10:22 AM
apache web server default page link tuxrules Linux - Newbie 9 07-10-2004 05:22 PM
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

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

All times are GMT -5. The time now is 11:59 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