CI CD

yona 설치 방법(ubuntu 20.4)

주술쟁이 2022. 1. 28. 11:36

yona 설치
1. opanjava8, mariadb 10.3, unzip, nginx 을 설치한다.
apt-get update
apt install openjdk-8-jdk mariadb-server mariadb-client unzip

2.mysql_secure_installation 실행하여 초기화
sudo mysql_secure_installation
첫 질문은 기존 DB root 패스워드를 묻는다. 초기 설치이기 때문에 enter로 패스
Set root password? Y (root 비밀번호 설정)
Remove anonymous users? Y (익명 계정 삭제)
Disallow root login remotely? Y/N (외부에서 root 계정 접속 허용 여부. Y - 거부, N- 허용)
Remove test database and access to it? Y (test db 삭제)
Reload privilege tables now? Y(위 사항 즉시 반영)

3. yona용 계정 생성 및 database 생성. 한글 지원을 위해 utf8로 생성.
MYSQL > create user 'yona'@'localhost' identified by 'yonaya!';
MYSQL > create database yona
DEFAULT CHARACTER SET utf8mb4
DEFAULT COLLATE utf8mb4_bin;
MYSQL > grant all on yona.* to 'yona'@'localhost';

4. yona설치
yona-v1.15.1-bin.zip 을 복사 후 unzip으로 압축 해제. 폴더명 변경.
unzip yona-v1.15.1-bin.zip
rm yona-v1.15.1-bin.zip
mv yona-1.15.0/ yona
압축이 풀린 곳으로 이동해서 bin/yona 을 실행
cd yona
bin/yona
실행 후 실패하면 conf 디렉터리가 생성.
application.conf 에서 db 비밀번호 변경
db.default.driver=org.mariadb.jdbc.Driver
db.default.url="jdbc:mariadb://127.0.0.1:3306/yona?useServerPrepStmts=true"
db.default.user=yona
db.default.password="yonaya!"

5. yona 실행
cd yona
bin/yona &

6. nginx 프록시 설정. (사전에 인증서 복사)
/etc/nginx/sites-available/default 파일 수정하여 프록시 설정

server {
        #listen 80 default_server;
        #listen [::]:80 default_server;

        # SSL configuration
        #
        listen 443 ssl default_server;
        listen [::]:443 ssl default_server;
        #
        # Note: You should disable gzip for SSL traffic.
        # See: https://bugs.debian.org/773332
        #
        # Read up on ssl_ciphers to ensure a secure configuration.
        # See: https://bugs.debian.org/765782
        #
        # Self signed certs generated by the ssl-cert package
        # Don't use them in a production server!
        #
        # include snippets/snakeoil.conf;
        server_name yona.com;

        # allow large uploads of files
        client_max_body_size 1G;

        #ssl on;
        ssl_certificate /etc/nginx/ssl/2021/nginx_ssl.crt;
        ssl_certificate_key /etc/nginx/ssl/2021/STAR_ncjapan_co_jp.key;

        root /var/www/html;

        # Add index.php to the list if you are using PHP
        index index.html index.htm index.nginx-debian.html;

        #server_name _;

        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                #try_files $uri $uri/ =404;
                # Use IPv4 upstream address instead of DNS name to avoid attempts by nginx to use IPv6 DNS lookup
                proxy_set_header   X-Forwarded-For $remote_addr;
                proxy_set_header   Host $http_host;
                proxy_pass http://localhost:9000/;
        }

        # pass PHP scripts to FastCGI server
        #
        #location ~ \.php$ {
        #       include snippets/fastcgi-php.conf;
        #
        #       # With php-fpm (or other unix sockets):
        #       fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
        #       # With php-cgi (or other tcp sockets):
        #       fastcgi_pass 127.0.0.1:9000;
        #}

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #       deny all;
        #}
}

최초 기동시 admin 관리자 등록을 한다.

그 후 한번 서버를 재기동해야 함. 별도의 재기동 명령어가 없는 관계로 kill 시키고 다시 기동 필요.

'CI CD' 카테고리의 다른 글

docker로 MS-SQL 2019 설치  (0) 2021.05.06
docker jenkins container 만들기와 복제하기  (0) 2021.04.30