LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 09-26-2008, 04:18 PM   #1
fiacobelli
LQ Newbie
 
Registered: Feb 2004
Distribution: Slackware 10.2. Kernel 2.6.17
Posts: 21

Rep: Reputation: 15
web application on port 8080


Hello,

I am trying to setup a web application on port 8080. When I run the app, I can open firefox and go to localhost:8080 without a problem, but if I try to connect from another machine I get a "connection refused" error.

I can serve webpages through apache on any port I want, but when I use cherrypy (a python webserver) I can't.

nmap returns:
Not shown: 1709 closed ports
PORT STATE SERVICE
22/tcp open ssh
37/tcp open time
80/tcp open http
113/tcp open auth
631/tcp open ipp
8080/tcp open http-proxy

How can I make it so that browsers on other machines can see my app in 8080? What does it mean that the service is http-proxy?


Thanks a lot!
Francisco.
 
Old 09-26-2008, 04:30 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
If you can connect locally, but you get "connection refused" remotely ... then the problem is almost certainly a firewall.

Double-check for all firewalls on and between your two hosts:

- software firewalls (like Linux IPtables, Windows firewall, your AntiVirus program's firewall, etc)
... and ...
- hardware firewalls (routers in your Enterprise, your DSL modem, your wireless base station, etc etc)

Somebody (or, quite possibly, multiple some-bodies) appear to be blocking port 8080.

Good luck!

PS:
You aren't doing any of this, are you:
http://tools.cherrypy.org/wiki/BehindApache

PPS:
I believe that if you were using Squid (for example), that would show as "http-proxy":
http://nmap.org/book/nmap-overview-and-demos.html

Last edited by paulsm4; 09-26-2008 at 04:45 PM.
 
Old 09-26-2008, 05:51 PM   #3
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by fiacobelli
nmap returns:
...
8080/tcp open http-proxy
Where did you run nmap from? Another box? (If yes, this is not a firewall issue.) Or did you run it against localhost? (If yes, the scan told you little of value. Try it from another box.)

More useful would be if you posted the output of:
$ netstat -ltn

Then we could see which interfaces you have the service bound to.

Quote:
Originally Posted by fiacobelli
What does it mean that the service is http-proxy?
IIRC, nmap is simply resolving tcp 8080 to its /etc/services entry.
 
Old 09-26-2008, 08:42 PM   #4
fiacobelli
LQ Newbie
 
Registered: Feb 2004
Distribution: Slackware 10.2. Kernel 2.6.17
Posts: 21

Original Poster
Rep: Reputation: 15
output of netstat and nmpap

Hello,

the output of netstat from localhost is:

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:37 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:8080 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:113 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:36373 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN




The output of nmap from a different computer in the same network:

Not shown: 1693 closed ports
PORT STATE SERVICE
22/tcp open ssh
37/tcp open time
80/tcp open http
113/tcp open auth

Nmap finished: 1 IP address (1 host up) scanned in 0.136 seconds


The weird thing is that if I configure apache to listen on 8080 I can serve webpages to the outside. I cannot do that with cherrypy.
 
Old 09-28-2008, 12:17 AM   #5
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
anomie -

Can you recommend any good, in-depth resources on using nmap and interpreting the results? For example, I wasn't able to find any references on exactly what it means by "http-proxy", or how it got that result. I know, of course, what an http proxy is in general. But I *don't* know how nmap determined there was a proxy. Or what (if anything) it means for this problem. I'd definitely like to learn more about nmap - any suggestions would definitely be appreciated.

fiacobelli -

If anomie hadn't said otherwise, I'd still say this sounds very much like a firewall issue. But I'm prepared to be wrong ;-)

... now ...
Quote:
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:37 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:8080 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
...
This means that the listener on port 80 (or port 37, for that matter) will accept connections from any IP (which is why you're able to connect from other hosts)...
... but the listener on port 8080 is only listening on the loopback address (127.0.0.1). So it will only accept connections from "localhost".

And that's definitely OK. If you have a "proxy", and it's correctly configured. Like maybe Apache?

I would encourage you to look at these two links:
http://tools.cherrypy.org/wiki/BehindApache
http://tools.cherrypy.org/wiki/ModRewrite

Last edited by paulsm4; 09-28-2008 at 12:25 AM.
 
Old 09-28-2008, 12:27 PM   #6
fiacobelli
LQ Newbie
 
Registered: Feb 2004
Distribution: Slackware 10.2. Kernel 2.6.17
Posts: 21

Original Poster
Rep: Reputation: 15
Thanks paulsm and anomie,

However, I still don't get the results I am looking for. Basically, I want to start cherrypy on any port and point a web browser to my machine on that port and have cherrypy serve the request.

My httpd.conf has no lines for proxy configuration, except for loading the modules.

Any ideas? I looked into iptables -L and there are no rules for input, forward and output.


Thanks.
 
Old 09-28-2008, 03:00 PM   #7
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
fiacobelli -

Please do the following:
1. Take a look at this link:
http://www.cherrypy.org/wiki/ConfigAPI

... and briefly look again at these two links:
http://tools.cherrypy.org/wiki/BehindApache
http://tools.cherrypy.org/wiki/ModRewrite

2. Tell us exactly:
a) What version of CherryPy do you have?
b) What platform, OS and OS version?

3. Can you find your CherryPy configuration file(s)
<= Do you have one or more "cherrypy.config" files?

4. Does it have a section that looks like this:
Quote:
[global]
server.socket_host: '0.0.0.0'
You're definitely interested in "[global], server.socket_host", and it should definitely *not* say "127.0.0.1" or "localhost".

Please keep us posted...

'Hope that helps .. PSM
 
Old 09-28-2008, 05:57 PM   #8
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
To revisit what started this thread:

Quote:
Originally Posted by fiacobelli
I can open firefox and go to localhost:8080 without a problem, but if I try to connect from another machine I get a "connection refused" error.
That's because your service is listening for connections to tcp port 8080 on localhost only. If you want to connect to it from other boxes on your network, the service needs to be bound to an external interface. (Or all interfaces.)

The required configuration changes may have already been posted by paulsm4 -- I'm not really familiar with the service you're trying to run.

---

Quote:
Originally Posted by paulsm4
Can you recommend any good, in-depth resources on using nmap and interpreting the results?
The manpages for nmap(1) are actually a very thorough resource. It's not exactly an exciting read, but if you review it from top to bottom you'll have a good feel for available options. Some practical examples are provided as well.

Don't quote me on this, but nmap appears to resolve service ports to names using a file called 'nmap-services'. On my FreeBSD 7.0 box, this lives at: /usr/local/share/nmap/nmap-services. You may need to review the packing list / package file locations on your own OS to find it.

Code:
% grep 8080 /usr/local/share/nmap/nmap-services
http-proxy        8080/tcp   # Common HTTP proxy/second web server port
 
Old 10-02-2008, 11:21 AM   #9
skaynum
LQ Newbie
 
Registered: Dec 2006
Posts: 17

Rep: Reputation: 0
I think your web server is only listening on the local loop back interface 127.0.0.1 that's where the main issue is.For the issue about HTTP-proxy on nmap the proxy term arises from the case that some proxy servers run on port 8080 apart from the famous 3128 in squid.
 
  


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
Web application: cocoon jsp/servlet tomcat all in web application adilturbo Programming 0 11-24-2007 06:00 PM
access 8080 web server port through squid running on 8080 sunethj Linux - Networking 11 05-18-2007 02:38 AM
debian iptables squid - redirect port 80 to port 8080 on another machine nickleus Linux - Networking 1 08-17-2006 12:59 AM
Port 80-->8080?? flamesrock Linux - Software 4 08-01-2004 01:40 AM
firewall.rc.config says :"open port 8080" but nmap says port is closed saavik Linux - Security 2 02-14-2002 12:16 PM

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

All times are GMT -5. The time now is 02:03 AM.

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