DB 서버 준비
● 가상 머신 복제
● 가상 머신 IP 설정
● Mysql 5.7 버전 설치
yum install -y wget
wget https://cdn.mysql.com/archives/mysql-5.7/mysql-5.7.44-1.el7.x86_64.rpm-bundle.tar
tar xvf mysql-5.7.44-1.el7.x86_64.rpm-bundle.tar
yum install -y mysql-community-*
# MySQL 실행, 확인
systemctl restart mysqld
yum install -y net-tools
netstat -anlp | grep 3306
systemctl status mysqld
# MySQL 초기 설정
systemctl set-environment MYSQLD_OPTS="--skip-grant-tables"
systemctl restart mysqld
mysql
flush privileges;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'qwer1234';
# Mysql 원격 접속, 권한 설정
SELECT user, host FROM mysql.user;
create user 'root'@'%' identified by 'qwer1234';
exit
systemctl stop firewalld
setenforce 0
systemctl stop mysqld
systemctl unset-environment MYSQLD_OPTS
systemctl start mysqld
mysql -u root -p
CREATE DATABASE black;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
flush privileges;
● DB 복구(프리메이플 서버 SQL)
게임 서버 준비
# 게임 서버 설정
Black Server.7z 압축 해제
Black Server\Dist\1123.jar 파일 삭제
localhost 변수 -> localhoss로 변환해 1123.jar 생성
Black Server\Dist\ 에 옮기기
관리자 권한인 메모장으로 C:\Windows\System32\drivers\etc\hosts 열기
입력 후 저장: 192.168.73.124 localhoss # 가상머신 DB 서버
database.properties 파일 수정: user 및 패스워드 DB에 맞게 설정
# JAVA 설치
openjdk-11.0.2_windows-x64_bin.zip 다운 및 압축 해제
해제하면 있는 jdk-11.0.2 폴더 자체를 C:\에 옮기기
환경 변수 설정: 고급 시스템 설정->고급 탭->환경 변수->path 변수 클릭 후 편집 클릭->C:\jdk-11.0.2\bin 입력 후 확인, cmd-java 입력
# 게임 서버 실행: 게임 서버 압축 푼 곳에서 launch.bat 실행
게임 클라이언트 실행
Black Client.7z 압축 해제
Black Client.7z 해제한 폴더에 Localhost.7z(qwe123!) 해제했을 때 나오는 파일 3개 붙여넣기
방화벽(실시간 검사) 끄기
캐릭터 만들고 게임하기
3계층 아키텍처
● 3la_db(192.168.73.125)
○ IP, 포트포워딩 설정
○ MariaDB 설치, 유저생성, 테이블 생성, 권한 부여
# DB 서버 프로그램 설치
yum install -y mariadb-server
# DB 서버 프로그램 실행
systemctl start mariadb
# 방화벽 끄기
setenforce 0
systemctl stop firewalld
# 클라이언트 프로그램 mysql
# 사용자 생성
CREATE USER '[이니셜]'@'%' IDENTIFIED BY 'qwer1234';
# DB 생성
CREATE DATABASE [DB 이름];
# 사용자한테 DB 관리 권한 부여
GRANT ALL PRIVILEGES ON [DB 이름].* TO '[이니셜]'@'%';
# 클라이언트 프로그램 종료
exit
# MySQL 워크 벤치 연결
●3la_was(192.168.73.126)
○ IP 설정
○ 푸티 설정: ssh포트번호로 호스트와 통신
○ WAS 구성(php, wordpress)
# php 설치
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
dnf install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm
dnf module reset php
dnf install -y php php-mysqlnd php-fpm php-opcache php-curl php-json php-gd php-xml php-mbstring php-zip -y
# php 설정
vi /etc/php-fpm.d/www.conf
24번째줄 user = nginx
26번째줄 group = nginx
48번째줄 ;listen.owner = nginx
49번째줄 ;listen.group = nginx
systemctl restart php-fpm
# wordpress 설치
yum install -y wget
wget https://ko.wordpress.org/latest-ko_KR.tar.gz
tar zxvf latest-ko_KR.tar.gz
mv wordpress /var/www/html/
# nginx 서버 설정
vi /etc/nginx/conf.d/test.conf
server {
listen 80;
server_name test [웹 서버 IP주소];
root /var/www/html/wordpress;
index index.php index.html index.htm;
# set client body size to 100 MB #
client_max_body_size 100M;
location / {
try_files $uri $uri/ /index.php?$args;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php-fpm/www.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
# 폴더 권한 설정
chown -R nginx:nginx /var/www/html/wordpress
# nginx 서버 재실행
systemctl restart nginx
# 접속 확인
systemctl stop firewalld
setenforce 0
# 워드 프레스 설정
웹 페이지에서 각 값 입력 후 클릭