I have a small personal site hosted on Unix (using a common hosting account).

My experience with Unix is limited (too bad). Recently I set up a httpd server running on port 8082 (not Apache - but an Apache server is already running on port 80 by default). It appears to be running (judging from the "ps" output). I thought that I would be able to get web pages from this httpd server in the URL www.mysite.com:8082/test... but I don't.

I don't know what is going wrong, and worse, I don't know what to look for! Maybe I am overlooking something trivial?

Any help will be very welcome!

link|improve this question
You are running on port 8082 and trying to open an url in port 8080? is this correct or was a typo? – coelhudo Dec 30 '09 at 18:27
1  
ServerFault would be the better place for this question, since it has nothing to do with code you wrote - serverfault.com – Heather Dec 30 '09 at 18:28
Yeah, SO faq, section "What kind of questions should I not ask here?" – coelhudo Dec 30 '09 at 18:30
1  
Might be a firewall at the hosting provider - 80 is well-known port for http, 8080 (or 8082?) might be blocked. – Nikolai N Fetissov Dec 30 '09 at 18:45
feedback

migrated from stackoverflow.com Dec 30 '09 at 18:57

This question came from our site for professional and enthusiast programmers.

6 Answers

You said "running on port 8082" then you said "www.mysite.com:8080/test". If you're running on port 8082, then you have to specify port 8082, not port 8080.

I find the unix command "HEAD" (not "head", so this doesn't work on Mac OS X) very helpful in debugging web problems. Or just learn how to telnet to the port and issue http commands.

   telnet localhost 8082
   GET / http/1.1
link|improve this answer
feedback

Did you take a look at the log files of your webserver? Perhaps the access or error log has something useful to report.

link|improve this answer
feedback

Also check to make sure there's not a firewall outside the server or iptables.

Check locally with

iptables -nL

Or

fctl -sr

if your'e using a BSD variant with pf.

link|improve this answer
feedback

is there any particular reason you're running a whole extra instance of apache rather than using port/name based virtual hosts?

link|improve this answer
Can't comment below (only 44). if you're having problems understanding telnet HTTP requests (grr) you could probably install a text based browser on that machine and look at it that way (lynx and links2 are favorites). Also, your telnet is getting through, if then failing; so thats a bonus. can you run the same command from a remote box? – MidnighToker Dec 30 '09 at 20:37
feedback

@MidnightToker : it's not Apache, it is another web server.

@Seth : I cannot run these commands. Probably because this is a hosting account (I SSH to it)

@Paul Tomblin : Helpful, thank you. The output of telnet was unexpected though :

telnet 127.0.0.1 8082
Trying 127.0.0.1...
Connected to localhost (127.0.0.1).
Escape character is '^]'.
GET / http/1.1
HTTP/0.0 400 Bad Request
Date: Wed, 30 Dec 2009 19:22:50 GMT
Content-Type: text/html
Connection: close
Content-Length: 89

<html><head><title>Bad Request</title></head><body><h1>400 Bad Request</h1></body></html>Connection closed by foreign host.

I don't make much of it, I'm afraid.

UPDATE: The server window displays some lines when I telnet to it from the same machine. But not when I try to reach it (via telnet or with a browser) from outside...

link|improve this answer
http/1.1 needs at least a "Host: xxxx" line after the "GET / http/1.1" – Javier Dec 30 '09 at 20:02
woop, I can comment down here now. If you can telnet from the inside but not the outside, then: a) you have a firewall somewhere in the middle of everything that is stopping connections. b) this second http server that you've set up is only bound to 127.0.0.1 rather than your external IP address. – MidnighToker Dec 31 '09 at 3:10
I have seen some improvement : the httpd server has two options, "http_address" and "servername". http_address was set to 0.0.0.0 and the server was reachable at 127.0.0.1 (servername was blank). Now I set "http_address" to the ip of my site and it does work for connections originating from the same machine (I DID get a 200=OK code ! plus the html of the page). So the only thing not working is connections from outside. This is a hosting account, and an Apache is already running on 80, is it possible that there is a firewall for specific port ranges ? – Anonymous Dec 31 '09 at 9:38
feedback

Check the server log files ?

link|improve this answer
feedback

Your Answer

 
or
required, but never shown