'How to install Tomcat in Amazon Web Services EC2
I have created an instance in Amazon web services, and I have connected to the server using putty through ssh.
But I do not know how to install tomcat 8 in amazon ec2. Please help me with this.
Solution 1:[1]
On Amazon Linux 2 AMI:
List extra packages (you will see tomcat8 versions):
$ amazon-linux-extras listInstall extra packages:
$ sudo amazon-linux-extras install tomcat8.5Start tomcat service:
$ sudo systemctl start tomcatCreate index file:
$ cd /usr/share/tomcat/webapps
$ sudo mkdir ROOT
$ cd ROOT/
$ sudo vi index.html #add some HTML content
Next you could view your site at localhost:8080
Solution 2:[2]
For Amazon AMI 2, Tomcat is available in Amazon Linux Extra topic "tomcat8.5"
To use, run
# sudo amazon-linux-extras install tomcat8.5
Learn more at https://aws.amazon.com/amazon-linux-2/faqs/#Amazon_Linux_Extras
Solution 3:[3]
If you also want to know the help documentation, the command is: sudo yum install tomcat8-webapps tomcat8-docs-webapp tomcat8-admin-webapps
Solution 4:[4]
The below Link works well for EC2 / Linux or Mac
sudo yum install tomcat8-webapps tomcat8-docs-webapp tomcat8-admin-webapps
This will install:
- WebApps Folder
- Tomcat documentation (Gives local documentation for qucik reference)
- Admin App : through which you can install / export / start /stop / reload an application (without having to login)
Note: When a Manager App is installed - be sure to change the default roles and permissions etc and Password too. Otherwise you are very vulnerable. Its best to disable the admin module for better security.
Solution 5:[5]
STEPS:
- first check whether java has to be installed on your instance or not.
- if not, install java:
yum install java -y - go to the tomcat-Apache.org site, and copy the link to the tar.gz file
- open the terminal and execute this command:
sudo wget <tar.gz path> - unzip the tar file:
tar -vxzf Apache-tomcat-xxxx.tar.gz - setup users and port number (by default 8080)
- then shutdown and start the tomcat server:
./shutdown.shand./startup.sh
Solution 6:[6]
For this:
- you need to do copy the tomcat tar file path
wget <tar file path> - unzip the tar file
tar -zvxf apache-tomcat-xxxx.tar.zf - you need to set the users and port number and then stop and restart the tomcat server
Solution 7:[7]
below mentioned follow the step but http://locathost:8080/manager/html is Not open on amazon Linux error is showing in the as below menitoned
(HTTP Status 404 – Not Found Type Status Report
Message The requested resource [/manager/html] is not available
Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
Apache Tomcat/9.0.41)
amazon-linux-extras
amazon-linux-extras install tomcat9
yum update
systemctl start tomcat
systemctl status tomcat
netstat -tunple
cd /usr/share/tomcat/webapps
mkdir ROOT
cd ROOT/
vi index.html
Solution 8:[8]
sudo su
amazon-linux-extras install tomcat9
systemctl start tomcat
systemctl status tomcat
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | |
| Solution 2 | Eric Aya |
| Solution 3 | Yaling Zheng |
| Solution 4 | FluffyKitten |
| Solution 5 | trincot |
| Solution 6 | Matt |
| Solution 7 | |
| Solution 8 | Eswar Kadha |
