# 보유한 도메인으로 변경

### 📋 준비물

* 클라우드플레어 계정 (<https://dash.cloudflare.com>)
* 연결하고자 하는 도메인 (ex. `mydomain.com`) \
  (화면에  출력되는 도메인 주소는 에스앤에스웍스 가이드 전용 도메인입니다.)
* Hostyle에서 받은 **서버 IP 주소**\
  **(대시보드 -> Cpanel바로가기 -> 우측 Shared IP Address)**

<figure><img src="/files/rqSa9NGPKIDpEtNoDWxR" alt=""><figcaption></figcaption></figure>

***

### 🧭 1단계: Cloudflare 계정 만들기

1. <https://dash.cloudflare.com> 접속
2. 이메일, 비밀번호 입력 → **무료 계정 생성**
3. 로그인 후 **\[사이트 추가]** 클릭 → 보유한 도메인 입력\
   예: `mydomain.com`

<figure><img src="/files/GIX26tGZPKHrKbBgsUru" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/5zLsBa3tRJRHG996lhzN" alt=""><figcaption></figcaption></figure>

***

### 🗂️ 2단계: DNS 레코드 등록

Cloudflare에서 DNS 설정을 수동으로 입력합니다.

| 유형 | 이름  | 값 (Hostyle 서버 IP) | 프록시     |
| -- | --- | ----------------- | ------- |
| A  | @   | `123.123.123.123` | 활성화 🌥️ |
| A  | www | `123.123.123.123` | 활성화 🌥️ |

> 🔸 `@`는 루트 도메인 (`mydomain.com`)을 의미합니다.\
> 🔸 구름(Proxy) 아이콘이 주황색이면 Cloudflare 보호가 켜져 있는 상태입니다.

<figure><img src="/files/2QMeEnGN5276CsGExqHJ" alt=""><figcaption></figcaption></figure>

***

### 🌐 3단계: 도메인 네임서버(NS) 변경

Cloudflare가 제공하는 **네임서버 주소(NS)** 를 도메인 등록처에 입력해야 합니다.

예: Cloudflare에서 아래와 같이 안내될 수 있음

```
diff복사편집Change your nameservers to:
- elle.ns.cloudflare.com
- josh.ns.cloudflare.com
```

→ 아래와 같이 네임서버 등록처에 설정 (ex. 가비아, 호스팅케이알, Namecheap 등)

<figure><img src="/files/UT6fAoIH6yHioPVclV4u" alt=""><figcaption><p>도메인 구입처 마다 네임서버(NS / NameServer) 설정하는곳은 다릅니다.</p></figcaption></figure>

***

### ✅ 4단계: DNS 전파 대기

* 일반적으로 5분\~1시간 내 적용되며, 최대 24시간 소요될 수 있습니다.
* 확인 요청은 하단 '지금 이름 서버 확인' 을 누르면 가능합니다.

<figure><img src="/files/thXZKoZPgCBmqGfZ3xX7" alt=""><figcaption></figcaption></figure>

***

### 🔒 5단계: HTTPS(SSL) 설정 확인

Cloudflare는 무료 SSL을 자동 제공합니다.

1. Cloudflare → **SSL/TLS 탭** 클릭
2. 모드는 `Full (전체)` 또는 `Full (Strict) [전체(엄격)]`으로 설정 권장

> `Flexible (가번)` 모드는 일부 PHP 앱에서 비정상 작동할 수 있으므로 비추천

<figure><img src="/files/PW5LGeftHkcovjttWi0B" alt=""><figcaption></figcaption></figure>

***

### 🛠️ 6단계:  cPanel에서 사용자 도메인 추가

#### 🧾 도메인 등록은 끝났지만, cPanel에서 해당 도메인을 인식시켜야 합니다.

> Cloudflare에서 A레코드로 연결을 해도,\
> **cPanel에서 해당 도메인을 "호스팅 설정" 해줘야 웹파일이 연결**됩니다.

### 1. cPanel 접속 → **\[Domains (도메인)]** 클릭

<figure><img src="/files/EWP9gV6Hij4u9tILCvxw" alt=""><figcaption></figcaption></figure>

### 2. \[Create A New Domain] 버튼 클릭

<figure><img src="/files/8izTbDQ8flHuXgbIypOP" alt=""><figcaption></figcaption></figure>

### 3. 아래 항목 입력

| 항목             | 예시                               |
| -------------- | -------------------------------- |
| 도메인            | `mydomain.com`                   |
| Document Root  | `/public_html/mydomain` ← 자동 입력됨 |
| 하위도메인으로 만들건가요? | ❌ 체크 해제 (루트 도메인일 경우)             |

> ✅ "Share document root"는 체크 ❌\
> 기본값으로 사용 권장

#### ✅ Share document root 사용이 적합한 경우

* 단일 사이트를 여러 도메인에서 접근하게 하고 싶은 경우
  * 예: `cfow.dev`, `www.cfow.dev`, `snsworks2.hostyle.me` 모두 같은 홈페이지
* 유지/관리가 간편한 게 우선인 경우
* 사이트를 테스트/미러링하는 도메인이라면 적합

<figure><img src="/files/y62C9L0yzqIU91vHh8ej" alt=""><figcaption></figcaption></figure>

***

#### ❗️Share document root 를 해제해야 할 때

* 도메인별로 서로 다른 콘텐츠, 테마, 프로젝트를 운영할 계획이라면 **반드시 체크 해제**해야 합니다.
* 예: `cfow.dev`는 PHP 기반 포트폴리오, `snsworks2.hostyle.me`는 워드프레스라면 **분리 필요**
* /public\_html/cflow\.dev 으로 사용시 <https://cflow.dev> 접속시 /public\_html/cflow\.dev 폴더의 index.html 또는 index.php 파일이 메인 으로 출력됩니다.

<figure><img src="/files/x871cB1vfiP0ia7ULUmn" alt=""><figcaption></figcaption></figure>

***

### 4. \[제출] 클릭 → 도메인 등록 완료

* `public_html/mydomain.com` 경로가 자동 생성됨 (상단 Share document root를 해제했을경우)
* 이 폴더에 `index.php`, `style.css` 등 파일을 업로드하면 사이트 작동!

<figure><img src="/files/zcGWjBHYf2TZZZVn41h7" alt=""><figcaption></figcaption></figure>

***

### 🏁 완료! 이제 도메인 접속 가능

* 브라우저에서 `https://mydomain.com` 입력 → index.php / html 페이지 확인
* `cPanel` → `Domains` 또는 `SSL/TLS`에서 연결 상태도 확인 가능

***

### 🧪 확인 테스트 체크리스트

| 항목                       | 체크 |
| ------------------------ | -- |
| 도메인 접속 시 Hostyle 서버로 연결됨 | ✅  |
| http → https 자동 전환       | ✅  |
| Cloudflare Proxy 활성화 상태  | ✅  |
| ping 결과 Hostyle 서버 IP 일치 | ✅  |

***

#### ❗️주의사항

* DNS가 아직 이전되지 않았다면 기존 서비스에 접속될 수 있습니다.
* `www.mydomain.com`과 `mydomain.com`이 모두 연결되었는지 확인하세요.
* 기존 도메인에 워드프레스 설치 이력이 있다면 `public_html` 내용 정리 후 업로드 필요

<figure><img src="/files/6Ze7qRXJruhIZAVTpqNF" alt=""><figcaption><p>Cpanel에 도메인이 미등록시 경고 발생</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://s-organization-887.gitbook.io/hostyle-web/undefined-1/undefined-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
