1. install jdk 8 or open jdk 8
2. create tomcat user account
sudo groupadd tomcat
3. run below command
sudo useradd -s /bin/false -g tomcat -d /opt/tomcat tomcat
4. move to tmp folder
5. run the below command to download tomcat tar file
wget ftp://apache.cs.utah.edu/apache.org/tomcat/tomcat-8/v8.5.68/bin/apache-tomcat-8.5.68.tar.gz
6. create folder on /opt/tomcat
cd /opt/
sudo mkdir /opt/tomcat
7. run below command - to extract tar file to /opt/tomcat
cd /tmp/
sudo tar xzvf apache-tomcat-8*tar.gz -C /opt/tomcat --strip-components=1
8.tomcat extract to below folder
9.give the tomcat user control of the entire directory and make all the scripts in the bin location executable
sudo chown -R tomcat: /opt/tomcat sudo sh -c 'chmod +x /opt/tomcat/bin/*.sh'
10.run below command
sudo vi /opt/tomcat/conf/tomcat-users.xml
add the below lines
11. add below line to
sudo vi /etc/systemd/system/tomcat.service
==============================
[Unit] Description=Tomcat servlet container After=network.target [Service] Type=forking User=tomcat Group=tomcat Environment="JAVA_HOME=/usr/lib/jvm/default-java" Environment="JAVA_OPTS=-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
12. After that, run the commands below to reload systemd profiles and enable tomcat service
sudo systemctl daemon-reload
--- not working below two line ----------
sudo systemctl start tomcat.service sudo systemctl enable tomcat.service
13. run the tomcat using the below commands
sudo -s
cd /opt/tomcat/bin/
./startup.sh
14. on the web browser run below command
http://localhost:8080
No comments:
Post a Comment