Tomcat 9 on port 80 in CentOS 7.6 - centos7

How to configure Tomcat 9.0.52 on port 80 (http) in CentOS 7.6 ?
Already changed the server.xml file to use port 80, but it is not working.

Related

AWS EC2 Instance (amazon Linux) refused connecting Custom TCP ports

I have created an EC2 (Amazon Linux) on Aws. I have a flask server which is running on port 8080. And have opened the same port in security group.
But the EC2 refused to connect on the 8080 port (xxx.xx.xxx.xx:8080), while the port 80 is accessible, I have Nginx running on port 80.
I tested the setup using the flask example and works for me : https://pythonprogramminglanguage.com/flask-hello-world/
Steps:
1 Launch a new Amazon EC-2 Instance (used Amazon Linux AMI)
2 Installed Python and pip.
[3] Created a new web.py file, (modified the port from 5000 to 8080 and added rule in the security group for EC2)
[4] Ran, python3 web.py

Health Check on Cloud Foundry

I have a question Regarding ”Health Check” of an Application. I am referring to document : https://docs.cloudfoundry.org/devguide/deploy-apps/healthchecks.html and I understand that when we deploy an application a default “health check” is created which is of type PORT. CloudFoundry automatically checks this port for health status.
My question is:
I have deployed an application on CF with default Health Check. When I ssh into the deployed application , and try to search the available ports using command lsof -i -P -n, I see the following response :
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 7 vcap 47u IPv4 474318791 0t0 TCP *:8080 (LISTEN)
diego-ssh 8 vcap 3u IPv4 474330297 0t0 TCP *:2222 (LISTEN)
diego-ssh 8 vcap 7u IPv4 474330524 0t0 TCP 10.XXX.XX.XXX:2222->10.YYY.YY.YYY:58858 (ESTABLISHED)
Can you tell me which one of the above response acts as the health check port ? ( or am I looking at the wrong place ??)
I understand that CF connects this port to do a health check for the deployed app. Is it possible to connect to this Health Check Port of a deployed application manually ( similar to what CF does internally) ? How to do so from a Mac system ( which has the cf cli installed )
Can you tell me which one of the above response acts as the health check port ? ( or am I looking at the wrong place ??)
I suspect that this is your application.
java 7 vcap 47u IPv4 474318791 0t0 TCP *:8080 (LISTEN)
It is listening on port 8080, which is almost always the port on which Cloud Foundry will tell your app to listen (i.e. $PORT).
This isn't a response though. It's your application listening for connections on that port. The health check (a TCP health check) will periodically run and make a TCP connection to the value assigned through $PORT (i.e. 8080). If that TCP connection is successful then the health check passes. If it cannot connect or times out, then the health check fails and the platform determines your application has crashed. It will then restart the application instance.
I understand that CF connects this port to do a health check for the deployed app. Is it possible to connect to this Health Check Port of a deployed application manually ( similar to what CF does internally) ?
Yes. cf ssh into your application. Then run nc -v localhost 8080. That will make a TCP connection. The -v flag gives you verbose output.
Ex:
> nc -v localhost 8080 # successful
Connection to localhost port 8080 [tcp/http-alt] succeeded!
> nc -v localhost 8081 # failure
nc: connectx to localhost port 8081 (tcp) failed: Connection refused
nc: connectx to localhost port 8081 (tcp) failed: Connection refused
How to do so from a Mac system ( which has the cf cli installed )
By default, you won't have access to do this directly. It's not really a fair comparison either. The health check runs from inside the container, so technically running nc from inside the container after you cf ssh is the most accurate comparison.
If you wanted to make this work, you could probably use the tunneling capability in cf ssh. I didn't test, but I think something like this would work: cf ssh -L 8080:localhost:8080 YOUR-HOST-APP.
You could then nc -v localhost 8080 and nc would connect to the local port on which ssh is listening (i.e. <local-port>:<destination>:<destination-port>). Again, if you want accuracy, then you should cf ssh into the container and run nc from there.

Dotnet app on EC2 Linux port 7070 not accessible

can't connect to an dotnet app running in an aws EC2 instance on port 7070
I've added the port to the security group and when I check if the port is open (netstat -ntlp) I get the output below:
tcp 0 0 127.0.0.1:7070 0.0.0.0:* LISTEN 27021/dotnet
Is there anything I'm missing?
I was able to fix the issue by downloading nginx to my EC2 instance
(https://gist.github.com/soheilhy/8b94347ff8336d971ad0) and forwarding my custom port to port 80
Hopefully this will help!

cannot reach my laravel site on 8000 port on aws ec2 ubuntu 18.04 instance

I am a beginner for AWS. I have launched AWS, EC2, ubuntu 18.04 instance. Now i need to launch my laravel application with a sub domain with port 8000 as laravel default port is 8000. i have created a sub domain with inbound rule for port 8000. But i cannot browse the sub domain When i try to browse with port 8000. but without port 8000, it works.
http://subdomain.mydomain.com - this works,
http://subdomain.mydomain.com:8000 - cannot reach

Cannot Connect to Https

Hello Guys I have trouble connecting my site to https,, it always says ERR_CONNECTION_TIMED_OUT, the weird part is I have allowed my server and firewall to open port 443,
I have windows server 2016 Datacenter,
i netstat -a and i found port 443 listening,
I have Apache 2.4,
I thought it was ok because on my testing server, https is working with the same setup
but on this I cannot find the answer, My server is on AWS, with ports 443, 22 and 80 open on security group
I been struggling for 1 week, please someone help, I can provide any information