Problems with configuring Lando on Fedora (on Linode) to port 80 - proxy

I have been trying to configure lando to expose my container to public domain that is pointing there. So my domain, lets call it my_app.com, is showing The random port assignments to the container work from the domain but not I am not able to fix it to port 80.
For example Lando starts up and shows these available URLs
APPSERVER URLS https://localhost:32781
http://localhost:32782
http://my_app.lndo.site
https://my_app.lndo.site
When I navigate to my domain, my_app.com, it doesn't' work, but if I use my_app.com:32781, it does.
I feel like I am missing something simple. The server itself is a fresh installation of Fedora 29 with Lando v3.0.0-rc.8
My Lando file:
name: my_app
recipe: drupal8
config:
webroot: ./drupal/web
php: 7.2
port: '8080'
drush: ^9
xdebug: false
event:
post-rebuild:
- composer install -d=./drupal

Per https://docs.devwithlando.io/config/proxy.html, adding the following lines to your .lando.yml should configure Lando to properly route your custom domain. Port 80 will be bound automatically unless some other service on your machine is already using the port.
proxy:
appserver:
- my_app.com

You mention a .com domain. Apparently you want your app to be publicly (WAN) accessible. Are you behind any router? Then simply open a port and direct it to your computer IP and your 32782 for http which is port 80 for the outside world. In some routers this is called "Port mapping".
The firewall on your computer needs to have the port 32782 opened. You might need to include share.

Related

Host port mapping not working with docker-compose on EC2

I tried to run this hello world app on an AWS EC2 instance with docker-compose up --build . It works as expected and is accessible remotely from the EC2 public IP when I use port 80 i.e., "80:80" as shown in the docker-compose file.
However, if I change to another port such as "5106:80", it is not accessible from a remote host using <public IPv4 address>:5106 even though it's available locally if I ssh unto the EC2 instance and try localhost:5106. Please note:
I've ensured the EC2 is in a public subnet and I have configured the security group to make the port (in this case, 5106) accept inbound traffic from my laptop.
I know it's not a problem with the hello-world app because I experience exactly the same problem with another app i.e., only port 80 works with docker-compose port mapping on EC2.
As it works with port 80 and doesn't work with port 5106 it could mean one of two possibilities:
There is an issue with your security groups. You should check you have added port 5106 in your inbound rules of your security group.
There is an issue with a firewall or antivirus that doesn't allow you to connect to web pages in different ports rather than 80 or 443. You may try if this happens with another device or on another network.
In this case, it seemed to be the latter.
Possible that the docker network needs to be deleted?
docker network rm $(docker network ls -q)
Then run docker-compose up again.

AWS EC2 instance can only be accessible via port 80

I recently setup an ec2 Instance (RHEL7.2) on Amazon Web Services. I am having trouble getting it to respond to http requests. I run docker run -p 12345:80 nginx:latest successfully and I have added port 12345 to the inbound rules in the instance's security group. But this hasn't worked so far - I've tried both adding it to the default security group, and creating a new security group. And in local curl http://localhost:12345/ works right.
But the strange thing is if I change -p 12345:80 to -p 80:80, it works well!!! Then I have tried other ports mapping, but the result is only 80 works!
Has anyone else had a similar experience? Or give me some help and advice, thanks in advance!
PS:
My containers:
Image nginx 0:0:0:0:12345->80/tcp
Image nginx 0:0:0:0:80->80/tcp
Security group:
All TCP All TCP 1~65535 0:0:0:0
EC2:
Public IPv4: xx.xx.zz.zz
I can access via http://xx.xx.zz.zz/ in browser and ssh via port 22. But http://xx.xx.zz.zz:12345/ failed.

Accessing remote server service via HTTPS

I have a server(AWS) to which I have ssh access.
There is a service(supervisor) running on this service on port 9001 whose web view can be accessed through 127.0.0.1:9001 had it been a local machine.
But since it is not a local machine, how do I access it?
I got the ip address of the machine using ifconfig | grep inet and then tried accessing it through https://172.11.11.1:9001/
Bit dint work.
When I tried wget https://172.11.11.1:9001/ it shows
Connecting to 172.31.19.8:9001... and hangs there.
I have added the following line in my supervisor conf file.
[inet_http_server]
port = *:9001
Can someone please help me with this?
This is more of a server config question. You'll most likely find your AWS access properties allow connections on post 22, 80 and 443 only. In AWS console you'll need to add a new security access group to allow port 9001 to be accessed.

Windows Container with Docker: Cannot reach httpd in container from host (Win2016 TP5)

I have a Windows Server 2016 TP5 machine that I use as a container host.
I have a Windows Container running that I manage with Docker. Inside this container I have an Apache httpd running on port 88.
The port mapping when I start the container is: 0.0.0.0:80->88/tcp, so I map port 80 of my container host to port 88 of the container.
This is the output from docker inspect: http://pastebin.com/AVem1eGV
I can now reach the Apache http start page from any other computer in the network through the DNS or IP.
In my case:
http://10.10.1.162/
http://documents.test2016-3.company.com/
But the same does not work when I try to call the same from the host system itself or from inside the container. So, on the host system, I try to access the same URL via browser or wget, and getting:
C:\> wget -UseBasicParsing http://documents.test2016-3.company.com/
wget : Unable to connect to the remote server
in both cases.
But I can ping the host from both the host itself as well as the container.
From the host:
C:\>ping test2016-3.company.com
Ping wird ausgeführt für TEST2016-3.company.com [fe80::847a:1430:8a10:b120%4] mit 32 Bytes Daten:
From the container:
PS C:\> ping documents.test2016-3.company.com
Pinging documents.test2016-3.company.com [10.10.1.162] with 32 bytes of data:
which seems to be able to resolve the name just fine.
What does work though is to call the Apache default page via the container hostname (which is win-de6u4068naf) and its running port directly (not through the port mapping), both from the host as well as inside the container:
http://win-de6u4068naf:88/
Just going the route through the container host hostname and mapped port from the host or container itself does not work properly!
Firewall rules allow everything on port 80 from any remote address or to port 80 (=inbound and outbound rules are both set to "allow" for "any").
I know that Microsoft/Docker changed the networking code base of the container/docker support from Windows Server 2016 TP4 to TP5. Not sure if that's related, or whether this is a bug or I'm having something not configured correctly yet.
I made a test and left Docker/Container out of the picture above and installed a plain Apache httpd itself on the container host system on port 80 (and no Docker running at all) just to check whether such setup works or not, in order to be sure that it is actually somehow Docker/Container related and not a problem with my network/host configuration in general. And this works fine, I can reach the Apache from outside as well as from the host itself, thus it must be a Docker/Container related problem.
Environment:
Windows Server 2016 TP5
Docker version 1.12.0-dev, build 2b97201
Got a reply on Microsoft's Github:
https://github.com/Microsoft/Virtualization-Documentation/issues/253#issuecomment-217975932
This is a known limitation in our Windows NAT implementation (WinNAT)
that you cannot access the external port in a static port mapping
directly from the container (NAT) host.

Wakanda Server 10 on Amazon EC2, cannot listen for connections on port 8080 or secure port 4433 on all IP addresses

I have installed wakanda server on an Amazon EC2 server running ubuntu by following this utube video: https://www.youtube.com/watch?v=uSQODnB7wRU .
Now the video is for an older version but I have followed along successfully until I actually launch wakanda on the server. This is what I get in the console:
Welcome to Wakanda Server 10 build 10.187175
Publishing "DefaultSolution" solution
The solution's log file will be stored in the "/home/ubuntu/.Wakanda Server/UserCache/Wakanda Server/DefaultSolution-1882/Logs/" folder
The Administration Web Server cannot listen for connections on port 8080 or secure port 4433 on all IP addresses
You can customize the Administration Web Server's ports with the "--admin-port" and "--admin-ssl-port" options
, then when I try to log into it via the browser it says the connection dropped! Any help would be much appreciated, it seams I need to restrict the IP addresses which can access, but how?
Your wakanda server tried and failed to listen on 8080 and/or 4433
Check the following things:
Are the ports 8080 and/or 4433 used by other processes? (sudo netstat -tapen | grep :8080, if a result is found, then yes another process uses 8080. Check 4433 also)
You may found that wakanda server is already running as a service:
yes you should use this service (create and edit /etc/default/wakanda, add WAKANDA_SOLUTION_AT_STARTUP=your_path and restart with sudo /etc/init.d/wakanda restart)
or to continue starting it manually, stop the service first (sudo /etc/init.d/wakanda stop)
Has the current user the right to listen on those ports? (try running the server with sudo just to check, then use authbind or equivalent)
Can you use alternative ports? (use --admin-port and --admin-ssl-port wakanda server options)
wakanda-server --help will give you the list of options available, especially --solution=VALUE to provide the path to your solution.

Resources