How to resolve .htaccess 'SetEnv' for tomcat

Aoifem

Registered
Feb 18, 2019
1
0
1
Ireland
cPanel Access Level
Root Administrator
Hi all,

I am trying to host my java website and having a bit of trouble. I followed this tutorial: How to Deploy Java Applications - cPanel Knowledge Base - cPanel Documentation

But I am receiving and Internal Server Error when trying to access the domain from the web.
The message in the Error logs say:
/home/myusername/public_html/.htaccess: Invalid command 'SetEnv', perhaps misspelled or defined by a module not included in the server configuration

In my .htaccess file is:
SetHandler jakarta-servlet
SetEnv JK_WORKER_NAME ajp13

Could someone shed some light on the code that would fix this error?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,227
463
Hello @Aoifem,

The document you referenced is intended for systems using EasyApache 3. EasyApache 3 is near end-of-life status, and thus it's generally advised to convert your system to EasyApache 4 and install Tomcat with the instructions documented below:

Tomcat - EasyApache 4 - cPanel Documentation

Let me know if you have any questions.

Thank you.