본문 바로가기

[Recoeve.net]

Recoeve setting

반응형
# Recoeve setting ```[.lang-sh] ssh -i "C:\RecoeveNet\.ssh\Recoeve.net-medium-SSH.pem" ubuntu@ec2-43-202-241-148.ap-northeast-2.compute.amazonaws.com sudo netstat -tulnp | grep 8080 sudo kill -9 [id] tail -f -n 100 logs.txt # 실시간으로 마지막 100줄 보기. ./run_gradlew.sh & # 'recoeve'이라는 이름의 새 세션 시작 tmux new -s recoeve ./run_gradlew.sh & tail -f -n 100 logs/run_gradlew_....log ```/ ## PH
  • 2024-08-14 : Ubuntu server settings 추가.
## TOC ## 죽는 이유 분석 로그 확인: 인스턴스가 예기치 않게 멈춘 이유를 파악하려면 시스템 로그와 CloudTrail을 확인하세요: ```[.lang-bash] sudo journalctl -b -1 # 이전 부팅 로그 확인 ```/ CloudTrail에서 RebootInstances 이벤트를 검색해 누가/무엇이 재부팅을 유발했는지 확인. ## 주의사항 ### 서버 실행 ```[.lang-sh] ./run_gradlew.sh # at Ubuntu run_gradlew.bat # at Windows ```/ ### 따로 추가해야 할 파일들 (Secrets) ```[.lang-sh] gitconfig.bat gitconfig.sh src/main/java/recoeve/db/Config.java ```/ RecoeveNet repo 도 비밀유지를 위해서는 .gitignore 해야겠지만 귀찮으니 private repo 로 그냥 파일 공유합시다. ### Windows 내부 Ubuntu (WSL: Windows Subsystem for Linux) 에서는 편집을 지양합시다. 편집은 Windows 에서 대부분 하고 git push 하는걸로... WSL 에서는 실행 테스트 용으로만 이용합시다. ## Ubuntu Server 에 setting 하기. Azure (Microsoft) portal.azure.com/#@Recoevenet.onmicrosoft.com 에서 Sidebar 에 있는 Connect 클릭. ### Remote Server (Virtual Server) 접속하기. #### CLI (Command Line Interface) Ubuntu WSL (Windows Subsystem for Linux) 을 켜고 ```[.lang-sh] ssh -i ~/RecoeveNet/.ssh/github-recoeve-rsa kipid@4.218.23.15 // Are you sure you want to continue connecting (yes/no/[fingerprint])? yes sudo -i // root 계정으로 전환. ```/ #### SFTP 설정 ```[.lang-sh] sshfs -i ~/.ssh/Recoeve.net-VM_key.pem kipid@4.218.23.15:/home/kipid/ ~/remote_storage/ ```/ #### RDP (Remote Desktop Protocol) from Windows 11
Win+Rrdpclip.exe 실행해야 복붙이 됨.
Remote desktop from windows to linux with xRDP / fix black screen: Remote desktop from windows to linux with xRDP / fix black screen, by UFO ACADEMY, at 2023 여기 Griffon's IT Library :: xRDP – xRDP shows only black screen after authentication windows – How To Fix !, 2021-04-12 가 제대로 설명 해놓은듯. ```[.lang-sh] sudo apt install xrdp -y sudo systemctl enable xrdp sudo systemctl restart xrdp sudo systemctl status xrdp su - kipid-rdp sudo adduser xrdp ssl-cert sudo ufw enable sudo ufw allow 3389/tcp sudo ufw reload sudo ufw status sudo ip -br a curl ifconfig.me // This command will display the public IP address of your server. sudo vim /etc/xrdp/startwm.sh unset DBUS_SESSION_BUS_ADDRESS unset XDG_RUNTIME_DIR sudo systemctl restart xrdp ```/ #### Graphic card settings ```[.lang-sh] sudo lshw -c video *-graphics product: hyperv_drmdrmfb physical id: 1 logical name: /dev/fb0 capabilities: fb configuration: depth=32 resolution=1024,768 ```/ ### gitconfig.sh 만들기. ```[.lang-sh] curl -sS https://webi.sh/gh | sh // 이건 동작 안하는듯. ```/ ```[.lang-sh] cd ~/.config/ sudo touch gitconfig.sh sudo chmod u+rw gitconfig.sh // 소유자에게 읽기, 쓰기, 실행 권한을 부여하고 그룹과 다른 사용자에게 읽기 권한만 부여하려면: chmod 744 gitconfig.sh sudo vim gitconfig.sh ```/ 아래와 같은 명령어들을 넣어놓고 저장 (:wq) ```[.lang-sh] sudo git config alias.history "log --pretty=oneline" --global sudo git config user.name "kipid" --global sudo git config user.email "kipacti@gmail.com" --global sudo git config init.defaultBranch main --global ```/ ### git clone ```[.lang-sh] sudo git clone https://github.com/kipid/Recoeve.git Username for 'https://github.com': kipid Password for 'https://kipid@github.com': // 발급 받은 password 를 쳐야 함. 계정 pwd 가 아니라. sudo git clone https://github.com/kipid/PortableGit.git sudo git clone https://github.com/kipid/Recoeve.git sudo git clone https://github.com/kipid/RecoeveNet.git // 위처럼 해야 매번 로그인하라고 안물어봄. // sudo git clone https://[password-token]@github.com/[username]/[repo].git ```/ #### sudo git push/pull 매번 로그인하지 않게 만들어주기. Using ssh. ```[.lang-sh] ssh-keygen -t rsa -b 4096 -C "kipacti@gmail.com" // Follow the prompts to save the key in the default location (~/RecoeveNet/.ssh/github-recoeve-rsa). eval "$(ssh-agent -s)" ssh-add ~/RecoeveNet/.ssh/github-recoeve-rsa cat ~/RecoeveNet/.ssh/github-recoeve-rsa.pub cd ~/Recoeve/ sudo git remote set-url origin git@github.com:kipid/Recoeve.git cd ~/RecoeveNet/ sudo git remote set-url origin git@github.com:kipid/RecoeveNet.git cd ~/Recoeve/ sudo git config --global credential.helper cache ```/ ### Installing JAVA ```[.lang-sh] wget https://download.oracle.com/java/22/latest/jdk-22_linux-x64_bin.tar.gz tar -xvzf jdk-22_linux-x64_bin.tar.gz sudo mv jdk-22.0.2/ /usr/lib/jvm/jdk-22 sudo vim ~/.bashrc // export JAVA_HOME=/usr/lib/jvm/jdk-22 // export PATH=$JAVA_HOME/bin:$PATH source ~/.bashrc ```/ ## AWS 및 깔아야할 Softwares. AWS 같은 cloud server 에다가 인스턴스를 만들어서 windows server 를 돌리자. 원격 접속한 다음 chrome browser https://www.google.com/intl/ko/chrome/ 를 우선 깔고, Github 깔고 https://desktop.github.com/ Recoeve 및 여러 Repository 를 적절한 폴더/디렉토리에 clone/add 하고. SourceTree https://www.sourcetreeapp.com/ 도 깔고... MySQL 깔고 https://kipid.tistory.com/entry/Studying-SQL-Structured-Query-Language (Connector-J 를 깔아야 하는데, 버전이 다른가? MysqlConnectionPoolDataSource 가 없는 class 라는듯.) 수동설치 말고 자동설치로 까는게 맘편하긴 한듯. 더 쉽고. JAVA 깔고 https://kipid.tistory.com/entry/Installing-and-Learning-JAVA, Compiling and Running setting 도 해주고 https://kipid.tistory.com/entry/Compiling-and-Running-JAVA-Build-System-through-batch-bat-and-shell-script-sh. Sublimetext 깔고 https://kipid.tistory.com/entry/Introducing-Sublime-Text-editor. 설정도 충분히 바꿔주고. 중고 컴퓨터에서는 Help - Remove License 해주고. 다시 새 컴퓨터에 License 등록. 이메일에 온거 활용. Sublime license 로 검색. (Sublime-text 를 GitHub 에 올리는게 나을듯.) 특히나 sublime-snippet. ```[.linenums.lang-html] <!-- aWithBlank.sublime-snippet --> <snippet> <content><![CDATA[ <a target="${1:_blank}" href="${2}">${3}</a>${4} ]]></content> <tabTrigger>ab</tabTrigger> <scope>text.html</scope> <description>a tag with target _blank</description> </snippet> <!-- eq.sublime-snippet --> <snippet> <content><![CDATA[ <eq>${1}</eq>${2} ]]></content> <tabTrigger>eq</tabTrigger> <scope>text.html</scope> <description>eq tag (inline equation)</description> </snippet> <!-- eqq.sublime-snippet --> <snippet> <content><![CDATA[ <eqq> ${1} </eqq>${2} ]]></content> <tabTrigger>eqq</tabTrigger> <scope>text.html</scope> <description>eqq tag (outline equation)</description> </snippet> <!-- img.sublime-snippet --> <snippet> <content><![CDATA[ <img delayed-src="${1}"/>${2} ]]></content> <tabTrigger>img</tabTrigger> <scope>text.html</scope> <description>img tag with delayed-src</description> </snippet> <!-- iframe.sublime-snippet --> <snippet> <content><![CDATA[ <iframe delayed-src="${1}"></iframe>${2} ]]></content> <tabTrigger>iframe</tabTrigger> <scope>text.html</scope> <description>iframe tag with delayed-src</description> </snippet> ```/ Vert.X 도 깔고 https://kipid.tistory.com/entry/Learning-Vertx 꿀캠도 깔아야 하고... https://kr.bandisoft.com/honeycam/. 팟플레이어 https://tv.kakao.com/guide/potplayer. 디스코드 (Discord) https://discord.com/, 줌 (Zoom) https://zoom.us/ 깔고. 카카오톡 https://www.kakaocorp.com/page/service/service/KakaoTalk 깔고. 피그마 (Figma.com) https://www.figma.com/ 깔고. Console Emulator (x64) https://conemu.github.io/ 깔고. (C:\Recoeve\cmder\vendor\conemu-maximus5\ConEmu64.exe) AWS 원격 데스크탑 깔고 (Downloads 폴더에 있음.). Node.js 랑 Python 도 깔자. ## Windows 시스템 환경 변수 ```[.linenums] JAVA_HOME=C:\Program Files\Java\jdk-20 MYSQL_HOME=C:\Program Files\MySQL\MySQL Server 8.0 VERTX_HOME=C:\vertx RECOEVE_CLASS=C:\Recoeve CLASSPATH=.;%JAVA_HOME%\lib;%RECOEVE_CLASS%\classes;%RECOEVE_CLASS%\classes\javax.mail.jar;%RECOEVE_CLASS%\classes\mysql-connector-j-8.0.33.jar;%RECOEVE_CLASS%\classes\activation-1.1.1.jar;%VERTX_HOME%\conf;%VERTX_HOME%\lib\* ```/ ## MySQL 설정 참조: Recoeve Database setup (0.1 version) 그냥 mysqld --console 하면 에러가 뜨기 때문에 ```[.lang-sql] mysqld --initialize --user=mysql --console // 중간에 temp pwd 있으니 잘 봐두고 접속 mysql -u root -p CREATE USER 'eve'@'localhost' IDENTIFIED BY '{--pwd--}'; ALTER USER 'eve'@'localhost' IDENTIFIED BY '{--pwd--}'; GRANT ALL PRIVILEGES ON `recoeve01`.* TO 'eve'@'localhost'; // 이걸로 하면 안되는듯? GRANT ALL ON `Recoeve01`.* TO 'eve'@'localhost'; FLUSH PRIVILEGES; mysql_config_editor set --login-path=backup --host=localhost --user=root --password mysql_config_editor print --all mysqldump --extended-insert=true -u root -p recoeve01 > mydump.sql mysql -u root -p recoeve01 < mydump.sql ```/ Time error 나는거 해결해야 함. ```[.lang-sql] SET GLOBAL sql_mode = "ALLOW_INVALID_DATES"; SELECT @@GLOBAL.sql_mode; SELECT @@SESSION.sql_mode; ```/ ### Timezone ```[.lang-sql] mysql> status; -------------- mysql Ver 8.0.30 for Win64 on x86_64 (MySQL Community Server - GPL) Connection id: 41 Current database: recoeve01 Current user: root@localhost SSL: Cipher in use is TLS_AES_256_GCM_SHA384 Using delimiter: ; Server version: 8.0.30 MySQL Community Server - GPL Protocol version: 10 Connection: localhost via TCP/IP Server characterset: utf8mb4 Db characterset: utf8mb4 Client characterset: utf8mb4 Conn. characterset: utf8mb4 TCP port: 3306 Binary data as: Hexadecimal Uptime: 4 days 2 hours 42 min 13 sec Threads: 3 Questions: 122383 Slow queries: 0 Opens: 537 Flush tables: 3 Open tables: 437 Queries per second avg: 0.344 -------------- ```/ ```[.lang-sql] mysql> SHOW variables like 'c%'; +----------------------------------------------+---------------------------------------------------------+ | Variable_name | Value | +----------------------------------------------+---------------------------------------------------------+ | caching_sha2_password_auto_generate_rsa_keys | ON | | caching_sha2_password_digest_rounds | 5000 | | caching_sha2_password_private_key_path | private_key.pem | | caching_sha2_password_public_key_path | public_key.pem | | character_set_client | utf8mb4 | | character_set_connection | utf8mb4 | | character_set_database | utf8mb4 | | character_set_filesystem | binary | | character_set_results | utf8mb4 | | character_set_server | utf8mb4 | | character_set_system | utf8mb3 | | character_sets_dir | C:\Program Files\MySQL\MySQL Server 8.0\share\charsets\ | | check_proxy_users | OFF | | collation_connection | utf8mb4_0900_ai_ci | | collation_database | utf8mb4_0900_ai_ci | | collation_server | utf8mb4_0900_ai_ci | | completion_type | NO_CHAIN | | concurrent_insert | AUTO | | connect_timeout | 10 | | connection_memory_chunk_size | 8912 | | connection_memory_limit | 18446744073709551615 | | core_file | OFF | | create_admin_listener_thread | OFF | | cte_max_recursion_depth | 1000 | +----------------------------------------------+---------------------------------------------------------+ 24 rows in set (0.14 sec) ```/ ```[.lang-sql] SELECT @@global.time_zone, @@session.time_zone; SET GLOBAL time_zone='+00:00'; SET time_zone='+00:00'; ```/ ## Windows firewall Windows firewall 에서 port 80, 443 access 를 풀어줘야 함. Inbound, Outbound 둘 다 풀어줌. AWS security group 에서도 Inbound Custom TCP port 80, 443 풀어줘야 함. Outbound 는 all traffic 을 풀어줘야 할듯? ## Console (cmd) 한글깨짐 문제 참고 . chcp 65001 (Changes the active console code page. UTF-8) 로 바꿔주는거고, regedit 눌러서 registry 도 변경해줘야 다시 실행했을때도 자동으로 잘 보이는듯. Font 도 한글 보이는 걸로 바꿔줘야 함. ## HTTPS 로 접속되게 ```[.lang-sh] # Certbot 설치 sudo apt install certbot python3-certbot-nginx # Certbot 실행하여 SSL 인증서 발급 및 Nginx 설정 자동 변경 sudo certbot --nginx -d example.com -d www.example.com ```/ ## RRA
  1. kipid's blog - JAVA Windows command (cmd) 한글 깨짐 문제해결
반응형

'[Recoeve.net]' 카테고리의 다른 글

Recoeve.net IR (Investor Relations) 투자 발표  (5) 2025.07.09
Statistics of Recoeve.net  (0) 2025.07.09
Recoeve progress  (14) 2025.07.05
Career Portfolio - 이강수  (0) 2025.07.03
URI rendering test  (2) 2025.04.13
Career Portfolio - Kang-soo Lee  (0) 2025.04.09
Recoeve.net (3S|Slow/Sexy/Sincere SNS) 사용설명서/Manual  (1) 2025.03.17