You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Jeffrey Stephen <St...@climatechange.qld.gov.au> on 2009/11/03 07:39:33 UTC

[users@httpd] Failed to connect

Hi,

I have just installed apache httpd-2.2.14 on a linux machine running
SLES10. I am running the web server as non-root, so I have set the
listening port to "23456" in my httpd.conf file. It appears to start
correctly:

> netstat -an | grep LISTEN | grep 234
tcp        0      0 :::23456                :::*
LISTEN

but when I try to access http://localhost in my browser, I get a "failed
to connect" error. The error_log and access_log don't contain any
relevant info (see below).

The first few lines of my /etc/hosts file contains:
---------------------------------------
127.0.0.1       localhost

# special IPv6 addresses
::1             localhost ipv6-localhost ipv6-loopback
---------------------------------------

I tried to check the connection with "cURL" and telnet:

> curl http://localhost/
curl: (7) couldn't connect to host

> telnet localhost 23456
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
^[[          
Connection closed by foreign host.

Does anyone know what the problem might be?

Regards
Steve


The access log contains:
> cat access_log 
::1 - - [03/Nov/2009:15:34:33 +1000] "OPTIONS * HTTP/1.0" 200 -
::1 - - [03/Nov/2009:15:34:33 +1000] "OPTIONS * HTTP/1.0" 200 -
::1 - - [03/Nov/2009:15:34:33 +1000] "OPTIONS * HTTP/1.0" 200 -
::1 - - [03/Nov/2009:15:34:33 +1000] "OPTIONS * HTTP/1.0" 200 -
::1 - - [03/Nov/2009:15:34:33 +1000] "OPTIONS * HTTP/1.0" 200 -
127.0.0.1 - - [03/Nov/2009:16:18:19 +1000]
"\xff\xf4\xff\xfd\x06\xff\xf4\xff\xfd\x06" 501 222

I only noticed the last line after I had tried accessing
http://127.0.0.1 I don't think it was there after trying
http://localhost


The error_log contains:
> cat error_log 
[Tue Nov 03 15:26:19 2009] [notice] Digest: generating secret for digest
authentication ...
[Tue Nov 03 15:26:19 2009] [notice] Digest: done
[Tue Nov 03 15:26:20 2009] [notice] Apache/2.2.14 (Unix) DAV/2
configured -- resuming normal operations
[Tue Nov 03 15:34:33 2009] [notice] caught SIGWINCH, shutting down
gracefully
[Tue Nov 03 15:37:58 2009] [notice] Digest: generating secret for digest
authentication ...
[Tue Nov 03 15:37:58 2009] [notice] Digest: done
[Tue Nov 03 15:37:59 2009] [notice] Apache/2.2.14 (Unix) DAV/2
configured -- resuming normal operations
[Tue Nov 03 16:18:19 2009] [error] [client 127.0.0.1] Invalid method in
request \xff\xf4\xff\xfd\x06\xff\xf4\xff\xfd\x06

I only noticed the last line after I had tried accessing
http://127.0.0.1 I don't think it was there after trying
http://localhost



As of 26 March 2009 the Department of Natural Resources and Water/Environmental Protection Agency integrated to form the Department of Environment and Resource Management 

+----------------------------------------------------------------+
Think B4U Print
1 ream of paper = 6% of a tree and 5.4kg CO2 in the atmosphere
3 sheets of A4 paper = 1 litre of water
+----------------------------------------------------------------+


Re: [users@httpd] Failed to connect

Posted by Philip Wigg <ph...@philipwigg.co.uk>.
> When I try the access using "http://localhost:23456" I get a web page display "It works".
> Is there a way of telling the browser or apache to use this port by default?

When you connect using a URL like http:/www.example.com or
http://localhost, your browser will use port 80 to connect as this is
the default port assigned to the HTTP protocol.

You probably just want to run Apache HTTPD on port 80 and have the
processes which answer requests run as a lesser privileged user. See:-

http://httpd.apache.org/docs/2.2/mod/mpm_common.html#group
http://httpd.apache.org/docs/2.2/mod/mpm_common.html#user

Cheers,
Phil.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Failed to connect

Posted by Iñigo Medina García <im...@grosshat.com>.
> Hi,
>
> When I try the access using "http://localhost:23456" I get a web page display "It works".
>
> Is there a way of telling the browser or apache to use this port by default?

It depends on linux-distribution but there is usually a file named 
"ports.conf" where you can set the default port. Sentence is quite simple: 
"Listen port".

iñ

RE: [users@httpd] Failed to connect

Posted by Jeffrey Stephen <St...@climatechange.qld.gov.au>.
Hi,

When I try the access using "http://localhost:23456" I get a web page display "It works".

Is there a way of telling the browser or apache to use this port by default?

Regards
Steve



>-----Original Message-----
>From: Iñigo Medina García [mailto:imedina@grosshat.com] 
>Sent: Tuesday, 3 November 2009 5:04 PM
>To: users@httpd.apache.org
>Subject: Re: [users@httpd] Failed to connect
>
>
>> Hi,
>>
>> I have just installed apache httpd-2.2.14 on a linux machine running 
>> SLES10. I am running the web server as non-root, so I have set the 
>> listening port to "23456" in my httpd.conf file. It appears to start
>> correctly:
>>
>>> netstat -an | grep LISTEN | grep 234
>> tcp        0      0 :::23456                :::*
>> LISTEN
>>
>> but when I try to access http://localhost in my browser, I get a 
>> "failed to connect" error. The error_log and access_log 
>don't contain 
>> any
>
>Did you try to access with the port you set?
>
>iñ
>


As of 26 March 2009 the Department of Natural Resources and Water/Environmental Protection Agency integrated to form the Department of Environment and Resource Management 

+----------------------------------------------------------------+
Think B4U Print
1 ream of paper = 6% of a tree and 5.4kg CO2 in the atmosphere
3 sheets of A4 paper = 1 litre of water
+----------------------------------------------------------------+



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Failed to connect

Posted by Iñigo Medina García <im...@grosshat.com>.
> Hi,
>
> I have just installed apache httpd-2.2.14 on a linux machine running
> SLES10. I am running the web server as non-root, so I have set the
> listening port to "23456" in my httpd.conf file. It appears to start
> correctly:
>
>> netstat -an | grep LISTEN | grep 234
> tcp        0      0 :::23456                :::*
> LISTEN
>
> but when I try to access http://localhost in my browser, I get a "failed
> to connect" error. The error_log and access_log don't contain any

Did you try to access with the port you set?

iñ