marscarda
By:
marscarda

Tomcat 8 not working on Centos/Fedora

January 19, 2018 353 views
Apache Java Fedora

Hi.
I'm having trouble making work Apache Tomcat on Centos & Fedora.

Y just dowloaded it from the official site the file apache-tomcat-8.5.24.tar.gz & untar-ed it
I also downloaded the official JAVA jre-8u161-linux-x64.rpm from Oracle.
Everything look well.

This is a copy of my command window.

Last login: Fri Jan 19 21:19:58 2018 from 181.28.136.32
[root@tomcat ~]# java -version
java version "1.8.0161"
Java(TM) SE Runtime Environment (build 1.8.0
161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)
[root@tomcat ~]#

Now I go to the location I have untar-ed tomcat 8

[root@tomcat bin]# ./startup.sh
Using CATALINABASE: /tmp/tr/tomc
Using CATALINA
HOME: /tmp/tr/tomc
Using CATALINATMPDIR: /tmp/tr/tomc/temp
Using JRE
HOME: /usr
Using CLASSPATH: /tmp/tr/tomc/bin/bootstrap.jar:/tmp/tr/tomc/bin/tomcat-juli.jar
Tomcat started.
[root@tomcat bin]#

And finally to test everything is fine

[root@tomcat bin]# wget localhost:8080
--2018-01-19 21:31:15-- http://localhost:8080/
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:8080... connected.
HTTP request sent, awaiting response...

And it remains like this forever. Let alone if I try to access from my web browser.
Any solution to this problem?
What's funny is the very first time it worked fine for just once but when this started to happen i restored the server from a Snapshot and restarted all the installation process.
This how I know it isn't requiring jdk instead of jre. And since I am trying to access from the local droplet it doesn´t look like the problem is any firewall.

I also followed some tutorial and added to the end of catalina.sh

(The line fi was already there)

fi

JAVAOPTS= "$JAVAOPTS -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses"

I started several fresh linux (Centos and Fedora) instalations and the problem persists.

Thanks in advance for any help since I need to have a production server working as soon as the end of this month.

1 Answer

Hello again.
I repeated all the same installation steps but in Centos 6.9 x64 And it worked normally.
Did anyone have this issue before?.
Is it a Centos 7 issue, A tomcat issue or Digitalocenas's Centos 7 issue?

Have another answer? Share your knowledge.