YUM 사용 : Amazon Linux, RedHat, CentOS
APT-GET 사용 : Ubuntu, Debian
1. mysql 설치
우분투 업데이트
sudo apt-get update
mysql server 설치
sudo apt-get install mysql-server
,Y
외부 접근 허용
sudo ufw allow mysql
mysql 실행
sudo systemctl start mysql
mysql 접속
sudo /usr/bin/mysql -u root -p
패스워드는 그냥 엔터
데이터베이스 생성
CREATE DATABASE GUIVING;
계정생성
create user 'jh'@'%' identified by 'password1234!!';
FLUSH PRIVILEGES;
계정에 권한 부여 (*.* 데이터베이스명.테이블명, *는 걍 다 줌)
grant all privileges on GUIVING.* to 'jh'@'%';
FLUSH PRIVILEGES;
외부 접근 셋팅
리눅스 Mysql 외부접속 셋팅
1. user table 변경 mysql> grant all privileges on *.* 'root'@'%' identified by '패스워드'; mysql> flush privileges; 2. bind-address 주석 vi /etc/mysql/my.cnf 또는 해당 파일 내부 참조파일 3. mysql restart service mysql restart 4. 3306
npre.tistory.com
2. tomcat 설치 (java 설치)
자바 설치 확인
java --version
APT-GET update
sudo apt-get update
JRE install (필요한 버젼으로)
sudo apt install openjdk-11-jre-headless
JRE 여러개 설치 되었을 때 버젼 변경하는법 참조
https://freedeveloper.tistory.com/347
톰캣 설치 위치 만들기
sudo mkdir /home/tomcat
톰캣다운로드
https://tomcat.apache.org/download-90.cgi
Apache Tomcat® - Apache Tomcat 9 Software Downloads
Welcome to the Apache Tomcat® 9.x software download page. This page provides download links for obtaining the latest version of Tomcat 9.0.x software, as well as links to the archives of older releases. Unsure which version you need? Specification version
tomcat.apache.org
에서 다운로드 링크 복사
sudo tar xvfz apache-tomcat-9~~~
환경변수 설정
sudo chmod -R 777 /etc/profile
sudo vi /etc/profile
##추가
export CATALINA_HOME=/home/tomcat
source /etc/profile
권한설정해두기
sudo chmod -R 777 home/tomcat/
실행
sudo ./startup.sh
## 참고사항
EC2하나에 mysql과 tomcat을 동시에 셋팅하면 서버가 뻗어버리는 현상 발생, 프리티어 EC2두개로 생성하여 하나씩 셋팅하는것을 권장
'Programing' 카테고리의 다른 글
node js 죽지않게 돌리는법 (0) | 2023.07.13 |
---|---|
[SWIFT] SceneDelegate 없이 AppDelegate로 프로젝트 구현 (0) | 2023.07.10 |
[iOS] 상단 Safety Area 영역 (2) | 2022.02.18 |
[iOS] WKWebview User Agent 설정 (0) | 2022.02.18 |
[iOS] klip sdk 적용이슈 (0) | 2022.02.09 |