|
| 1 | + |
| 2 | +1: Install TOMCAT on linux box |
| 3 | + |
| 4 | +Step #1: Install Tomcat |
| 5 | + |
| 6 | +1.1 Create a Linux machine // Ubuntu 20.X |
| 7 | +Prereq: Install JAVA |
| 8 | + |
| 9 | +1.2: down load the package --> google doneload Apache Tomcat --> Version 8 |
| 10 | +Copy the link address |
| 11 | + |
| 12 | +cd /opt |
| 13 | +wget https://dlcdn.apache.org/tomcat/tomcat-8/v8.5.81/bin/apache-tomcat-8.5.81.tar.gz |
| 14 | +tar xzvf apache-tomcat-8.5.81.tar.gz |
| 15 | +mv apache-tomcat-8.5.81 tomcat |
| 16 | + |
| 17 | +cd tomcat |
| 18 | +cd bin/ |
| 19 | +./startup.sh ---> Tomcat started. |
| 20 | + |
| 21 | +Enabling remote access |
| 22 | +------------------- |
| 23 | +cd /opt/tomcat |
| 24 | +find / -name context.xml |
| 25 | + |
| 26 | +/opt/tomcat/webapps/manager/META-INF/context.xml |
| 27 | +/opt/tomcat/webapps/host-manager/META-INF/context.xml |
| 28 | + |
| 29 | +Backup of the Orignal files: |
| 30 | +cp -p /opt/tomcat/webapps/manager/META-INF/context.xml /opt/tomcat/webapps/manager/META-INF/context.xml_ORIG |
| 31 | + |
| 32 | +cp -p /opt/tomcat/webapps/host-manager/META-INF/context.xml /opt/tomcat/webapps/host-manager/META-INF/context.xml_ORIG |
| 33 | + |
| 34 | + |
| 35 | +vi /opt/tomcat/webapps/manager/META-INF/context.xml |
| 36 | +vi /opt/tomcat/webapps/host-manager/META-INF/context.xml |
| 37 | + |
| 38 | +Comment the below line over both the files: |
| 39 | +-------------- |
| 40 | + |
| 41 | +<!-- <Valve className="org.apache.catalina.valves.RemoteAddrValve" |
| 42 | + allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" /> --> |
| 43 | + |
| 44 | +Restarted Tomcat: |
| 45 | +-------------- |
| 46 | + |
| 47 | +cd /opt/tomcat/bin |
| 48 | +./shutdown.sh |
| 49 | +./startup.sh |
| 50 | + |
| 51 | +Create users: |
| 52 | +vi /opt/tomcat/conf/tomcat-users.xml |
| 53 | + |
| 54 | +Addd these Roles and users at the end of the file: |
| 55 | +---------- |
| 56 | +<role rolename="manager-gui" /> |
| 57 | +<role rolename="manager-script" /> |
| 58 | +<role rolename="manager-jmx" /> |
| 59 | +<role rolename="manager-status" /> |
| 60 | +<user username="admin" password="admin" roles="manager-gui, manager-script, manager-jmx, manager-status" /> |
| 61 | +<user username="deployer" password="deployer" roles="manager-script" /> |
| 62 | +<user username="tomcat" password="s3cert" roles="manager-gui" /> |
| 63 | + |
| 64 | +Restarted Tomcat: |
| 65 | +-------------- |
| 66 | +cd /opt/tomcat/bin |
| 67 | +./shutdown.sh |
| 68 | +./startup.sh |
0 commit comments