Play Application runs on port 443 but nothing resolves from a browser - https

We have a Play application running on a Linux box that resolves to port 443 instead of port 80 or port 9000.
The application is up and running without errors - there are no errors in the SSH console.
Port 80 is disabled (HTTP) but we want to have the web application appear in the browser using port 443 (HTTPS).
We have the application.conf file set up to use the correct port as well as the correct keystore path and keystore type (JKS).
Since there are no errors, we would like to know what we can do to correct this situation. Any help would be great!

Related

"bind: An attempt was made to access a socket in a way forbidden by its access permissions"

Say we have frontend and backend containers based on Docker Desktop (for Windows).
Backend container uses port 9001, and the frontend container listens to 9001.
The problem is that port 9001 is already in use by Windows 10 by the Intel driver, and it is impossible to run a container on this port:
Error response from daemon: Ports are not available: listen tcp 0.0.0.0:9001: bind: An attempt was made to access a socket in a way forbidden by its access permissions.
Could you please advise what is the way to handle this port if there is no ability to change it directly from application code?
A couple of ways:
When either using a docker run command, specify the host port to use, and set it to something other than 9001. i.e. -p 9002:9001 or Docker Compose, i.e.
ports:
- '9002:9001'
Then use port 9002 instead of 9001 when accessing the container from the host (Win 10).
Use Nginx and set up a reverse proxy, leave the host port empty when starting the container so no external post is opened on the host, and have the reverse proxy pass it over to the container's 9001 port.

<SpringBoot> Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-12-28 09:49:48.561 ERROR 482 --- [ main] o.s.boot.SpringApplication : Application run failed
when I try to start server with command:
java -jar jin-alpha-1.0.jar
under AWS Ubuntu linux server.
In case of trying to local start server was success.
The Changed port is suspicious the reason why before changed It work.
I changed Server port from 8080 to 80.(The reason why AWS http allowed only 80 port)
Local Case : The port of Tomcat server ==> 8080 and 80, Both of them are work. and Stared
AWS Ubuntu : Start with 8080 is work but 80 is not work and Error displayed Above.
I got solution.
I Changed Tomcat port from 80 to 8080. so Server started under Aws ubuntu.
(I don't still know why 80 port is not work under Aws Ubutu)
and Add "Custom TCP Rule" with 8080 port Range.
These are called Priviliged ports on *nix systems. The TCP/IP port numbers below 1024 are special in that normal users are not allowed to run servers on them. This is a security feaure, in that if you connect to a service on one of these ports you can be fairly sure that you have the real thing, and not a fake which some hacker has put up for you.
The normal port number for W3 servers is port 80. This number has been assigned to WWW by the Internet Assigned Numbers Authority, IANA.
When you run a server as a test from a non-priviliged account, you will normally test it on other ports, such as 2784, 5000, 8001 or 8080.
Hope this explains why you cannot run on 80. There are workarounds like running as root. Which I dont recommend as if some hacker gets access to the service then they get root privileges on the box. You need to be careful not running services on such ports.

I can't connect a webpage on my ec2

I am building simple webpage.
I could run on my local host.
I made ec2 instance, I opened ports 22, 8000.
I could connect with ssh and run server for webpage,
but I get this error
this is my github address that contain the code.
enter link description herehttps://github.com/MoreNiceJay/django2
In your security group rules, open port 80
This is the standard port for http traffic
Other things to check: login to the host with ssh and use netstat |grep LISTEN to see if there is a process listening on port 80

Access Docker forwarded port on Mac

There is a related post here: Port mapping in Docker on Mac OSX installed with Docker Toolbox
but it didn't work for me
Get ports for container
docker port 485186e65a5e
8080/tcp -> 0.0.0.0:33360
8088/tcp -> 0.0.0.0:33359
19888/tcp -> 0.0.0.0:33358
50070/tcp -> 0.0.0.0:33357
50075/tcp -> 0.0.0.0:33356
8042/tcp -> 0.0.0.0:33361
Check that someone listens to ports in container
bash-4.1# netstat -alnpt | grep 19888
tcp 0 0 127.0.0.1:19888 0.0.0.0:* LISTEN 1094/java
Do wget in container
bash-4.1# wget 127.0.0.1:19888
--2016-04-11 14:16:54-- http://127.0.0.1:19888/
Connecting to 127.0.0.1:19888... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://127.0.0.1:19888/jobhistory [following]
--2016-04-11 14:16:54-- http://127.0.0.1:19888/jobhistory
Reusing existing connection to 127.0.0.1:19888.
HTTP request sent, awaiting response... 200 OK
Length: 6763 (6.6K) [text/html]
Saving to: `index.html'
100%[================================================================================================================================================================================>] 6,763 --.-K/s in 0s
2016-04-11 14:16:54 (182 MB/s) - `index.html' saved [6763/6763]
Try to access forwarded port from host, no luck... :(((
$docker-machine ip default
192.168.99.100
$ wget 192.168.99.100:33358
--2016-04-11 16:18:04-- http://192.168.99.100:33358/
Connecting to 192.168.99.100:33358... failed: Connection refused.
What do I do wrong?
Omg, desired service started on 127.0.0.1 in container, that is why it wasn't visible from outside world. I've modified service config to start on 0.0.0.0 and now I can access forwarded container port
I had the same problem and was able to fix it by specifying the host that the server within the container uses.
NOTE: when using host below, it means a web server host. When I use host-machine, I mean the main operating system I'm using, (i.e. not a container or a web server, just my laptop as a machine)
The Problem
Running web servers on the container like webpack-dev-server and http-server automatically run the app using a host of http://localhost. Typically you will see that in the output when you start the server. Something like :
Project is running at http://localhost:8080
or
Server available at http://127.0.0.1:8080
On most machines, localhost and 127.0.0.1 are the same thing. This host is not publicly viewable. As a result, your host machine can't see anything, even though it's looking in the right place.
Solution
You should specify a public host when you run the server inside your container.
webpack-dev-server --port 8080 --host 0.0.0.0
or
http-server -p 8080 -a 0.0.0.0
Because the 0.0.0.0 address is viewable to any outside machine, you should be able to see your app working as expected from your host machine.
NOTE: This works for any server, like Python's SimpleHTTPServer, etc. Just look up how to change the host for your chosen server in the documentation
Resources/Nods
(how to run webpack-dev-erver with a publicly accessible host)[How to make the webpack dev server run on port 80 and on 0.0.0.0 to make it publicly accessible?

How to redirect localhost to 127.0.0.1:8080?

When I check using Apache > Service > Test Port 80, then it shows
Your port 80 is actually used by :
Server: Microsoft-HTTPAPI/2.0
How can I disable this. Tried every possible way, even via registry, and stopping World Wide Web Publishing.
I don't think that's possible. When you type "localhost" into the browser, it resolves that to "127.0.0.1", and fills in the default port of 80. If nothing is listening there, it won't connect. It can't resolve "localhost" to "127.0.0.1:8080". If you can't use port 80, you have to specify the port you want. Use a bookmark if it makes it easier for you.
This is basically redirecting 127.0.0.1:80 to 127.0.0.1:8080
Win7 has no iptables equivalent. Writing a server that does what you want (listens on a port, copies everything to/from another) should be easy enough. You can find one at this URL: http://www.quantumg.net/portforward.php
$> netsh
$> interface portproxy
$> add v4tov4 listenport=xxx connectaddress=127.0.0.1 connectport=yyy protocol=tcp
[or]
port forwarding in windows
Suggestion: If your Apache is under your WIn10
Under Win Settings:
- Proxy - Manual proxy setup - Use a proxy server - Turn On
- Type under Manual proxy server http=127.0.0.1:8080;https=127.0.0.1:8080
- Press the Save button
and tell me if it is working.

Resources