geoserver-tomcat-catalina restart issue: Failed to initialize connector on port 443

Viewed 25

I needed to update the SSL cert on my GeoServer. I hence had to shut it down and restart. I am using Tomcat 8.5.56 and Geoserver 2.x (not sure exactly which one; hard to find out; it has been so long since installed)

I successfully shut it down by running sudo /opt/tomcat/bin/shutdown.sh and then manually finding any process that is somehow not shut-down and killing it. Then I update the conf/server.xml file with the new SSL cert info and finally run sudo /usr/bin/authbind --deep /opt/tomcat/bin/startup.sh and when i check on the Catalina logs: in $CATALINA_BASE/logs/catalina-<today>.log I get the following error:

14-Sep-2022 16:09:10.954 SEVERE [main] org.apache.catalina.core.StandardService.initInternal Failed to initialize connector [Connector[HTTP/1.1-443]]

I have tried stopping apache2 service in case it is "using" port 443. I have tried adjusting the Catalina server.xml file to configure the to use port 8443. But in all cases I still get the same error message "Failed to initialize connector".

I am at a loss of how to properly restart Tomcat/GeoServer.

1 Answers

I am not a 100% sure this was the problem: I originally used this "lazy" command to convert a "lets encrype" certbot-issued certificate into JKS (since I was honestly afraid of dealing with certs yet again) keytool -importcert -file /etc/letsencrypt/live/<domain>/fullchain.pem -keystore /opt/tomcat/conf/<name>.jks

BUT I asked someone experienced and they told me use this: openssl pkcs12 -export -inkey /etc/letsencrypt/live/<domain>/privkey.pem -in /etc/letsencrypt/live/<domain>/fullchain.pem -name test -out <name>.p12 AND THEN keytool -importkeystore -srckeystore <name>.p12 -srcstoretype pkcs12 -destkeystore <name>.jks

and do not use kill on the tomcat process, just use the shutdown and startup scripts to stop/start tomcat

if in doubt, set the permissions on the jks file to 777

somehow our geoserver is now working and with a valid certificate

Related