Error : curl: (7) Failed to connect to 127.0.0.1 port 80: Connection refused - amazon-web-services

I have a R code deployed on AWS server to fetch twitter data which is basically creating an API.
I want to fetch the data on local system using this API which is fetching the data using the function running on aws server.
I'm using this command :
$curl "http://127.0.0.1 ip-public ip:8000/meaning?woeid=23424848&n=1"
But i'm getting the error below :
curl: (7) Failed to connect to 127.0.0.1 port 80: Connection refused
curl: (6) Could not resolve host: ip-public ip

Related

How to Access Remote PostgreSQL Database Server Through VPN

I'm currently working with my office server, when i want to connect to the server, i have to use their VPN. I have installed PostgreSQL database in their server and have succesfully migrate data to database from Django project. But, when i want to remote access from HeidiSQL, it always gives me Connection Timed Out Error eventhough i have already connected to their VPN.
I've tried to this code below
/var/lib/pgsql/14/data/pg_hba.conf
host all all 0.0.0.0/0 md5
host all all ::/0 md5
/var/lib/pgsql/14/data/postgresql.conf
listen_addresses = '*'
i have tried to refresh everytime i change files and see if i'm in the correct port but it still gives me Connection Timed Out Error
this is the full error message
could not connect to server: Connection Timed out (0x0000274C/10060). Is the server running on host "xxx.xxx.xxx.xxx" and accepting TCP/IP connections on port 5432 ?
NOTES
OS : CentOS 8
DB : PostgreSQL 14

code-server WebSocket close with status code 1006

I am trying to install code-server 3.6.2 on a cloud platform. I have tried both AWS and digitalocean machines but in both systems, I can open code server but it gives an error "WebSocket close with status code 1006".
I have followed the procedure from https://www.digitalocean.com/community/tutorials/how-to-set-up-the-code-server-cloud-ide-platform-on-ubuntu-20-04
code-server uses websocket to connect.Do you use HTTPS?
If so, you should Use wss to forward ws.like this:
// forward websocket (wss -> ws)
httpsServer.on('upgrade', function (req, socket, head) {
proxy.ws(req, socket, head, {
target: 'ws://...',
ws: true
})
})
Usually this and other errors happen when you use code server locally
To solve it you can use the --link parameter that gives you a url with temporary https, or you can also use ngrok
//Option 1
code-server --host 127.0.0.1 --bind-addr 0.0.0.0:9000 --auth password --link
//Option 2
code-server --host 127.0.0.1 --bind-addr 0.0.0.0:9000 --auth password
ngrok http 9000

openconnect, ssl connection failure

I have ocserv setup on a vm, but when trying to connect through openconnect app getting these errors,
it will be helpful if any solution, tried various ocserv config file modifications but non-sucessfull
Logs:
` Disconnected
STAT: attempt=O; first-NEVER; prev=NEVER
STAT: connect=o; first-NE-VER; prev=NEVER
STAT: cancel=o; first=NEVER; prev=NEVER
LIB: POST https://<IP/hostname>/
L1B: Attempting to connect to server <IP/hostname>
LIB: Connected to <IP :443/hostname>
LIB: SSL negotiation with <IP/hostname>
L1B: Server certificate verify failed: certificate does not match hostname CALLBACK: onValidatePeerCert
LIB: SSI- connection failure: The operation timed out
LIB: Failed to open HTTPS connection to <IP/hostname>
Error obtaining cookie
VPN terminated with errors`
Update::: after few changes this is the current error im getting,
setup description: Vm has debian 9 installed with ocserv installed, also certificates. trying to connect useing openconnect android app, device has mobile data enabled with low speed.
Log:
Disconnected
STAT: attempt=O; first-NEVER; prev=NEVER
STAT: connect=o; first-NE-VER; prev=NEVER
STAT: cancel=o; first=NEVER; prev=NEVER
LIB: POST https://<IP/hostname>/
L1B: Attempting to connect to server <IP/hostname>
LIB: Connected to <IP :443/hostname>
L1B: SSL_negotiation with <IP/hostname>
L1B: SSL_connection failure: The operation timed out
L1B: Failed to open HTTPS connection to <IP/hostname>
Error obtaining cookie
VPN terminated with errors
Is their any SSL issue? or do I need to give 3rd party SSL to ocserv, if so how to install 3rd party SSL to ocserv.
Thanks in advance
The error message states that the server's certificate did not match its hostname. As your client checks this, you need to use a certificate that matches the hostname that you use to access the server.

Access CouchDB with external URL

I have installed CouchDB in my AWS server. When I run the command
curl localhost:5984
then I got a response like:
{"couchdb":"Welcome","uuid":"b7a38141c61a37390945a99fd88f0015","version":"1.6.0","vendor":{"version":"15.10","name":"Ubuntu"}}
But when I run this command:
curl ip_address:5984
then it gives:
curl: (7) Failed to connect to Ip-address port 5984: Connection refused
Your CouchDB is not listening on all interfaces. Edit your couch.ini file and modify the line to:
bind_address = 0.0.0.0
and restart couch service. If it still doesn't work, post the output of netstat -plan | grep 5984.
Clearly explained here: CouchDB HTTP Server
bind_address : Defines the IP address by which CouchDB will be accessible:
[httpd]
bind_address = 127.0.0.1
To let CouchDB listen any available IP address, just set up 0.0.0.0 value:
[httpd]
bind_address = 0.0.0.0

Postgresql localhost connection - Connection refused

i just installed pgadmin iii and try to connect server.
I configured my setting
name:localhost
host: 127.0.0.1
port:5432
username:postgres
but i always get this error
The server doesn't accept connection: the connection library reports
**could not connect to server : Connection refused Is server runing on host "127.0.0.1" and accepting TCP/IP connections on port 5432?
However, i'm runing django and python on 127.0.0.1 What's missing?
There's also a problem with mysql. I could not connect with them
If you change the pg_hba.conf file to accept connections (for example: "host all all 127.0.0.1 255.255.255.0 trust") it should work
Installing postgre v12 before uninstalling v11 I found the config file (postgresql.conf) had a line "port = 5433". Changing this to "port = 5432" fixed the issue for me.