Installing and configuring tomcat on Centos 7

Reading Time: < 1 minute

wget http://www.us.apache.org/dist/tomcat/tomcat-7/v7.0.57/bin/apache-tomcat-7.0.57.tar.gz

tar -xvvf apache-tomcat-7.0.57.tar.gz

mv apache-tomcat-7.0.57 /opt/tomcat

nano /opt/tomcat/conf/tomcat-users.xml

find the <tomcat-users> </tomcat-users> lines and in between add the below entry

 <role rolename="manager-gui"/>
 <role rolename="manager-script"/>
 <role rolename="manager-jmx"/>
 <role rolename="manager-status"/>
 <role rolename="admin-gui"/>
 <role rolename="admin-script"/>
 <user username="admin" password="admin" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-gui,admin-script"/>

and save the file and then issue command

chmod 755 /opt/tomcat
sh /opt/tomcat/bin/startup.sh