티스토리 뷰

카테고리 없음

AWS

DEV LION 2024. 8. 23. 16:23

 

EC2 생성

AWS EC2 접속

> sudo ssh -i jenkins.pem ec2-user@13.60.206.142

 

NGINX 설치

amazon-linux-extras list | grep nginx
sudo amazon-linux-extras install nginx
sudo amazon-linux-extras install nginx1
sudo systemctl start nginx
sudo systemctl status nginx
which nginx
cd /usr/sbin/nginx
where is nginx
whereis nginx
/usr/share/nginx

 

 

ssh-keygen 생성방법 (.pem 없이 접속 방법)

> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/Devkhlim/.ssh/id_rsa): 
Created directory '/Users/Dev/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /Users/Dev/.ssh/id_rsa
Your public key has been saved in /Users/Dev/.ssh/id_rsa.pub

 

/Users/Dev/.ssh/id_rsa.pub 의 내용을 원격 서버에 추가

 

JAVA 설치

yum list | grep jdk -- jdk리스트 확인
sudo yum install java-1.8.0-openjdk – java 오픈 소스 설치
java -version -- java 버젼 확인

 

TOMCAT 설치

sudo yum install wget -- wget 패키지 설치
sudo mkdir /opt/tomcat -- 톰켓을 설치할 폴더 생성

-- 다운로드
sudo wget https://mirror.navercorp.com/apache/tomcat/tomcat-9/v9.0.93/bin/apache-tomcat-9.0.93.tar.gz
sudo tar xvf apache-tomcat-9.0.93.tar.gz -C ./ --strip-components=1
sudo useradd -M tomcat
sudo chgrp -R tomcat /opt/tomcat


sudo chown -R tomcat webapps/ work/ temp/ logs/
sudo chmod g+x conf
sudo chmod 777 webapps

 

TOMCAT 서비스 등록

> sudo vi /etc/systemd/system/tomcat.service

# Systemd unit file for tomcat
[Unit]
Description=Apache Tomcat Web Application Container
After=syslog.target network.target
[Service]
Type=forking
Environment=JAVA_HOME=/usr/lib/jvm/jre
Environment=CATALINA_PID=/opt/tomcat/temp/tomcat.pid
Environment=CATALINA_HOME=/opt/tomcat
Environment=CATALINA_BASE=/opt/tomcat
Environment='CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC'
Environment='JAVA_OPTS=-Djava.awt.headless=true -
Djava.security.egd=file:/dev/./urandom'
ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/bin/kill -15 $MAINPID\
User=tomcat
Group=tomcat
UMask=0007
RestartSec=10
Restart=always

[Install]
WantedBy=multi-user.target

 

sudo vi /etc/systemd/system/tomcat.service
sudo systemctl enable tomcat
sudo systemctl status tomcat

반응형
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/12   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
글 보관함