Re: [EXTERNAL EMAIL] Please help me install Tomcat

2023-01-20 Thread logo

Amn,

Am 2023-01-20 02:45, schrieb Niranjan Rao:
Do you absolutely need to have it as a service? If not, just expand the 
tarball and run catalina.sh start from bin directory. Works perfectly


Any information in catalina.out? We need to figure out at what point 
it's failing and that will send us in right direction.



Regards,

Niranjan

On 1/19/23 16:58, Amn Ojee Uw wrote:
I've tried to install Tomcat, different version, like so : /# Download 
the
latest release of tomcat 10. 1. 5// //wget 
https: //urldefense. com/v3/__https:

 //downloads. apache. org/tomcat/tomcat-8/v8. 5. 85/bin/apache-tomcat-8. 5. 85.
 tar.
 
gz/*__;Lw!!CbU71lC5478d!PQG2f-qpzolvTEMMw0ilGWqdDBsGaYhVA-jquU1JJWgTwYB2s-Ufj0gDHfpQ_FIqwWs1jdhmY2SJyf-2$
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
ZjQcmQRYFpfptBannerEnd

I've tried to install Tomcat, different version, like so :
/# Download the latest release of tomcat 10.1.5//
//wget
https://urldefense.com/v3/__https://downloads.apache.org/tomcat/tomcat-8/v8.5.85/bin/apache-tomcat-8.5.85.tar.gz/*__;Lw!!CbU71lC5478d!PQG2f-qpzolvTEMMw0ilGWqdDBsGaYhVA-jquU1JJWgTwYB2s-Ufj0gDHfpQ_FIqwWs1jdhmY2SJyf-2$ 
  


//
//# Create tomcat directory//
//sudo mkdir /opt/tomcat//
//
//# Extract the binary file with tar command in the /opt/tomcat path//
//sudo tar -xvf apache-tomcat-8.5.85.tar.gz -C /opt/tomcat
--strip-components=1//
//
//# Create a group called tomcat//
//sudo groupadd tomcat//
//
//# Set the following ownership and permissions to the /opt/tomcat //
//sudo chown -R jamiil /opt/tomcat//


that may be already the problem, as the tomcat user does not have 
permissions for the installation directories (log, work, temp)




//sudo sh -c 'chmod +x /opt/tomcat/bin/*.sh'//
//
//# Create a systemd file for Apache Tomcat//
//sudo gedit /etc/systemd/system/tomcat.service//
//
//[Unit]//
//Description=Tomcat webs servlet container//
//After=network.target//
//[Service]//
//Type=forking//
//User=tomcat//
//Group=tomcat//
//RestartSec=10//
//Restart=always//
//Environment="JAVA_HOME=/usr/lib/jvm/java-1.17.0-openjdk-amd64"//
//Environment="JAVA_OPTS=-Djava.awt.headless=true
-Djava.security.egd=file:/dev/./urandom"//
//Environment="CATALINA_BASE=/opt/tomcat"//
//Environment="CATALINA_HOME=/opt/tomcat"//
//Environment="CATALINA_PID=/opt/tomcat/temp/tomcat.pid"//
//Environment="CATALINA_OPTS=-Xms512M -Xmx1024M -server
-XX:+UseParallelGC"//
//ExecStart=/opt/tomcat/bin/startup.sh//
//ExecStop=/opt/tomcat/bin/shutdown.sh//
//[Install]//
//WantedBy=multi-user.target//
//
//
//# Reload all the unit files//
//sudo systemctl daemon-reload//
//
//# Start the Apache Tomcat daemon and enable it to start on system
startup.//
//sudo systemctl daemon-reload/

But, every time I try to start tomcat this happens

/sudo systemctl start tomcat/
*/Job for tomcat.service failed because the control process exited 
with

error code/*.
See "systemctl status tomcat.service" and "journalctl -xe" for 
details.



systemctl status tomcat.service reports

/● tomcat.service//
// Loaded: loaded (/etc/systemd/system/tomcat.service; disabled;
vendor preset: enabled)//
// Active: activating (auto-restart) (Result: exit-code) since Thu
2023-01-19 19:43:51 EST; 8s ago//
//Process: 5789 ExecStart=/opt/tomcat/bin/startup.sh
//*(code=exited, status=217/USER)*//
//CPU: 2ms/

and

journalctl -xe reports
/Hint: You are currently not seeing messages from other users and the
system.//


you need to run this with sudo right, as you don't see the service logs 
from other users


I agree with Niranjan, that it is in this early stage not nescessary to 
run tomcat as a service. Makes it far more complicated to get it 
running.


Run as a dedicated tomcat user is recommended, so run it with sudo -u 
tomcat /opt/tomcat/bin/startup.sh


Please consider separating CATALINA_HOME (installation) from 
CATALINA_BASE (config and dynamic data). That makes upgrading much 
easier.


see RUNNING.txt

Hope this helps

Peter

//  Users in groups 'adm', 'systemd-journal' can see all 
messages.//

//  Pass -q to turn off this notice.//
//Jan 19 19:38:06 arbolone sudo[5537]: pam_unix(sudo:session): session
opened for user root(uid=0) by (uid=1000)//
//Jan 19 19:38:06 arbolone sudo[5537]: pam_unix(sudo:session): session
closed for user root//
//Jan 19 19:38:12 arbolone gnome-software[1607]: Only 0 apps for 
recent

list, hiding//
//Jan 19 19:38:12 arbolone gnome-software[1607]: hiding category
graphics featured applications: found only 0 to show,>//
//Jan 19 19:38:12 arbolone gnome-software[1607]: hiding category
productivity featured applications: found only 0 to s>//
//Jan 19 19:38:12 arbolone gnome-software[1607]: automatically 
prevented

from changing kind on system/package/debian-s>//
//Jan 19 19:38:58 

Re: [EXTERNAL EMAIL] Please help me install Tomcat

2023-01-19 Thread Niranjan Rao
Do you absolutely need to have it as a service? If not, just expand the 
tarball and run catalina.sh start from bin directory. Works perfectly


Any information in catalina.out? We need to figure out at what point 
it's failing and that will send us in right direction.



Regards,

Niranjan

On 1/19/23 16:58, Amn Ojee Uw wrote:

I've tried to install Tomcat, different version, like so : /# Download the
latest release of tomcat 10. 1. 5// //wget https: //urldefense. com/v3/__https:
 //downloads. apache. org/tomcat/tomcat-8/v8. 5. 85/bin/apache-tomcat-8. 5. 85.
 tar.
 
gz/*__;Lw!!CbU71lC5478d!PQG2f-qpzolvTEMMw0ilGWqdDBsGaYhVA-jquU1JJWgTwYB2s-Ufj0gDHfpQ_FIqwWs1jdhmY2SJyf-2$
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
ZjQcmQRYFpfptBannerEnd

I've tried to install Tomcat, different version, like so :
/# Download the latest release of tomcat 10.1.5//
//wget
https://urldefense.com/v3/__https://downloads.apache.org/tomcat/tomcat-8/v8.5.85/bin/apache-tomcat-8.5.85.tar.gz/*__;Lw!!CbU71lC5478d!PQG2f-qpzolvTEMMw0ilGWqdDBsGaYhVA-jquU1JJWgTwYB2s-Ufj0gDHfpQ_FIqwWs1jdhmY2SJyf-2$
   

//
//# Create tomcat directory//
//sudo mkdir /opt/tomcat//
//
//# Extract the binary file with tar command in the /opt/tomcat path//
//sudo tar -xvf apache-tomcat-8.5.85.tar.gz -C /opt/tomcat
--strip-components=1//
//
//# Create a group called tomcat//
//sudo groupadd tomcat//
//
//# Set the following ownership and permissions to the /opt/tomcat //
//sudo chown -R jamiil /opt/tomcat//
//sudo sh -c 'chmod +x /opt/tomcat/bin/*.sh'//
//
//# Create a systemd file for Apache Tomcat//
//sudo gedit /etc/systemd/system/tomcat.service//
//
//[Unit]//
//Description=Tomcat webs servlet container//
//After=network.target//
//[Service]//
//Type=forking//
//User=tomcat//
//Group=tomcat//
//RestartSec=10//
//Restart=always//
//Environment="JAVA_HOME=/usr/lib/jvm/java-1.17.0-openjdk-amd64"//
//Environment="JAVA_OPTS=-Djava.awt.headless=true
-Djava.security.egd=file:/dev/./urandom"//
//Environment="CATALINA_BASE=/opt/tomcat"//
//Environment="CATALINA_HOME=/opt/tomcat"//
//Environment="CATALINA_PID=/opt/tomcat/temp/tomcat.pid"//
//Environment="CATALINA_OPTS=-Xms512M -Xmx1024M -server
-XX:+UseParallelGC"//
//ExecStart=/opt/tomcat/bin/startup.sh//
//ExecStop=/opt/tomcat/bin/shutdown.sh//
//[Install]//
//WantedBy=multi-user.target//
//
//
//# Reload all the unit files//
//sudo systemctl daemon-reload//
//
//# Start the Apache Tomcat daemon and enable it to start on system
startup.//
//sudo systemctl daemon-reload/

But, every time I try to start tomcat this happens

/sudo systemctl start tomcat/
*/Job for tomcat.service failed because the control process exited with
error code/*.
See "systemctl status tomcat.service" and "journalctl -xe" for details.


systemctl status tomcat.service reports

/● tomcat.service//
// Loaded: loaded (/etc/systemd/system/tomcat.service; disabled;
vendor preset: enabled)//
// Active: activating (auto-restart) (Result: exit-code) since Thu
2023-01-19 19:43:51 EST; 8s ago//
//Process: 5789 ExecStart=/opt/tomcat/bin/startup.sh
//*(code=exited, status=217/USER)*//
//CPU: 2ms/

and

journalctl -xe reports
/Hint: You are currently not seeing messages from other users and the
system.//
//  Users in groups 'adm', 'systemd-journal' can see all messages.//
//  Pass -q to turn off this notice.//
//Jan 19 19:38:06 arbolone sudo[5537]: pam_unix(sudo:session): session
opened for user root(uid=0) by (uid=1000)//
//Jan 19 19:38:06 arbolone sudo[5537]: pam_unix(sudo:session): session
closed for user root//
//Jan 19 19:38:12 arbolone gnome-software[1607]: Only 0 apps for recent
list, hiding//
//Jan 19 19:38:12 arbolone gnome-software[1607]: hiding category
graphics featured applications: found only 0 to show,>//
//Jan 19 19:38:12 arbolone gnome-software[1607]: hiding category
productivity featured applications: found only 0 to s>//
//Jan 19 19:38:12 arbolone gnome-software[1607]: automatically prevented
from changing kind on system/package/debian-s>//
//Jan 19 19:38:58 arbolone sudo[5571]:   jamiil : TTY=pts/0 ;
PWD=/home/jamiil/Downloads ; USER=root ; COMMAND=/usr/bi>//
//Jan 19 19:38:58 arbolone sudo[5571]: pam_unix(sudo:session): session
opened for user root(uid=0) by (uid=1000)//
//Jan 19 19:38:59 arbolone gnome-shell[1443]: Window manager warning:
Buggy client sent a _NET_ACTIVE_WINDOW message w>//
//Jan 19 19:39:01 arbolone gnome-shell[1443]: libinput error: client
bug: timer event10 debounce short: scheduled expi>//
//Jan 19 19:39:05 arbolone gnome-shell[1443]: libinput error: event10 -
Logitech Wireless Mouse: client bug: event pro>//
//Jan 19 19:40:13 arbolone sudo[5571]: pam_unix(sudo:session): session
closed for user root//
//Jan 19 19:40:27 arbolone sudo[5672]:   jamiil :