Memo to build a Servlet environment on AWS EC2

1. Java installation

Java 8 search

yum search java-1.8.0-openjdk-devel

Java 8 installation

sudo yum install java-1.8.0-openjdk-devel

2. Install Apache

Apache installation

sudo yum -y install httpd

Start apache

sudo service httpd start

Automatically start on reboot

sudo systemctl enable httpd.service

3. Creating inbound rules

  1. Security group
  2. Edit inbound rules
  3. Create " HTTP TCP 80 (port range) "
  4. Save the rule

4. Tomcat installation

Tomcat installation

sudo amazon-linux-extras install tomcat8.5

Tomcat-Installing Webapps

sudo yum install tomcat-webapps tomcat-admin-webapps

Start tomcat

sudo systemctl start tomcat


remove mariadb

sudo yum list installed | grep mariadb
sudo yum remove mariadb-libs

MySQL installation

sudo yum -y localinstall

MySQL server

sudo yum install mysql-community-server

Clear cache

sudo yum clean all
sudo rm -rf /var/cache/yum

Installation confirmation

yum repolist enabled | grep "mysql.*-community.*"

MySQL version confirmation

mysql --version

Start MySQL

sudo /bin/systemctl start mysqld.service

MySQL startup confirmation

systemctl list-units | grep mysqld.service

Check the current status (only when disabled is displayed)

systemctl is-enabled mysqld.service
systemctl enable mysqld.service

Confirm root password

sudo cat /var/log/mysqld.log | grep root

Change root initial password

SET GLOBAL validate_password_length=4;
SET GLOBAL validate_password_policy=LOW;
ALTER USER [email protected] IDENTIFIED BY 'root';

Change character code (How to use vi editor)

vi /etc/my.cnf

i :insert

「:w !sudo tee %」




MySQL restart

sudo systemctl restart mysqld

MySQL stop

sudo systemctl stop mysqld

Uninstall MySQL

sudo yum remove mysql*

6. Upload to server

Uploaded to Tomcat Web apps

sudo cp filename.war /usr/share/tomcat/webapps

File deletion in Tomcat Webapps

sudo rm /usr/share/tomcat/webapps/file name.war

Recommended Posts

Memo to build a Servlet environment on AWS EC2
Build a Laravel environment on an AWS instance
How to build a Pytorch environment on Ubuntu
Build a development environment on AWS EC2 with CentOS7 + Nginx + pm2 + Nuxt.js
Build a Ruby on Rails development environment on AWS Cloud9
Build a Minecraft server on AWS
Build a XAMPP environment on Ubuntu
A memo to build Jitsi Meet on Azure with docker-compose
Build a Maven repository on AWS S3
Build a Java development environment on Mac
Build Java 8 development environment on AWS Cloud9
[Note] Update to production environment (AWS EC2)
How to create a web server on an EC2 instance on AWS
Build an environment with Docker on AWS
Build a JMeter environment on your Mac
Steps to build a Ruby on Rails development environment with Vagrant
How to build a Ruby on Rails environment using Docker (for Docker beginners)
How to build a Ruby on Rails development environment with Docker (Rails 6.x)
How to build a Ruby on Rails development environment with Docker (Rails 5.x)
Try to build Java8 environment on Amazon Linux2
How to deploy a container on AWS Lambda
Environment construction command memo with Docker on AWS
Build a Java runtime environment on Sakura VPS
Build a development environment to create Ruby on Jets + React apps with Docker
Install docker-compose on a Graviton 2 instance of AWS EC2
How to install Ruby on an EC2 instance on AWS
[Note] Build a Python3 environment with Docker in EC2
Try to build a Java development environment using Docker
Install docker on AWS EC2
Ruby ① Build a Windows environment
How to create an application server on an EC2 instance on AWS
How to deploy a simple Java Servlet app on Heroku
How to get inside a container running on AWS Fargate
How to deploy a kotlin (java) app on AWS fargate
Build a CentOS 8 virtual environment on your Mac with VirtualBox
Build mate desktop environment on ec2 with terraform (Ubuntu 20.04LTS)
Build a Node-RED environment with Docker to move and understand
How to install GNOME as a desktop environment on CentOS 7
How to deploy a Rails application on AWS (article summary)
[Node.js] Docker-compose up makes it easy to build a development environment
Build a Node.js environment with Docker
A story of frustration trying to create a penetration environment on Ubuntu 20.04
Build a Tomcat 8.5 environment with Pleiades 4.8
To beginners launching Docker on AWS
I tried to create a Spring MVC development environment on Mac
Ruby on Rails 6.0 environment construction memo
Build a development environment where Ruby on Rails breakpoints work on Windows
How to publish an application using AWS (3) EC2 instance environment construction
[Introduction] Build a virtual environment of Vagrant + VirtualBox on Window10 [Environment construction]
Deploy SpringBoot application to AWS EC2
How to build vim on Ubuntu 20.04
Build Unity development environment on docker
I tried to build a laravel operating environment while remembering Docker
[Rails] AWS EC2 instance environment construction
Minimal steps to set up a Ruby environment with rbenv on Ubuntu 20.04
I tried to build a Firebase application development environment with Docker in 2020
A memo that enabled VS Code + JUnit 5 to be used on Windows 10
How to migrate a web application created in a local docker environment to AWS
Install PHP7.4 to build CentOS7 Laravel environment
A memorandum on how to use Eclipse
How to redo a deployment on Heroku