LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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
 
LinkBack Search this Thread
Old 12-16-2013, 03:38 AM   #16
nickn0ck123
LQ Newbie
 
Registered: Dec 2013
Posts: 13

Original Poster
Rep: Reputation: Disabled

Quote:
Originally Posted by berndbausch View Post
When you successfully telnet to port 80, what prompts or messages do you get? Are you sure this telnet goes to your server or is answered by some other server?
Same question when you run telnet localhost 80 on the server in question.

On my system, this is what happens when I run telnet on the server:
Code:
# telnet 192.168.1.5 80
Trying 192.168.1.5...
Connected to 192.168.1.5.
Escape character is '^]'.
blabla
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>501 Method Not Implemented</title>
</head><body>
<h1>Method Not Implemented</h1>
<p>blabla to / not supported.<br />
</p>
<hr>
<address>Apache/2.2.15 (CentOS) Server at athlon64/192.168.1.5 Port 80</address>
</body></html>
Connection closed by foreign host.
The "blabla" string is my input, the lines after it come from httpd. You can customise the identification line (<address>) using ServerName in the config file.

This telnet session generated an entry [error] [client 192.168.1.5] Invalid method in request blabla in the error log /etc/httpd/logs/error_log.
here is the only answer i get from telnet sir

telnet 192.168.1.213 80
Trying 192.168.1.213...
Connected to 192.168.1.213.
Escape character is '^]'.
Connection closed by foreign host.

i didnt get the blabla response like you have
 
Old 12-16-2013, 03:48 AM   #17
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,220

Rep: Reputation: 116Reputation: 116
But that is telnet to your private ip!
We need to see what happens when you connect from outside!
So please, give valid information:
1) dig <your.hostname>
2) Whois <your.hostname>
3) telnet <public ip> 80
Watch the log for apache while connecting to your webserver:
# tail -f /var/log/httpd/error.log (I think it's correct path, could be /var/log/apache2/error.log)
 
Old 12-16-2013, 04:39 AM   #18
nickn0ck123
LQ Newbie
 
Registered: Dec 2013
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pingu View Post
But that is telnet to your private ip!
We need to see what happens when you connect from outside!
So please, give valid information:
1) dig <your.hostname>
2) Whois <your.hostname>
3) telnet <public ip> 80
Watch the log for apache while connecting to your webserver:
# tail -f /var/log/httpd/error.log (I think it's correct path, could be /var/log/apache2/error.log)
here is the dig information sir


; <<>> DiG 9.3.6-P1-RedHat-9.3.6-16.P1.el5 <<>> www.mrmstudios.tk
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 46298
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;www.mrmstudios.tk. IN A

;; ANSWER SECTION:
www.mrmstudios.tk. 300 IN A 123.136.73.42

;; Query time: 375 msec
;; SERVER: 128.242.54.18#53(128.242.54.18)
;; WHEN: Mon Dec 16 10:35:00 2013
;; MSG SIZE rcvd: 51

on telnet its connecting but its all black

on apache server here is the error log..



[Mon Dec 16 18:05:55 2013] [error] [client 192.168.1.3] Directory index forbidden by Options directive: /var/www/html/
[Mon Dec 16 18:10:02 2013] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Mon Dec 16 18:15:01 2013] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Mon Dec 16 18:16:04 2013] [error] [client 192.168.1.3] Directory index forbidden by Options directive: /var/www/html/
[Mon Dec 16 18:20:02 2013] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Mon Dec 16 18:25:01 2013] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Mon Dec 16 18:30:01 2013] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
[Mon Dec 16 18:30:34 2013] [error] [client 192.168.1.1] Invalid method in request \xff\xf4\xff\xfd\x06\xff\xf4\xff\xfd\x06
[Mon Dec 16 18:31:25 2013] [error] [client 192.168.1.1] Invalid method in request \xff\xf4\xff\xfd\x06
[Mon Dec 16 18:35:02 2013] [error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
 
Old 12-16-2013, 04:46 AM   #19
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,220

Rep: Reputation: 116Reputation: 116
Ah, I think I know!
You see, it's working for me, I get Apache 2 Test Page when I connect to www.mrmstudios.tk
My guess is, are you trying from a computer in the same LAN as the webserver? If so the firewall needs to be configured to allow traffic that goes out & in on same interface.
On pfSense for instance, this is handled by a special rule "Enable automatic outbound NAT for Reflection".
Normally this is not allowed as it puts unnecessary load on the firewall.
 
Old 12-16-2013, 06:12 AM   #20
nickn0ck123
LQ Newbie
 
Registered: Dec 2013
Posts: 13

Original Poster
Rep: Reputation: Disabled
i think i got it too. i just use host as my DNS /etc/hosts on my firewall and direct traffic from there.

im not so sure though if its now working properly

can u access it already sir pingu? have you seen the apache testpage for centos? i think its working. i just need to forward other ports to my server. hehehe
 
Old 12-16-2013, 06:15 AM   #21
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,220

Rep: Reputation: 116Reputation: 116
Yes it's working from outside, I get the Apache testpage for Centos.
 
Old 12-16-2013, 09:03 AM   #22
berndbausch
Member
 
Registered: Nov 2013
Distribution: Redhat, Centos, LFS, Raspbian
Posts: 219

Rep: Reputation: 37
Quote:
Originally Posted by pingu View Post
Yes it's working from outside, I get the Apache testpage for Centos.
same here, I can access the page. You seem to have trouble getting out of your network, not in.
 
Old 12-16-2013, 09:41 PM   #23
nickn0ck123
LQ Newbie
 
Registered: Dec 2013
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by berndbausch View Post
same here, I can access the page. You seem to have trouble getting out of your network, not in.
i think i finally got it working. what i need is the internal DNS to direct traffic from the inside? is that right?
 
Old 12-16-2013, 11:40 PM   #24
berndbausch
Member
 
Registered: Nov 2013
Distribution: Redhat, Centos, LFS, Raspbian
Posts: 219

Rep: Reputation: 37
Quote:
Originally Posted by nickn0ck123 View Post
i think i finally got it working. what i need is the internal DNS to direct traffic from the inside? is that right?
You need to:
  1. have a way of translating the name www.mrmstudios.tk to the correct IP address. Usually this requires DNS, internal or external. This seems to be OK, otherwise your dig command wouldn't work.
  2. be able to contact the IP address of your server 123.136.73.42 at port 80. Telnet is one way of trying this out, or simply enter the IP address in the browser.

So you have it working? No errors or timeouts? From here, the site is still accessible. Via telnet:

Code:
$ telnet 123.136.73.42 80
Trying 123.136.73.42...
Connected to 123.136.73.42.
Escape character is '^]'.
this is my input to test the web server
HTTP/1.1 400 Bad Request
Date: Tue, 17 Dec 2013 05:34:55 GMT
Server: Apache/2.2.15 (CentOS)
Content-Length: 312
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
</p>
<hr>
<address>Apache/2.2.15 (CentOS) Server at server.mrmstudios.tk Port 80</address>
</body></html>
Connection closed by foreign host.
 
Old 12-16-2013, 11:53 PM   #25
SAbhi
Member
 
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 516

Rep: Reputation: 58
Yeah that's the firewall outbound connection fail error in the logs.
So its nice to hear you made it work finally, now you should got why i was asking for the logs and why they are this important to share.

Enjoy..
 
Old 12-17-2013, 01:19 AM   #26
nickn0ck123
LQ Newbie
 
Registered: Dec 2013
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by SAbhi View Post
Yeah that's the firewall outbound connection fail error in the logs.
So its nice to hear you made it work finally, now you should got why i was asking for the logs and why they are this important to share.

Enjoy..
yes sir. thanks very much. i thought i dont need an internal DNS for this. im wrong hehehe.

Thanks for the replies ill ask again for more questions nextime sir
 
Old 12-17-2013, 01:27 AM   #27
nickn0ck123
LQ Newbie
 
Registered: Dec 2013
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by berndbausch View Post
You need to:
  1. have a way of translating the name www.mrmstudios.tk to the correct IP address. Usually this requires DNS, internal or external. This seems to be OK, otherwise your dig command wouldn't work.
  2. be able to contact the IP address of your server 123.136.73.42 at port 80. Telnet is one way of trying this out, or simply enter the IP address in the browser.

So you have it working? No errors or timeouts? From here, the site is still accessible. Via telnet:

Code:
$ telnet 123.136.73.42 80
Trying 123.136.73.42...
Connected to 123.136.73.42.
Escape character is '^]'.
this is my input to test the web server
HTTP/1.1 400 Bad Request
Date: Tue, 17 Dec 2013 05:34:55 GMT
Server: Apache/2.2.15 (CentOS)
Content-Length: 312
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
</p>
<hr>
<address>Apache/2.2.15 (CentOS) Server at server.mrmstudios.tk Port 80</address>
</body></html>
Connection closed by foreign host.
yes sir i finally got it to work. and now. i dont know where to locate the website sample XD i have ISP config3 installed on my server. i am currently testing it.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Anyone on my internet can't access my self-hosted website bengalman211 Linux - Server 6 09-30-2013 09:43 PM
[SOLVED] cant access my website hosted in my server sudeep_mansh Linux - Networking 6 07-26-2013 08:00 AM
my website hosted from home pmarian Linux - Newbie 9 11-13-2010 01:08 PM
viewing an externally hosted website from within a given website andrews-mark Linux - Server 6 10-07-2008 12:11 AM
Virtual hosted website not found toes Linux - Networking 7 07-14-2006 03:11 PM


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