I am experiencing a weird issue on a CentOS 7 virtual machine and I can't see what is causing it.
I created the VM on Digital Ocean and set it up as follows:
1) modified /etc/hostname
with myhostname
2) modified /etc/hosts
as such
127.0.0.1 localhost.localdomain localhost
127.0.0.1 localhost4.localdomain4 localhost4
123.456.789.123 myhostname.mydomainname.com myhostname
::1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
3) Configured nginx to reverse proxy
server {
listen 80;
server_name myhostname.mydomainname.com;
gzip on;
location / {
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:8080/;
}
}
That's it.
I then downloaded a vanilla Apache Tomcat from https://tomcat.apache.org/ and unpacked in the home of my (non-root) user.
If I run it with startup.sh
it seems to get up correctly, however if I try to run
wget http://localhost:8080/
it hungs there forever... :\
SELinux is disabled by default and I didn't re-enable it.
The firewall is configured however I tried to disable it with no better luck.
Nginx works correctly, no issue.
I tried both the Oracle and the OpenJDK JVMs.
Any idea what is causing this?
UPDATE: The output of sudo netstat -atnp|grep LISTEN
$ sudo netstat -atnp|grep LISTEN
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 10634/nginx: master
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1100/sshd
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 9645/postgres
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1503/master
tcp6 0 0 :::8009 :::* LISTEN 12527/java
tcp6 0 0 :::8080 :::* LISTEN 12527/java
tcp6 0 0 :::80 :::* LISTEN 10634/nginx: master
tcp6 0 0 :::22 :::* LISTEN 1100/sshd
tcp6 0 0 ::1:5432 :::* LISTEN 9645/postgres
tcp6 0 0 ::1:25 :::* LISTEN 1503/master
UPDATE 2: I noticed that Tomcat eventually becomes active but it takes minutes. Such behavior is not normal for a "vanilla" instance.