Skip to content

Commit 6cfe0d5

Browse files
committed
updated tomcat file:
1 parent 0b98754 commit 6cfe0d5

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

Tomcat/tomcat_installation.MD

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
11
# Tomcat installation on EC2 instance
2-
2+
Follow this video lecture in Valaxy Technologies **[YouTube Channel](https://youtu.be/68WNroQBUts)**
3+
Complete DevOps Project course on [Udemy](https://www.udemy.com/course/valaxy-devops/?referralCode=8147A5CF4C8C7D9E253F)
34
### Pre-requisites
45
1. EC2 instance with Java v1.8.x
5-
66
### Install Apache Tomcat
77
1. Download tomcat packages from https://tomcat.apache.org/download-80.cgi onto /opt on EC2 instance
8+
> Note: Make sure you change `<version>` with the tomcat version which you download.
89
```sh
910
# Create tomcat directory
1011
cd /opt
1112
wget http://mirrors.fibergrid.in/apache/tomcat/tomcat-8/v8.5.35/bin/apache-tomcat-8.5.35.tar.gz
12-
tar -xvzf /opt/apache-tomcat-8.5.35.tar.gz
13+
tar -xvzf /opt/apache-tomcat-<version>.tar.gz
1314
```
1415
1. give executing permissions to startup.sh and shutdown.sh which are under bin.
1516
```sh
16-
chmod +x /opt/apache-tomcat-8.5.35/bin/startup.sh
17-
shutdown.sh
17+
chmod +x /opt/apache-tomcat-<version>/bin/startup.sh
18+
chmod +x /opt/apache-tomcat-<version>/bin/shutdown.sh
1819
```
19-
20+
> Note: you may get below error while starting tomcat incase if you dont install Java
21+
`Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At least one of these environment variable is needed to run this program`
2022
1. create link files for tomcat startup.sh and shutdown.sh
2123
```sh
22-
ln -s /opt/apache-tomcat-8.5.35/bin/startup.sh /usr/local/bin/tomcatup
23-
ln -s /opt/apache-tomcat-8.5.35/bin/shutdown.sh /usr/local/bin/tomcatdown
24+
ln -s /opt/apache-tomcat-<version>/bin/startup.sh /usr/local/bin/tomcatup
25+
ln -s /opt/apache-tomcat-<version>/bin/shutdown.sh /usr/local/bin/tomcatdown
2426
tomcatup
2527
```
2628
#### Check point :
@@ -29,7 +31,7 @@ access tomcat application from browser on port 8080
2931

3032
Using unique ports for each application is a best practice in an environment. But tomcat and Jenkins runs on ports number 8080. Hence lets change tomcat port number to 8090. Change port number in conf/server.xml file under tomcat home
3133
```sh
32-
cd /opt/apache-tomcat-8.5.35/conf
34+
cd /opt/apache-tomcat-<version>/conf
3335
# update port number in the "connecter port" field in server.xml
3436
# restart tomcat after configuration update
3537
tomcatdown
@@ -45,13 +47,18 @@ Access tomcat application from browser on port 8090
4547
find / -name context.xml
4648
```
4749
1. above command gives 3 context.xml files. comment (<!-- & -->) `Value ClassName` field on files which are under webapp directory.
48-
After that restart tomcat services to effect these changes
50+
After that restart tomcat services to effect these changes.
51+
At the time of writing this lecture below 2 files are updated.
4952
```sh
50-
tomcatdown
53+
/opt/tomcat/webapps/host-manager/META-INF/context.xml
54+
/opt/tomcat/webapps/manager/META-INF/context.xml
55+
56+
# Restart tomcat services
57+
tomcatdown
5158
tomcatup
5259
```
5360
1. Update users information in the tomcat-users.xml file
54-
goto tomcat home directory and Add below users to conf/tomcat-user.xml file
61+
goto tomcat home directory and Add below users to conf/tomcat-users.xml file
5562
```sh
5663
<role rolename="manager-gui"/>
5764
<role rolename="manager-script"/>

0 commit comments

Comments
 (0)