Join 3,559 readers in helping fund MetaFilter (Hide)


pound is not playing nice. :(
December 8, 2010 7:29 PM   Subscribe

Can you help me use pound as a reverse proxy and load balancer?

I have a server running Debain with Hiawatha Webserver and Pound installed. I have hiawatha listening on port 8080. "wget 127.0.0.1" downloads the page i currently have up there, so I know for sure that hiawatha is working. I'm trying to get Pound to listen at port 80 and pass on hiawatha, i.e., proxy to port 80.

Here is pound.cfg.

It's not working at the moment. "wget 127.0.01:80" gets "Connecting to 127.0.0.1:80... failed: Connection refused." It's not an issue with port 80 because hiawatha works fine if I configure it to listen at port 80 and stop pound. I'm also pretty sure it's not a firewall or port forwarding problem. I have restarted pound since I changed to configuration file.

I want to maybe eventually use load balancing. The big thing right now, though, is that I want to be able to have some other web application (like Diaspora or etherpad) listening at a port that is not port 80 and to be able to proxy it over to a domain name. If I can't this simple configuration to work, though, something tells me that won't work either. I would be forever grateful if you could tell me (a) what I'm doing wrong or (b) a different, simple way to do what I'm trying to do. Thanks!
posted by wayland to Computers & Internet (5 answers total)
 
When I have this kind of trouble (not that I've ever used pound or hiawatha) it's generally turned out to be that the service involved has either stopped running, or didn't actually stop at all when I asked it to and is still using config settings I wasn't expecting. You might get some clues by turning hiawatha off and then running an nmap scan against 127.0.0.1.
posted by flabdablet at 11:29 PM on December 8, 2010


And netstat -ltn will show you which TCP ports are currently accepting connections.
posted by flabdablet at 11:31 PM on December 8, 2010


Given you're getting "connection refused" on port 80 it looks like pound isn't listening there at all. If pound was running but couldn't reach the backend you'd get an error message from pound instead of a failed connection.

As flabdablet says, netstat will tell you what ports are being listened on. "sudo lsof -c pound" will tell you what pound is doing - there should be a line with "IPv4" in the "TYPE" column, "TCP" in the "NODE" column, and "127.0.0.1:www (LISTEN)" in the "NAME" column.

Is pound even running? Does it show up in a ps list? I'd also check /var/log/syslog for lines containing "pound" to see if it's been complaining about anything.


As an aside, re: pound and host-based forwarding. pound is very picky about being able to resolve the names used for host-based forwarding. If you have a Service section like so
Service HeadRequire "Host: test.foo.com" BackEnd Address 127.0.0.1 Port 19988 TimeOut 120 End End
then pound must be able to resolve test.foo.com through DNS - you can't just put it in /etc/hosts on the server and test client and have it work. Took me ages to work out why I couldn't get a new test system working through our pound balancer.
posted by russm at 1:50 AM on December 9, 2010


flabdablet was right; pound not have stopped running from before I configured it. I rebooted and everything worked as expected. Thanks!
posted by wayland at 11:48 AM on December 9, 2010


pgrep pound will be your friend, then. If you do that before and after the service pound restart you issue after messing with the config, you should see that pound's process ID has changed. If it hasn't, then

service pound stop
pid=$(pgrep pound)
kill $pid
sleep 5
kill -9 $pid
service pound start


should see you right without rebooting.

Note that I have never used pound, and that I can't be sure that the pound daemon will actually have "pound" in its name. If you know pound is running but pgrep pound doesn't get you a PID, you will need to find out what the daemon's executable's name is and use that instead.
posted by flabdablet at 11:58 PM on December 9, 2010


« Older I need help denim size equival...   |  I'd like to do some restorativ... Newer »
This thread is closed to new comments.