Linux - Server This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
09-26-2008, 04:18 PM
|
#1
|
LQ Newbie
Registered: Feb 2004
Distribution: Slackware 10.2. Kernel 2.6.17
Posts: 21
Rep:
|
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.
|
|
|
09-26-2008, 04:30 PM
|
#2
|
LQ Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Rep: 
|
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.
|
|
|
09-26-2008, 05:51 PM
|
#3
|
Senior Member
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Rep: 
|
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.
|
|
|
09-26-2008, 08:42 PM
|
#4
|
LQ Newbie
Registered: Feb 2004
Distribution: Slackware 10.2. Kernel 2.6.17
Posts: 21
Original Poster
Rep:
|
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.
|
|
|
09-28-2008, 12:17 AM
|
#5
|
LQ Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Rep: 
|
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.
|
|
|
09-28-2008, 12:27 PM
|
#6
|
LQ Newbie
Registered: Feb 2004
Distribution: Slackware 10.2. Kernel 2.6.17
Posts: 21
Original Poster
Rep:
|
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.
|
|
|
09-28-2008, 03:00 PM
|
#7
|
LQ Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Rep: 
|
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
|
|
|
09-28-2008, 05:57 PM
|
#8
|
Senior Member
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Rep: 
|
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
|
|
|
10-02-2008, 11:21 AM
|
#9
|
LQ Newbie
Registered: Dec 2006
Posts: 17
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 02:03 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|