Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hey Justin,
Thanks for the great tutorial! I spotted a error and typo at the upstream tomcat block.
127.0.0.1:8080 fail_timout=0; should be server 127.0.0.1:8080 fail_timeout=0;
One thing that you may want to add to the guide above is to have users run $netstat -ln to confirm that the AJP listener is alive on port 8009. I believe the package ‘tomcat8-admin’ package enables it by default.
I didn’t install that package, so I enabled the listener by un-commenting <Connector port=“8009” protocol=“AJP/1.3” redirectPort=“8443” /> in /etc/tomcat8/server.xml and then restarting tomcat8
By the way, this is good technical writing. It nicely anticipates the reader’s context so the information given is the appropriate level of detail. Nice work.
For spiders :
This will fix the error in /var/log/apachet2/mod_jk.log : (ajp13_worker) Failed opening socket to (::1:8009) (errno=111)
“Service Unavailable The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.”
Thanx Justin. I’ve been sitting for 2 days straight trying to figure out the SSL config for Tomcat 8. The reference guide at apache is ****. This approach took less than an hour an know I have a secure connection to my Tomcat. So thanx to you I’m only 2, and thank God not 2++, days behind schedule :D
Hello,
In Section Prerequisites, you said that DO NOT install PHP and MySQL.
How can I secure install them with encrypt connection after this ?
Thanks so much.
Hello Justin! I appreciate for your tutorials. Great!
I finished this tutorial with all prerequisites. Main tomcat page opens via https. But:
along with:
Thank you!
This tutorial helped me encrypt Tomcat 8 connections with Apache 2.4 on Ubuntu 16.04.
However, one of the problems I had was that Websocket doesn’t work over mod_jk. As a result, the WebSocket examples on Tomcat home page didn’t work (ex: localhost:8080/examples/websocket/chat.xhtml) after editing server.xml (i.e., adding address=“127.0.0.1”) to restrict access to the tomcat installation.
I ended up enabling mod_proxy_wstunnel and modifying my virtualhost files to make Apache also proxy the WebSockets.
Now I have Apache reverse proxy Tomcat connection with WebSocket on https! Yay!
Hi, Nice tutorial!
I have few questions:
2)if I want to have this structure: https://example.com/ - static site nginx https://example.com/tomcat - tomcat manger (with working links) https://example.com/app - tomcat app (deployed at /app on tomcat)
What configuration should I use?
Thank you!
Everything works until the last step, which is to change the HTTP and AJP Connectors in server.xml to only listen on localhost. Here’s the change I made to the AJP Connector:
<Connector port="8009" address="127.0.0.1" protocol="AJP/1.3" redirectPort="8443" />
Before this change, typing https://myhostname takes me to the Tomcat administration page; after it, I get “503 Service Unavailable”.
Here’s the relevant portion of mod_jk.log
[info] jk_open_socket::jk_connect.c (817): connect to ::1:8009 failed (errno=111)
[Thu Mar 23 17:37:13.808 2017] [14484:140252643563264] [info] ajp_connect_to_endpoint::jk_ajp_common.c (1068): (ajp13_worker) Failed opening socket to (::1:8009) (errno=111)
[Thu Mar 23 17:37:13.808 2017] [14484:140252643563264] [error] ajp_send_request::jk_ajp_common.c (1728): (ajp13_worker) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=111)