You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by John Smith <ll...@gmail.com> on 2020/04/01 13:47:10 UTC

[users@httpd] localhost api

Hello,

When calling restapi (https://someserver.net/api/dosomething PUT or GET)
from localhost, it says Connection not allowed. From outside it works well.
A perl script is doing the calling. This might be an apache configuration
issue, or?
Regards,
John

Re: [users@httpd] localhost api

Posted by "rexkogitans@gmx.at" <re...@gmx.at>.
If this is on Linux:

  * The content of /etc/hosts would be interesting.
  * The output of ss -tulpn would be interesting.

You should make sure that httpd listens on all interfaces on the
appropriate port, and that the DNS name someserver.net resolves to one
of these addresses (usually, it should resolve to the external address,
not to 127.0.0.1). So, the file /etc/hosts should NOT contain a line:

127.0.0.1 someserver.net

Kind regards.


Am 01.04.20 um 19:37 schrieb John Smith:
> When trying to update data with POST, there comes:
>
> Can\'t connect to someserver.net:8092 <http://someserver.net:8092>
> (Connection timed out)
>
> No markings in apache's logs. Apache and application run in lxc container.
> If I call 127.0.0.1 or localhost instead of someserver, result is:
>
> 'Can\'t connect to localhost:8092 (Connection refused)
>
>
> Service works well, if it is called outside
>
> On Wed, Apr 1, 2020 at 6:57 PM Rich Bowen <rbowen@rcbowen.com
> <ma...@rcbowen.com>> wrote:
>
>     Please provide the error message, from the error log.
>
>     On 4/1/20 9:47 AM, John Smith wrote:
>     > Hello,
>     >
>     > When calling restapi (https://someserver.net/api/dosomething PUT
>     or GET)
>     > from localhost, it says Connection not allowed. From outside it
>     works
>     > well. A perl script is doing the calling. This might be an apache
>     > configuration issue, or?
>     > Regards,
>     > John
>
>     --
>     Rich Bowen - rbowen@rcbowen.com <ma...@rcbowen.com>
>     http://rcbowen.com/
>     @rbowen
>

Re: [users@httpd] localhost api

Posted by Rich Bowen <rb...@rcbowen.com>.

On 4/1/20 1:37 PM, John Smith wrote:
> When trying to update data with POST, there comes:
> 
> Can\'t connect to someserver.net:8092 <http://someserver.net:8092>
> (Connection timed out)
> 
> No markings in apache's logs. Apache and application run in lxc container.
> If I call 127.0.0.1 or localhost instead of someserver, result is:
> 
> 'Can\'t connect to localhost:8092 (Connection refused)

> 
> 
> Service works well, if it is called outside

That *probably* indicates one of two things:

1) You're not 'Listen'ing on that address (check your Listen directive
to see if it specifies only specific IP addresses)

2) Your firewall is not configured to allow this connection


> 
> On Wed, Apr 1, 2020 at 6:57 PM Rich Bowen <rbowen@rcbowen.com
> <ma...@rcbowen.com>> wrote:
> 
>     Please provide the error message, from the error log.
> 
>     On 4/1/20 9:47 AM, John Smith wrote:
>     > Hello,
>     >
>     > When calling restapi (https://someserver.net/api/dosomething PUT
>     or GET)
>     > from localhost, it says Connection not allowed. From outside it works
>     > well. A perl script is doing the calling. This might be an apache
>     > configuration issue, or?
>     > Regards,
>     > John
> 
>     -- 
>     Rich Bowen - rbowen@rcbowen.com <ma...@rcbowen.com>
>     http://rcbowen.com/
>     @rbowen
> 

-- 
Rich Bowen
rbowen@rcbowen.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] localhost api

Posted by Carsten Reith <ca...@t-online.de>.
How does your Listen directive in the httpd.conf look like ? Is Apache listening to
127.0.0.1 or only to an external NIC ?

The output of netstat -tulpn would be helpful.

cheers,

Carsten

On Wed, Apr 01, 2020 at 08:37:54PM +0300, John Smith wrote:
>    When trying to update data with POST, there comes:
> 
>    Can\'t connect to someserver.net:8092 (Connection timed out)
> 
>    No markings in apache's logs. Apache and application run in lxc container.
>    If I call 127.0.0.1 or localhost instead of someserver, result is:
> 
>    'Can\'t connect to localhost:8092 (Connection refused)
> 
>    Service works well, if it is called outside
>    On Wed, Apr 1, 2020 at 6:57 PM Rich Bowen <rb...@rcbowen.com> wrote:
> 
>      Please provide the error message, from the error log.
> 
>      On 4/1/20 9:47 AM, John Smith wrote:
>      > Hello,
>      >
>      > When calling restapi (https://someserver.net/api/dosomething PUT or
>      GET)
>      > from localhost, it says Connection not allowed. From outside it works
>      > well. A perl script is doing the calling. This might be an apache
>      > configuration issue, or?
>      > Regards,
>      > John
> 
>      --
>      Rich Bowen - rbowen@rcbowen.com
>      http://rcbowen.com/
>      @rbowen

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] localhost api

Posted by John Smith <ll...@gmail.com>.
When trying to update data with POST, there comes:

Can\'t connect to someserver.net:8092 (Connection timed out)

No markings in apache's logs. Apache and application run in lxc container.
If I call 127.0.0.1 or localhost instead of someserver, result is:

'Can\'t connect to localhost:8092 (Connection refused)


Service works well, if it is called outside

On Wed, Apr 1, 2020 at 6:57 PM Rich Bowen <rb...@rcbowen.com> wrote:

> Please provide the error message, from the error log.
>
> On 4/1/20 9:47 AM, John Smith wrote:
> > Hello,
> >
> > When calling restapi (https://someserver.net/api/dosomething PUT or
> GET)
> > from localhost, it says Connection not allowed. From outside it works
> > well. A perl script is doing the calling. This might be an apache
> > configuration issue, or?
> > Regards,
> > John
>
> --
> Rich Bowen - rbowen@rcbowen.com
> http://rcbowen.com/
> @rbowen
>

Re: [users@httpd] localhost api

Posted by Rich Bowen <rb...@rcbowen.com>.
Please provide the error message, from the error log.

On 4/1/20 9:47 AM, John Smith wrote:
> Hello,
> 
> When calling restapi (https://someserver.net/api/dosomething PUT or GET) 
> from localhost, it says Connection not allowed. From outside it works 
> well. A perl script is doing the calling. This might be an apache 
> configuration issue, or?
> Regards,
> John

-- 
Rich Bowen - rbowen@rcbowen.com
http://rcbowen.com/
@rbowen

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org