[1] Nginx 서버 셋업 - Virtualbox 설치 및 Putty 연결



테스트용 Linux 셋업을 위해 가상환경 설치 진행
VMWare를 쓸려햇는데 가입이 귀찮게 되어있어 VirtualBox로 선회

### 셋업 환경
- window10 

### 설치

## 1. VirtualBox - Download

<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXGNSu5E1hlTqSe3iFQWEpiOxEN7eEosBCtdLD4pfwfX6c-PO9pFjcMLAWeT0qzIYcuxa4FwFjaH4fN8cZaIAqn3UB8g0yAgkmXocH9xBuHGzGrEbdb6T6-IK2y-pK9_4OujriHOc0yKlfmDkhWS4KwG-G2wnaFxmzEDBP86HowoMzAqnGaKQCyU88/s1600/1.PNG" style="display: block; padding: 1em 0; text-align: center; "><img alt="virtualbox download" border="0" data-original-height="605" data-original-width="1317" loading="lazy" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXGNSu5E1hlTqSe3iFQWEpiOxEN7eEosBCtdLD4pfwfX6c-PO9pFjcMLAWeT0qzIYcuxa4FwFjaH4fN8cZaIAqn3UB8g0yAgkmXocH9xBuHGzGrEbdb6T6-IK2y-pK9_4OujriHOc0yKlfmDkhWS4KwG-G2wnaFxmzEDBP86HowoMzAqnGaKQCyU88/s1600-rw/1.PNG"/></a></div>

- https://www.virtualbox.org/wiki/Downloads
- 위 경로에서 다운로드 진행 ( OS에 맞게 설치, widnows hosts 로 진행 ) 

---

<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipmGzcl3Etvjn_jz4LNsU1WrJAxSrO_WJEpXXu0pb8QE_H_nwQNwMPNxWESRcsVDAA1W8pmC9QwAlJTRgPbNlNlA9pCAFcrNVe8IJqvucTCauNw0K-acoKNfowi5ZQGzd_Hg02p7BhRoS_ux3r4nPMKxh24AlyAFJC642sFy3Qi0a4Au8QEI8szvlh/s1600/2.PNG" style="display: block; padding: 1em 0; text-align: center; "><img alt="virtualbox download" border="0" data-original-height="392" data-original-width="495" loading="lazy" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipmGzcl3Etvjn_jz4LNsU1WrJAxSrO_WJEpXXu0pb8QE_H_nwQNwMPNxWESRcsVDAA1W8pmC9QwAlJTRgPbNlNlA9pCAFcrNVe8IJqvucTCauNw0K-acoKNfowi5ZQGzd_Hg02p7BhRoS_ux3r4nPMKxh24AlyAFJC642sFy3Qi0a4Au8QEI8szvlh/s1600-rw/2.PNG"/></a></div>

- 다운로드 이후 설치 진행

---

## 2. RHEL(RedHat Enterprise Linux) OS 다운로드
CentOS를 주로썼지만 EOL (End of Line) 으로 이제는 RHEL쓰기를 권장

- https://developers.redhat.com/products/rhel/download (24.11.02 기준 9.4 version)
- RHEL을 무료로 사용하려면 Individual Developer Subscription에 등록해야 하고 등록 비용은 발생하지 않는다.

---

## 3. VirtualBox - RHEL 가상머신 만들기

1. 머신 > 새로 만들기 
ㄴ 저장소 경로 설정

<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhW_tM1mSUjnL_1o7MjHsitC6SJImfG3ticP_b9JWbIBCMQkVfXiySlQ3Ae25ZHFICM5lov5MQ1rYKBcUhwvW1Fvy_E0NJSSRSoePxF0uDc9aw7eIvhs7rJD92RqylstqDDYyVe_8DGqPYyBrkOnhOH9-JxR_HkeEMl26OjMN4E1ht89P45-J0G3oco/s1600/3.PNG" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" data-original-height="550" data-original-width="1273" loading="lazy" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhW_tM1mSUjnL_1o7MjHsitC6SJImfG3ticP_b9JWbIBCMQkVfXiySlQ3Ae25ZHFICM5lov5MQ1rYKBcUhwvW1Fvy_E0NJSSRSoePxF0uDc9aw7eIvhs7rJD92RqylstqDDYyVe_8DGqPYyBrkOnhOH9-JxR_HkeEMl26OjMN4E1ht89P45-J0G3oco/s1600-rw/3.PNG"/></a></div>

---

2. VM 비밀번호 셋업

<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUBlzzAzOm1Y5NxXJNoutXvCtUFZmv-S-97qJODjrJ4G8be95wp_pVcBt43VGML-x7JN4aW525R3kMdGuURjKbJ5nUjDz3GkqQHPTV_2hPKH3A4qYlQvAbzqgAWyGcXgx0Frty1lzhrq2dTOLX2rmUb9j8sgbJPvqgkjlTNU7h23zcU7E4wT6rkVnj/s1600/4.PNG" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" data-original-height="550" data-original-width="1275" loading="lazy" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUBlzzAzOm1Y5NxXJNoutXvCtUFZmv-S-97qJODjrJ4G8be95wp_pVcBt43VGML-x7JN4aW525R3kMdGuURjKbJ5nUjDz3GkqQHPTV_2hPKH3A4qYlQvAbzqgAWyGcXgx0Frty1lzhrq2dTOLX2rmUb9j8sgbJPvqgkjlTNU7h23zcU7E4wT6rkVnj/s1600-rw/4.PNG"/></a></div>

---

3. 가상머신 리소스 할당
ㄴ 사용 컴퓨터에 따라 동적으로 변함. 저는 4core / 8GB 할당함 (20GB)

<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQhkohwde5zibM-yJypU13AzMdB0P1oel9NlwHsuNo0-nuz-QeTO-QT7QIuvCvBWldMyDrsadERv8XMfqviCe1aDaJQ33eg2QRcwmp2rsRk-n2njP580uxY-rLloUbyTN5oQsxMmNGULYSX7rRGNfhlHAiYZMyvvRKeuDTFebqY3ZtPJoN-92r2hOO/s1600/5.PNG" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" data-original-height="546" data-original-width="1272" loading="lazy" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQhkohwde5zibM-yJypU13AzMdB0P1oel9NlwHsuNo0-nuz-QeTO-QT7QIuvCvBWldMyDrsadERv8XMfqviCe1aDaJQ33eg2QRcwmp2rsRk-n2njP580uxY-rLloUbyTN5oQsxMmNGULYSX7rRGNfhlHAiYZMyvvRKeuDTFebqY3ZtPJoN-92r2hOO/s1600-rw/5.PNG"/></a></div>

<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNHeCrjtQZ2AEJjLcoFjTNRC86XlElnBSAGj76rIUMGgRxZaBxCIcApaNE789LzcdwLDg7VtyDQ2aRSfvbh6ex-YGPZOACODqTNbqdIglLsgt79Oe3Tqim32zYB4zw07XSF8PsmCpOG17g6gzVp5GYFROHtHxhz_VV4g_6RxCrLyt5aI7h6r0kzt55/s1600/7.PNG" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" data-original-height="537" data-original-width="795" loading="lazy" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNHeCrjtQZ2AEJjLcoFjTNRC86XlElnBSAGj76rIUMGgRxZaBxCIcApaNE789LzcdwLDg7VtyDQ2aRSfvbh6ex-YGPZOACODqTNbqdIglLsgt79Oe3Tqim32zYB4zw07XSF8PsmCpOG17g6gzVp5GYFROHtHxhz_VV4g_6RxCrLyt5aI7h6r0kzt55/s1600-rw/7.PNG"/></a></div>

<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjT8tdNvZTUkFcj4ylk1HVt4tm-YXbonb9445-VfODvoCqWftrmgc_CB7EY6-PwmDhYevv57ur5MRYdFltOmbwAjNNS9T3C-C2RmpuCqj89PmajKNFxRUd_1cig25CVsCrY0SP55lLaf2eHBQ2DMOwPV9FwabghHQNhUPgLdRPDLM8GiwlhPiSrEi1I/s1600/9.PNG" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" data-original-height="541" data-original-width="804" loading="lazy" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjT8tdNvZTUkFcj4ylk1HVt4tm-YXbonb9445-VfODvoCqWftrmgc_CB7EY6-PwmDhYevv57ur5MRYdFltOmbwAjNNS9T3C-C2RmpuCqj89PmajKNFxRUd_1cig25CVsCrY0SP55lLaf2eHBQ2DMOwPV9FwabghHQNhUPgLdRPDLM8GiwlhPiSrEi1I/s1600-rw/9.PNG"/></a></div>

---

4. 소프트웨어 확인 (GUI 시스템은 필요없어서 제거)

<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNJaVOIfeY54chl50ekwH9WqyH8hAW_-dDvyIIAAgIy0PxI8d9vcmhrjKXjVG83_Wn-2XbIYF1XfC1VUKEBxyKizOEcsTEimwNjBmqDatfia_o8gE7Zvj986gTZzeibHBJdqyUe-EJhxqp1umAwXwRxA02RQKw4494pbtPmbrBkItkc24DNDkAjXn1/s1600/10.PNG" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" data-original-height="787" data-original-width="1288" loading="lazy" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNJaVOIfeY54chl50ekwH9WqyH8hAW_-dDvyIIAAgIy0PxI8d9vcmhrjKXjVG83_Wn-2XbIYF1XfC1VUKEBxyKizOEcsTEimwNjBmqDatfia_o8gE7Zvj986gTZzeibHBJdqyUe-EJhxqp1umAwXwRxA02RQKw4494pbtPmbrBkItkc24DNDkAjXn1/s1600-rw/10.PNG"/></a></div>

---

5. 접속 확인

<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvuQrM6NogSLnHRXQY1q9tfV9VpzaT3vMRTJMf1HZVhGbgHGKWZx9JndCbxJQozxhk3ySvsXq5XizNuwaWE9cewoUNO8COTc6anlrJfeuyHeZqbC3c4EKzP8YdjMd0Y8rcgTZmlabjtGkiKN-cJ_tfqISGDrSPmniNPxXWpu6B_181WfzcSs9UkZOt/s1600/11.PNG" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" data-original-height="255" data-original-width="711" loading="lazy" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvuQrM6NogSLnHRXQY1q9tfV9VpzaT3vMRTJMf1HZVhGbgHGKWZx9JndCbxJQozxhk3ySvsXq5XizNuwaWE9cewoUNO8COTc6anlrJfeuyHeZqbC3c4EKzP8YdjMd0Y8rcgTZmlabjtGkiKN-cJ_tfqISGDrSPmniNPxXWpu6B_181WfzcSs9UkZOt/s1600-rw/11.PNG"/></a></div>

---

## 4. Putty 연결

아래 사항 확인 
### 4-1.VM 설정에서 확인 사항

<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLL8qpNKwUUhSfyQiLKIrQbVXLkAZNw5V2fQHT166vY-o040NhXKyUkxwIGc25605gcwJjIZMUQrsFKu4Zz30kv-OHama4nks5vsliBVBMeXSDeUglBocN4Y6zwyih1QRA5XfAeQREWJW_FG3Au5E3zJSH02_S9zsEkoirgcESTfeHlKx2nODGKg8b/s1600/13.PNG" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" data-original-height="442" data-original-width="1334" loading="lazy" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLL8qpNKwUUhSfyQiLKIrQbVXLkAZNw5V2fQHT166vY-o040NhXKyUkxwIGc25605gcwJjIZMUQrsFKu4Zz30kv-OHama4nks5vsliBVBMeXSDeUglBocN4Y6zwyih1QRA5XfAeQREWJW_FG3Au5E3zJSH02_S9zsEkoirgcESTfeHlKx2nODGKg8b/s1600-rw/13.PNG"/></a></div>

```
1. VirtualBox를 실행하고 연결할 가상 머신을 선택한 후 설정
2. 네트워크 탭 이동 > 어댑터 1을 NAT로 설정한 후 고급 옵션
3. 포트 포워딩 규칙 설정

이름: 원하는 이름 입력 (예: SSH)
호스트 포트: 9999 (또는 사용하지 않는 포트)
게스트 포트: 22 (기본 SSH 포트, 고정)

ex)
putty -(9999 port)> VM -(22 port)> Linux
```

---

### 4-2. VM 내부에서 필요한 설정 수정
- ssh 서버 다운로드 및 실행

```
sudo yum install -y openssh-server // 설치
sudo systemctl start sshd // 실행
sudo systemctl enable sshd // 자동시작 설정

```

- 방화벽 설정

```
sudo firewall-cmd --permanent --add-port=22/tcp
sudo firewall-cmd --reload
```


- 접속 설정 수정

```
sudo vi /etc/ssh/sshd_config

파일내부에서 수정 ( VI 에서 '/문구' 로 찾고 'a' 눌러서 수정, ESC 이후 ':w' )

#PermitRootLogin $value -> PermitRootLogin yes로 변경 (id가 root일 경우 필요함)
#PasswordAuthentication yes -> PasswordAuthentication yes로 변경 
( # 제거 및 yes 변경 ) 

sudo systemctl restart sshd 설정 반영

```

- 접속 확인 

<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhT_Uridv769Ut7gGBMCxcr9OCF3kG16KKAshyphenhyphenbRikoxF20y1D_xgx-oUzKVnlM0Xa64u6GQ0X5rHy8zie4DU5y5j-1Y6V1AgXQeOk70uvxxT7foA5xHi6SxPVu_UjxZy-LruvXCnrT_6mXewN1nF4EmMSvStDqZh4SoxmxtfRUcO8xGxUbBStn8Gb4/s1600/12.PNG" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" data-original-height="411" data-original-width="659" loading="lazy" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhT_Uridv769Ut7gGBMCxcr9OCF3kG16KKAshyphenhyphenbRikoxF20y1D_xgx-oUzKVnlM0Xa64u6GQ0X5rHy8zie4DU5y5j-1Y6V1AgXQeOk70uvxxT7foA5xHi6SxPVu_UjxZy-LruvXCnrT_6mXewN1nF4EmMSvStDqZh4SoxmxtfRUcO8xGxUbBStn8Gb4/s1600-rw/12.PNG"/></a></div>

---

<!-- 목록을 표시할 HTML 컨테이너 -->
<div>
    <h3>Related Links</h3>
    <ul id="label-post-list">
        <!-- 여기에 게시물 목록이 추가됩니다 -->
    </ul>
</div>

---

<!-- 목록을 표시할 HTML 컨테이너 -->
<div>
    <h3>Recommended Link</h3>
    <ul id="label-post-list-include">
        <!-- 여기에 게시물 목록이 추가됩니다 -->
    </ul>
</div>

---


댓글

이 블로그의 인기 게시물

윤석열 계엄령 선포! 방산주 대폭발? 관련주 투자 전략 완벽 분석

대통령 퇴진운동 관련주: 방송·통신·촛불수혜주 완벽 분석

키움 OPEN API MFC 개발 (1)