0

im running on my ubuntu server tomcat. I can start the service as root and can access my localhost:8443server.If i started the service as non-root like tomcat,the service will be started as tomcat ,but can't access my localhost:8443 webserver or rather don't answering me.

what i have done :

I. I add the user tomcat at first:

adduser tomcat ;addgroup tomcat

II. then i changed the service settings in /etc/systemd/tomcat.service from root to:

[Service] 
user=tomcat 
group=tomcat

III. changed the permission of my tomcat folder /tomcat:

chown tomcat:tomcat /tomcat -R
chmod 755 /tomcat

netstate -nlp ports 8080, 8443 -> good

iptables -L -v no dropped file -> good

service started as tomcat -> good

But i can't still reach the server. If i changed the user,group to root in tomcat.service i reach the server.

I don't know where is the problem.

I'm grateful, if some experts can help me out.

kind regards

beardblack

beard black
  • 67
  • 2
  • 14
  • Look in the logs: `$CATALINA_BASE/logs`. The most probable cause is Tomcat being unable to read the certificate and key. Also posting the entire `tomcat.service` might help. Are you aware, that most distributions have a ready `.service` file for Tomcat: e.g. [Debian 10](https://salsa.debian.org/java-team/tomcat9/blob/b0a9cb7bd46ac37deff7e0208afeb69f427dfa8f/debian/tomcat9.service)? – Piotr P. Karwasz Jan 28 '20 at 22:09
  • But why certificate? I can 't still access the server over the Port 8080 too – beard black Jan 28 '20 at 22:18
  • A wild guess, since you don't mention trying over `HTTP` in the question and you don't provide any other data. You have clearly a permission problem. – Piotr P. Karwasz Jan 28 '20 at 22:41
  • yes i thing, i know what the problem is. in sever.xml the key is in another folder for admin and the logs too. Maybe folder permission cause the problem. i will check it up and report you. but thx. – beard black Jan 28 '20 at 23:00

0 Answers0