Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- NEXUS
- eclipse
- resin
- SSL
- yum
- Java
- 삽질
- linux
- 갈릴레오
- Babel
- svn
- Find
- tagx
- 이클립스
- tomcat
- 지름신
- netstate
- 보드
- 파워목업
- Galileo
- 3.5
- subversion
- egrep
- CentOS
- CentOS6
- 연동
- 권한변경
- Powermockup
- Apache
- trac
Archives
- Today
- Total
....
CentOS 7 - httpd, yona, mariadb, letsencrypt... 본문
yum 추가 설치
sudo yum update
sudo yum install -y lrzsz unzip net-tools
sudo yum install httpd
sudo yum install java-1.8.0-openjdk
SSHD 포트 추가
sudo vi /etc/ssh/sshd_config
> Port 22
> Port 2222
sudo yum install policycoreutils-python
sudo semanage port -a -t ssh_port_t -p tcp 2222
sudo firewall-cmd --permanent --zone=public --add-port=2222/tcp
sudo firewall-cmd --reload
sudo systemctl restart sshd
HTTPD 서비스 구동
sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --zone=public --list-all
sudo systemctl enable httpd
sudo systemctl start httpd
cd /etc/httpd/conf.d
sudo vi host.conf
#### 아래 내용들 추가
# Name base virtualhost
NameVirtualHost *:80
NameVirtualHost *:443
<VirtualHost *:80>
ServerName dev.datagate.co.kr
ServerAlias 1.215.196.43
ProxyPreserveHost On
ProxyPass /excluded !
ProxyPass /robots.txt !
ProxyPass /yona http://localhost:9000/yona
ProxyPassReverse /yona http://localhost:9000/yona
</VirtualHost>
sudo systemctl restart httpd
LetsEncrypt SSL 인증서 설치
[root@app ~]# su - root
[root@dev ~]# wget https://dl.eff.org/certbot-auto
[root@dev ~]# chmod a+x certbot-auto
[root@dev ~]# ./certbot-auto
# 자동발급이 안된 경우 manual로 실행해서 소유권 파일을 직접 추가해서 증명
[root@dev ~]# ./certbot-auto certonly --manual --email idkook@test.com -d dev.test.com
YONA 설치
MARIADB 설치
https://github.com/yona-projects/yona/blob/next/docs/ko/install-mariadb.md
mkdir /app /app/yona /app/yona/yona-data /app/yona/yona-logs
wget https://github.com/yona-projects/yona/releases/download/v1.14.0/yona-v1.14.0-bin.zip -o /usr/local/src
unzip /usr/local/src/yona-v1.14.0-bin.zip -d /app/yona
mv /app/yona/yona-v1.14.0 /app/yona/yona
cd /app/yona
system용 스크립트 4가지를 생성
## /app/yona/start.systemd.sh
#!/bin/bash
#
# User this restart shell just for example
#
PORT=9000
YONA_NAME="yona"
YONA_BASE=/app/yona
YONA_HOME=$YONA_BASE/yona
YONA_DATA=$YONA_BASE/yona-data
YONA_LOGS=$YONA_BASE/yona-logs
export YONA_BASE YONA_HOME YONA_DATA
$YONA_BASE/stop.systemd.sh
if [ -f "$YONA_HOME/RUNNING_PID" ];then
rm $YONA_HOME/RUNNING_PID
echo "**** Already exists RUNNING_PID then remove ****"
fi
# rm $YONA_HOME/RUNNING_PID > /dev/null
cd $YONA_HOME
JAVA_OPTS="-Xmx2048m -Xms1024m -Dyona.data=$YONA_DATA -DapplyEvolutions.default=true -Dhttp.port=$PORT"
nohup $YONA_HOME/bin/yona >$YONA_LOGS/yona.out 2>$YONA_LOGS/yona.err </dev/null
## /app/yona/status.systemd.sh
#!/bin/sh
ps aux | grep java | grep yona
ps -ef | grep java | grep "yona" | awk {'print "PROCESS ID : " $2'}
## /app/yona/stop.systemd.sh
#!/bin/sh
pid=`ps -ef | grep java | grep com.typesafe.play | awk '{print $2}'`
if [ $pid ] ; then
kill $pid
fi
## /etc/systemd/system/yona.service
[Unit]
Description=Yona service
After=multi-user.target
[Service]
Type=idle
ExecStart=/app/yona/start.systemd.sh
ExecStop=/app/yona/stop.systemd.sh
Restart=on-failure
User=app
Group=app
[Install]
WantedBy=multi-user.target
실행을 위한 계정으로 파일소유권 변경
chown app.app /app/yona -R
다음 명령으로 서비스 등록 및 자동 실행.
systemctl daemon-reload
systemctl enable yona.service
systemctl status yona
systemctl start yona
systemctl stop yona
Datasource 수정 및 초기 설정은 YONA document를 참조해서 진행
YONA 설치 : https://github.com/yona-projects/yona/blob/next/docs/ko/install-yona-server.md
Comments