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) 0.0.0.0/0 "
  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

5.MySQL

remove mariadb

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

MySQL installation

sudo yum -y localinstall http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm

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

「Esc」
「:wq」
or
「Esc」
「:w !sudo tee %」
「:q!」

my.cnf


[mysqld]
character-set-server=utf8

[client]
default-character-set=utf8

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
Build a Ruby on Rails development environment on AWS Cloud9
Build a Minecraft server on AWS
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
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
Try to build Java8 environment on Amazon Linux2
Build a Java runtime environment on Sakura VPS
Build a development environment to create Ruby on Jets + React apps with Docker
[Note] Build a Python3 environment with Docker in EC2
Try to build a Java development environment using Docker
Ruby ① Build a Windows environment
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 a Tomcat 8.5 environment with Pleiades 4.8
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
Build Unity development environment on docker
[Rails] AWS EC2 instance environment construction
Minimal steps to set up a Ruby environment with rbenv on Ubuntu 20.04
A memo that enabled VS Code + JUnit 5 to be used on Windows 10
A memorandum on how to use Eclipse
Build Maven repository on AWS S3 service
Spring Boot environment construction memo on mac
Java development environment construction memo on Mac
Build a WAS execution environment from Docker
[Ruby] Building a Ruby development environment on Ubuntu
Creating a Servlet in the Liberty environment
Build Redmine code reading environment on Docker
[Introduction to JSP + Servlet] A little animation ♬
I tried to build AdoptOpenjdk 11 on CentOS 7
How to build Rails 6 environment with Docker
[First environment construction] I tried to create a Rails 6 + MySQL 8.0 + Docker environment on Windows 10.
I built a Java EE environment on AWS and tried running a web application
Build a test flow on CircleCI using Jib
Write a dockerfile to start jupyter-lab on ubuntu
Build a WordPress development environment quickly with Docker
[AWS SQS] Build SQS and poll messages from EC2
Error installing ruby execution environment on EC2 instance
[Java] Build Java development environment on Ubuntu & check execution
How to save images on Heroku to S3 on AWS
Build Apache / Tomcat development environment on Cent OS 7
[Personal memo] Ruby on Rails environment construction (Windows)
[Win10] Build a JSF development environment with NetBeans
Recipe for deploying Rails apps on AWS EC2
Build a development environment for Docker, java, vscode
[Rails] How to build an environment with Docker
[Java] Memo on how to write the source
Build a Java development environment with VS Code
From building an AWS cloud environment to deploying a Spring Boot app (for beginners)