Skip to content

Commit

Permalink
Update tomcat_installation.MD
Browse files Browse the repository at this point in the history
  • Loading branch information
ValaxyTech authored Nov 23, 2018
1 parent adff0fa commit f655728
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Tomcat/tomcat_installation.MD
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
1. EC2 instance with Java v1.8.x

### Install Apache Tomcat
we are going to download tomcat packages from https://tomcat.apache.org/download-80.cgi onto /opt on EC2 instance
Download tomcat packages from https://tomcat.apache.org/download-80.cgi onto /opt on EC2 instance
```sh
# create tomcat directory
cd /opt
Expand All @@ -24,34 +24,34 @@ create link files for tomcat startup.sh and shutdown.sh
tomcatup
```
#### check point :
access tomcat application from browser on prot 8080
access tomcat application from browser on prot 8080
http://<Public_IP>:8080

Using unique ports for each application is a best practice in a environment. But tomcat and Jenkins runs on ports number 8080. Hence lets change tomcat cat port number to 8090. To change port number we should update server.xml file which is in conf directory under tomcat home
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
```sh
cd /opt/apache-tomcat-8.5.35/conf
# update port number in the "connecter port" field in server.xml
#restart tomcat after configuration update
# restart tomcat after configuration update
tomcatdown
tomcatup
```
#### check point :
access tomcat application from browser on prot 8090
access tomcat application from browser on prot 8090
http://<Public_IP>:8090

now application is accessible on port 8090. but if you try to login to tomcat from the browser it doesn’t allow. you need to change some default parameters in context.xml
now application is accessible on port 8090. but tomcat application doesnt allow to login from browser. changing a default parameter in context.xml does address this issue
```sh
#search for context.xml
find / -name context.xml
```
above command gives 3 context.xml files. Out of 3, 2 files resides on webapp directory. We should comment (<!-- & -->) `Value ClassName` field on files which are under webapp directory.
restart tomcat services to take this effect
above command gives 3 context.xml files. comment (<!-- & -->) `Value ClassName` field on files which are under webapp directory.
After that restart tomcat services to effect these changes
```sh
tomcatdown
tomcatup
```
Update users information in the tomcat-users.xml file
goto tomcat home directory and Add below users to tomcat-user.xml file under conf directory
goto tomcat home directory and Add below users to conf/tomcat-user.xml file
```sh
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
Expand All @@ -61,5 +61,5 @@ goto tomcat home directory and Add below users to tomcat-user.xml file under con
<user username="deployer" password="deployer" roles="manager-script"/>
<user username="tomcat" password="s3cret" roles="manager-gui"/>
```
Restart serivce and try to login to tomcat application from the browser
Restart serivce and try to login to tomcat application from the browser. This time it should be Successful

0 comments on commit f655728

Please sign in to comment.