Jump to content

Apache 2.2 not listening on port 80


brebey

Recommended Posts

I have a fresh installation of Apache 2.2.3 on Windows 2000.  It's running as a service, and is started.

When I try to test it with a Web browser by connecting to http://localhost/ (or 127.0.0.1), nothing happens - the browser hangs and eventually times out with an error page.

No Error log is generated. 
No access log is generated.

It appears that it's not even binding to the socket, as I can run another Web server and it is able to bind to the socket, listen on it, accept connections, and carry on HTTP conversations correctly.

Apache just plain doesn't seem to be getting into gear.

Here are the only entries in the Error log:

[Tue Nov 28 00:42:06 2006] [notice] Apache/2.2.3 (Win32) configured -- resuming normal operations
[Tue Nov 28 00:42:06 2006] [notice] Server built: Jul 27 2006 16:49:49
[Tue Nov 28 00:42:06 2006] [notice] Parent: Created child process 820
[Tue Nov 28 00:42:06 2006] [notice] Child 820: Child process is running
[Tue Nov 28 00:42:06 2006] [notice] Child 820: Acquired the start mutex.
[Tue Nov 28 00:42:06 2006] [notice] Child 820: Starting 250 worker threads.
[Tue Nov 28 00:42:06 2006] [notice] Child 820: Starting thread to listen on port 80.

Like I said, the access log is empty (0 bytes).

Any idea what might be going wrong?
Link to comment
Share on other sites

If I had to have a crack at it - Id say you have an apache instance running somewhere else in the background other than you think and in another location.
Check processes for apache running. do a netstat to see if it bound to another port. Check to see if there are "other" apache logs been stored elsewhere.

Look for more logs and debugging.

-steve
Link to comment
Share on other sites

Thanks for the input, guys, but I'm no further along. 

I dont' have a firewall, and like I said - I know port 80 is fine, because I can run another (non-apache) Web server on it just fine.  I have a small, very basic Web server that I wrote myself, and it works great.  There are no other instances of Apache - service or application - running.

Apache doesn't quit or give me an error - it just doesn't connect to a browser. 

Netstat does report that Apache is Listening on 80, but nothing happens when I try to connect - the browser hangs, there is no log generated of any kind, etc.  I know I'm reading the right logs, because startup information is logged.  I've tried "localhost", "127.0.0.1", and both of those with ":80" after them.  I tired switching ports int the config file, and the results are the same.

Any further ideas would be appreciated.  It just looks like Apache is broken, but I know lots of folks are usning it without a hitch.
Link to comment
Share on other sites

[quote]Netstat does report that Apache is Listening on 80, but nothing happens when I try to connect - the browser hangs, [/quote]

Try telnetting to localhost 80.

In a command prompt go:
telnet 127.0.0.1 80

The cmd window should go completely black once it telnets in.

Your browser could have any number of configs preventing it from working.

P.S. is there not an Apache Monitor (task bar beside clock) for Apache on windows?

-steve
Link to comment
Share on other sites

Make sure apache is working properly in the first place.

Change the listening port to something like 50123, restart apache

then connect to  http://localhost:50123/  or http://127.0.0.1:50123/

If that fails, it is more than likely in the apache installation/configuration.

If that does not fail, then it would be a port issue regarding port 80.

With the apache service off run: netstat -n -a

Copy the contents here so we can look at it
Link to comment
Share on other sites

Again, thanks to everyone for the help.

Steve, telnet works - it connects when apache is running, and doesn't connect when apache is not running, so it appears that the socket is doing something.  I tried it on port 80 and on port 8023;  in both cases, the results are identical:  When apache is running, Telnet will connect to the appropriate port, and when Apache is not running, telnet doesn't connect.  Likewise, when Apache is not running, Web browsers (Netscape and IE) return immediately with an error message, and when apache is running, they time out.  So SOMETHING is happening when Apache is running, but no Web pages are returned.

I have done nothing to the Config file except change the Listening port for testing - it's a fresh installation otherwise.

The access log still contains nothing, though.  No connections of any kind are being logged.  It just doesn't seem like Apache is working much at all.

Here are the netstat results, as requested:

WITH-OUT- Apache running:

Active Connections

  Proto  Local Address          Foreign Address        State
  TCP    0.0.0.0:135            0.0.0.0:0              LISTENING
  TCP    0.0.0.0:445            0.0.0.0:0              LISTENING
  TCP    0.0.0.0:1025          0.0.0.0:0              LISTENING
  TCP    0.0.0.0:5679          0.0.0.0:0              LISTENING
  TCP    127.0.0.1:1999        127.0.0.1:2000        ESTABLISHED
  TCP    127.0.0.1:2000        127.0.0.1:1999        ESTABLISHED
  TCP    127.0.0.1:5180        0.0.0.0:0              LISTENING
  TCP    192.168.1.152:139      0.0.0.0:0              LISTENING
  TCP    192.168.1.152:1030    192.168.1.102:139      ESTABLISHED
  TCP    192.168.1.152:3410    217.160.226.96:110    TIME_WAIT
  TCP    192.168.1.152:3417    64.236.41.32:80        ESTABLISHED
  TCP    192.168.1.152:3424    217.160.226.96:110    TIME_WAIT
  TCP    192.168.1.152:3442    217.160.226.96:110    TIME_WAIT
  TCP    192.168.1.152:3444    217.160.226.96:110    TIME_WAIT
  TCP    192.168.1.152:3446    217.160.226.96:110    TIME_WAIT
  UDP    0.0.0.0:445            *:*
  UDP    0.0.0.0:1031          *:*
  UDP    127.0.0.1:2110        *:*
  UDP    127.0.0.1:2548        *:*
  UDP    127.0.0.1:3367        *:*
  UDP    192.168.1.152:137      *:*
  UDP    192.168.1.152:138      *:*
  UDP    192.168.1.152:500      *:*
  UDP    192.168.1.152:4500    *:*


-WITH- Apache running:

Active Connections

  Proto  Local Address          Foreign Address        State
  TCP    0.0.0.0:135            0.0.0.0:0              LISTENING
  TCP    0.0.0.0:445            0.0.0.0:0              LISTENING
  TCP    0.0.0.0:1025          0.0.0.0:0              LISTENING
  TCP    0.0.0.0:5679          0.0.0.0:0              LISTENING
  TCP    127.0.0.1:80          0.0.0.0:0              LISTENING
  TCP    127.0.0.1:1999        127.0.0.1:2000        ESTABLISHED
  TCP    127.0.0.1:2000        127.0.0.1:1999        ESTABLISHED
  TCP    127.0.0.1:5180        0.0.0.0:0              LISTENING
  TCP    192.168.1.152:139      0.0.0.0:0              LISTENING
  TCP    192.168.1.152:1030    192.168.1.102:139      ESTABLISHED
  TCP    192.168.1.152:3417    64.236.41.32:80        TIME_WAIT
  TCP    192.168.1.152:3442    217.160.226.96:110    TIME_WAIT
  TCP    192.168.1.152:3444    217.160.226.96:110    TIME_WAIT
  TCP    192.168.1.152:3446    217.160.226.96:110    TIME_WAIT
  TCP    192.168.1.152:3453    64.233.161.99:80      ESTABLISHED
  TCP    192.168.1.152:3462    209.170.113.16:80      ESTABLISHED
  TCP    192.168.1.152:3463    209.170.113.16:80      ESTABLISHED
  TCP    192.168.1.152:3467    217.160.226.96:110    TIME_WAIT
  TCP    192.168.1.152:3470    217.160.226.96:110    TIME_WAIT
  TCP    192.168.1.152:3478    72.5.124.110:80        ESTABLISHED
  TCP    192.168.1.152:3482    72.5.124.65:80        LAST_ACK
  TCP    192.168.1.152:3485    217.160.226.96:110    TIME_WAIT
  TCP    192.168.1.152:3489    217.160.226.96:110    TIME_WAIT
  TCP    192.168.1.152:3490    66.151.150.32:2703    ESTABLISHED
  UDP    0.0.0.0:445            *:*
  UDP    0.0.0.0:1031          *:*
  UDP    127.0.0.1:2110        *:*
  UDP    127.0.0.1:2548        *:*
  UDP    127.0.0.1:3367        *:*
  UDP    192.168.1.152:137      *:*
  UDP    192.168.1.152:138      *:*
  UDP    192.168.1.152:500      *:*
  UDP    192.168.1.152:4500    *:*

Again, any help is appreciated.

Bill
Link to comment
Share on other sites

OK - I still think its your browsers or hosts file at fault. More testing needs to be done with telnet ->

telnet 127.0.0.1 80

<type in>
GET /index.html HTTP/1.0

<hit enter twice>
The index.html page should be returned. Try that and see.

More info on accessing apache via telnet available at:
http://www.apacheweek.com/features/http11
Link to comment
Share on other sites

Telnet doesn't respond.  When Apache is NOT running, the Telnet connection fails immediately, as expected.  When Apache IS running, Telnet conencts and the comand prompt screen goes completely black.  From this perspective, it look slike Apache is in fact working, as it gets as far as getting the socket into Listen mode.  However, Telnet is unresponsive.  I have to close the Window to stop it. Ctrl-C, Ctrl-Z, Ctrl-D, Ctrl-Q, and Ctrl-Break don't do anything.  Typing goes unnotieced, or at the very least is not echoed to the screen.  Typing the GET command that you asked for results in no change at all - the screen just stays black - my typing isn't even echoed to the screen.

Of course, I still can't get browsers to work, either.  I've tried a number of installations of Apche, hoping that I might have a bad binary or something.  No luck.  The problem persists.

Link to comment
Share on other sites

OK.

Well even though I nearly agree with you - on this been an apache specific problem - for future reference - telnet will not show up any cursor when typing in "GET /index.html HTTP/1.0"  Test telnet on www.phpfreaks.com etc. and see if you can get it working.

Anyways - assuming its a specific apache problem -> Id run a chkdsk -f on your harddisk to make sure there are no bad sectors etc. A reinstall of apache would not fix problems with bad sectors - in my opinion.

Also - you need to do/try the following:
start apache FROM THE COMMAND LINE - as it will give out any errors there!
Also check your apache configs with this command:
[code]apache2ctl -tf /path/to/apache2.conf[/code]

Apart from that - I dunno whats up with your apache2.2  ???
Perhaps you can install apache2 on its own? Maybe its a threading problem and try apache1.3 even.

-steve
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.