How to Install Apache Tomcat In Linux Ubuntu 18 - Tecnew

Home Ads

How to Install Apache Tomcat In Linux Ubuntu 18

How to Install Apache Tomcat In Linux Ubuntu 18

Share This

 

Tomcat server is mainly used for app deployment

For that we have to install the following

in Ubuntu server:

apt   update

apt install openjdk-8-jdk   -y

wget   -y

After that download tomcat 8:

wget https://mirrors.estointernet.in/apache/tomcat/tomcat-8/v8.5.61/bin/apache-tomcat-8.5.61.tar.gz

move into /usr/local/

mv   apache-tomcat-8.5.61.tar.gz   /usr/local/

tar   xzvf    apache-tomcat-8.5.61.tar.gz

Change the directory to apache-tomcat-8.5.61

cd   apache-tomcat-8.5.61

in that bin directory starts the service by the startup.sh file

bin/startup.sh        à To start the tomcat server

logs are stored In the tomcat in logs directory Catalina. out (wget installed on are in logs directory)

otherwise in /var/log directory

Open the tomcat application in the website by giving the publicip:8080

1.Click on manager App button it throws an error by removing this error edit the contex.xml file in webapps/manager/META-INF/contex.xml in that to add the remote access under the comment section like <!--              -->

2.To add users in conf/tomcat-users.xml in this file uncomment the user section keep only one user in role name give manager-gui and manager-script in user role section gives both

 To stop tomcat service

bin/shutdown.sh

To start tomcat service

bin/startup.sh   

Another way to start the service by

Update file with the following content.

vi /etc/systemd/system/tomcat.service

 

[Unit]

Description=Tomcat

After=network.target

 

[Service]

User=tomcat

WorkingDirectory=/usr/local/tomcat8

Environment=JRE_HOME=/usr/lib/jvm/jre

Environment=JAVA_HOME=/usr/lib/jvm/jre

Environment=CATALINA_HOME=/usr/local/tomcat8

Environment=CATALINE_BASE=/usr/local/tomcat8

ExecStart=/usr/local/tomcat8/bin/catalina.sh run

ExecStop=/usr/local/tomcat8/bin/shutdown.sh

SyslogIdentifier=tomcat-%i

 

[Install]

WantedBy=multi-user.target


Reload the Demon and Start the tomcat service

 systemctl daemon-reload

 systemctl start tomcat

 systemctl enable tomcat

No comments:

Post a Comment