KeyCloak with Domainname - keycloak

I have an server, running IIS and some c#-WebApis. I can call this services with http://domainname:port . Thats ok.
On this server I have a Keycloak installed (IIS not involved) and I can access Keycloak via http://localhost:8080.
But not over http://domainname:8080 .
Whats the problem?

Potentially your Keycloak binds to 127.0.0.1 and not your public IP. Try to start Keycloak with the correct binding address, like so:
./standalone.bat -Djboss.bind.address=<IP address or host name>
or so
./standalone.bat -b <IP address or host name>
You could also specify 0.0.0.0 as <IP address or host name> to bind to all IPs.

Related

How can I connect to a PostgreSQL server running inside a Docker container on a GCP virtual machine?

I have pgAdmin4 and PostgreSQL running inside Docker containers on a GCP virtual machine. I have already ingested data into PostgreSQL and I can access the tables and databases using pgcli. However, I am unable to connect to pgAdmin4. How can I connect to the pgAdmin4?
You will access pgadmin with your browser.
When you start up the pgadmin container, you should have configured a port mapping. Add a firewall rule to your VM's network configuration for this mapped port (for example, I've configured an ingress firewall rule for 15432 because I mapped 15432 to 80 in my docker config).
Example snippet from docker-compose:
ports:
- 15432:80
Assuming you have configured an external IP address, use the external IP address and the port number in your browser to access pgadmin. Like this, where XX.XX.XX.XXX is your external IP and 15432 was mapped to port 80:
http://XX.XX.XX.XXX:15432/login

Error while proxying request kubectl proxy

I'm trying to follow this documentation https://kubernetes.io/docs/tasks/administer-cluster/access-cluster-api/.
After running this command
kubectl proxy --port=8080 &
I get the output
Starting to serve on 127.0.0.1:8080
However when I run "curl http://localhost:8080/api/" to hit the server, I get this response
dial tcp: lookup localhost: no such host
Any idea's why I would get this response?
EDIT:
I'm using a VPN to connect to corporate network. When I disable the VPN I still get the same message for both localhost and 127.0.0.1 (same exact message for both).
I'm not using kubeadm.
When I run host localhost I get this output
localhost has address 127.0.0.1
localhost has IPv6 address ::1
cat /etc/hosts
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
# Added by Docker Desktop
# To allow the same kube context to work on the host and the container:
127.0.0.1 kubernetes.docker.internal
# End of section
It is possible you might have http_proxy set on you system , so try curl with noproxy as following :
curl --noproxy '*' http://localhost:8080
If you want to check if the http_proxy is set :
echo $http_proxy

How to Connect using Port Forwarding Database Postgrsql on Openshift 3

I Have a problem on Connect from Port Forwarding Database on Openshift :
Running Pods Postgresql :
I Try Connect to Container running the database to check process and psql command, then it works :
Next, I Try Port Forwarding for Try Connection from outside Openshift Cluster:
Then I Try Connect from Outside Cluster to connect Postgresql have Error: Connection Refuse
Im Using IP Based or Hostname / FQDN Not Working and Error Still Exist
And When I Try Check Firewall port it has been opened port 5432/TCP :
Anyone Can Help Me With This problem ?
Thanks
Note: Before I have Been Looking Documentation but Not Working Resolve the Problem
Source Documentation:
https://www.openshift.com/blog/openshift-connecting-database-using-port-forwarding
"psql: could not connect to server: Connection refused" Error when connecting to remote database
The oc port-forward command is forwarding from only your loopback interfaces.
If you are running your client on the same machine where the cluster is running, then use localhost as your "Host".
If you are running your client on a different machine, they you need more network redirection to get this to work. Please see this post for more information as well as work-arounds for your problem: Access OpenShift forwarded ports from remote host

Fix IP with port to IP without port

I have a website.example.com The website is hosted on OVH I would like to point a sub domain shop.example.com to another website hosted on another server
(95.110.189.135:8069) the problem is that I can't c name to an IP with a port.
I used Ubuntu for my odoo server
I've got odoo on my vps server with database. Now, It's working on IP with port (example: 55.55.55.55:8069). So now,
How can I change it to IP without port?
If I want a domain name - how can I do this?
I found the solution it's easy to redirect to port 80
to do that add a line of code in the file
etc/rc.local
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8069
then the file will become like this
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8069
exit 0
save and then restart the server
You cannot use plain DNS to transfer traffic to another port. This is not possible with either canonical name (CNAME record) or address (A record). These DNS services are only used for address resolution.
To solve your configuration issue you can use reverse proxy, e.g. Nginx. You can find example configurations from the Odoo.com site at https://www.odoo.com/documentation/11.0/setup/deploy.html#https. This is describing how to use https in port 443 to proxy Odoo in upstream service at port 8069. For public services you should use encrypted https, not http. Point your show.example.com in DNS to your "another" server ip address and on that server have Odoo and Nginx running. Your Odoo can run on port 8069 and your Nginx would run on https 443 and proxy connections to Odoo upstream service on localhost 8069.
Hope this helps you forward. Please check your configuration with someone who have experience with this kind of setups before you go production. This will make sure your configuration is secure.

AWS: How To Setup Postgres Security on EC2

I have two machines in amazon. web01 and db01. I installed PostgreSQL on db01, and added the elastic ip of web01 to the pg_hba.conf
host dbname username 64.210.245.155/32 md5
and restarted the postgresql service. Now in web01 I tried to connect to the elastic ip of db01
$ psql -h 64.210.255.222 -U user -d database
psql: could not connect to server: No route to host
Is the server running on host "64.210.255.222" and accepting
TCP/IP connections on port 5432?
I also added the elastic ip of web01 to db01's security group for inbound traffic. What am I doing wrong and how can I get web01 to connect to pg on db01?
To start with, you want to be connecting to the internal IP. You can use the DNS name if your elastic IP as it will resolve to an internal IP within AWS instead of using the elastic IP directly.
Secondly, all public IPs are assigned via NAT. If your service tries to listen to that IP address it will fail. Generally the best thing to do is listen to all IPs, unless you are using VPC and have control of the internal IP.
Lastly, you will provide access to the web security group within the db security group. Even if two instances are in the same security group, they will not be able to access each other unless the group is given access to itself.