<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>카페24에서 도메인 연결 &#8211; 준우블로그</title>
	<atom:link href="https://junewoo.com/tag/%EC%B9%B4%ED%8E%9824%EC%97%90%EC%84%9C-%EB%8F%84%EB%A9%94%EC%9D%B8-%EC%97%B0%EA%B2%B0/feed/" rel="self" type="application/rss+xml" />
	<link>https://junewoo.com</link>
	<description>또 하나의 준우블로그 사이트</description>
	<lastBuildDate>Sat, 16 Mar 2024 13:09:19 +0000</lastBuildDate>
	<language>ko-KR</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>
<site xmlns="com-wordpress:feed-additions:1">199246569</site>	<item>
		<title>개인 서버에 Ubuntu LEMP WORDPRESS 설치하기 11</title>
		<link>https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-11/</link>
					<comments>https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-11/#respond</comments>
		
		<dc:creator><![CDATA[cvilla]]></dc:creator>
		<pubDate>Fri, 08 Mar 2024 13:44:47 +0000</pubDate>
				<category><![CDATA[우분투서버 만들기]]></category>
		<category><![CDATA[Nginx에 도메인 연결]]></category>
		<category><![CDATA[아사달에서 도메인 연결]]></category>
		<category><![CDATA[카페24에서 도메인 연결]]></category>
		<guid isPermaLink="false">https://junewoo.com/?p=1679</guid>

					<description><![CDATA[<p>Contents 1. 개인 서버 만들기, 파워, 케이스, 메인보드, CPU쿨러, SSD, 메모리(RAM), CPU 선정과 주문 조립 2. 공유기 설정하기, 공유기1 브릿지 모드 설정, iptime 공유기2 IPTV ... <a title="개인 서버에 Ubuntu LEMP WORDPRESS 설치하기 11" class="read-more" href="https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-11/" aria-label="개인 서버에 Ubuntu LEMP WORDPRESS 설치하기 11에 대해 더 자세히 알아보세요">더 읽어보기</a></p>
<p>The post <a rel="nofollow" href="https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-11/">개인 서버에 Ubuntu LEMP WORDPRESS 설치하기 11</a> appeared first on <a rel="nofollow" href="https://junewoo.com">준우블로그</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Contents</p>
<table style="border-collapse: collapse; width: 100%; height: 375px;">
<tbody>
<tr style="height: 25px;">
<td style="width: 100%; height: 25px;">1. <a href="https://junewoo.com/%EA%B0%9C%EC%9D%B8-%EC%84%9C%EB%B2%84%EC%97%90-ubuntu-lemp-wordpress-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0-1/">개인 서버 만들기, 파워, 케이스, 메인보드, CPU쿨러, SSD, 메모리(RAM), CPU 선정과 주문 조립</a></td>
</tr>
<tr style="height: 25px;">
<td style="width: 100%; height: 25px;"><a href="https://junewoo.com/%EA%B0%9C%EC%9D%B8-%EC%84%9C%EB%B2%84%EC%97%90-ubuntu-lemp-wordpress-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0-2/">2. 공유기 설정하기, 공유기1 브릿지 모드 설정, iptime 공유기2 IPTV 연결 설정<br />
</a></td>
</tr>
<tr style="height: 25px;">
<td style="width: 100%; height: 25px;"><a href="https://junewoo.com/%EA%B0%9C%EC%9D%B8-%EC%84%9C%EB%B2%84%EC%97%90-ubuntu-lemp-wordpress-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0-3/">3. 개인 서버에 Ubuntu 22.04.4 LTS 설치하기, Universal-USB-Installer를 사용하여 부팅 가능한 USB를 생성하기</a></td>
</tr>
<tr style="height: 25px;">
<td style="width: 100%; height: 25px;"><a href="https://junewoo.com/%EA%B0%9C%EC%9D%B8-%EC%84%9C%EB%B2%84%EC%97%90-ubuntu-lemp-wordpress-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0-4/">4. 개인 PC에 우분투 서버 접속용 3가지 SSH 설치, <span style="font-size: inherit; font-family: inherit;">자료실의 Putty, </span>EditPlus, <span style="font-size: inherit; font-family: inherit;">FileZilla 다운 후 설치하기</span></a></td>
</tr>
<tr style="height: 25px;">
<td style="width: 100%; height: 25px;"><a href="https://junewoo.com/%EA%B0%9C%EC%9D%B8-%EC%84%9C%EB%B2%84%EC%97%90-ubuntu-lemp-wordpress-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0-5/">5. 우분투 서버 환경 date 설정하기</a></td>
</tr>
<tr style="height: 25px;">
<td style="width: 100%; height: 25px;"><a href="https://junewoo.com/%EA%B0%9C%EC%9D%B8-%EC%84%9C%EB%B2%84%EC%97%90-ubuntu-lemp-wordpress-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0-6/">6. 웹 서버 Nginx 설치, <span style="font-size: inherit; font-family: inherit;">현재 iptables 규칙 초기화</span></a></td>
</tr>
<tr style="height: 25px;">
<td style="width: 100%; height: 25px;"><a href="https://junewoo.com/%EA%B0%9C%EC%9D%B8-%EC%84%9C%EB%B2%84%EC%97%90-ubuntu-lemp-wordpress-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0-7/">7. Ubuntu sever 폴더 권한 설정, <span style="font-size: inherit; font-family: inherit;">Nginx 페이지의 내용 수정과 권한 설정</span></a></td>
</tr>
<tr style="height: 25px;">
<td style="width: 100%; height: 25px;"><a href="https://junewoo.com/%EA%B0%9C%EC%9D%B8-%EC%84%9C%EB%B2%84%EC%97%90-ubuntu-lemp-wordpress-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0-8/">8. Nginx 서버에 PHP8.3 설치, <span style="font-size: inherit; font-family: inherit;">자주 쓰이는 php8.3 모듈 설치하기</span></a></td>
</tr>
<tr style="height: 25px;">
<td style="width: 100%; height: 25px;"><a href="https://junewoo.com/%EA%B0%9C%EC%9D%B8-%EC%84%9C%EB%B2%84%EC%97%90-ubuntu-lemp-wordpress-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0-9/">9. apt update와 upgrade가 완료 후 mariadb를 설치하기</a></td>
</tr>
<tr style="height: 25px;">
<td style="width: 100%; height: 25px;"><a href="https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-10/">10. MariaDB 관리 도구 phpMyAdmin 설치하기</a></td>
</tr>
<tr style="height: 25px;">
<td style="width: 100%; height: 25px; background-color: #f5db16;"><a href="https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-11/">11. 아사달에서 도메인 연결하기, <span style="font-size: inherit; font-family: inherit;">카페24에서 도메인 연결하기</span></a></td>
</tr>
<tr style="height: 25px;">
<td style="width: 100%; height: 25px;"><a href="https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-12/">12. HTTPS 적용을 위한 SSL 인증서 발급, <span style="font-size: inherit; font-family: inherit;"><span style="font-size: inherit; font-family: inherit;">Nginx에 acme-challenge 폴더 위치를 알리기 위하여 letsencrypt.conf 파일 만들기, </span></span>Let’s Encrypt SSL 발급 받기</a></td>
</tr>
<tr style="height: 25px;">
<td style="width: 100%; height: 25px;"><a href="https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-13/">13. MariaDB에서 데이터베이스(DB) 만들기, phpMyAdmin에서 DB생성</a></td>
</tr>
<tr style="height: 25px;">
<td style="width: 100%; height: 25px;"><a href="https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-14/">14. 워드프레스 설치, 우분투 서버에 ko.wordpress.org/latest-ko_KR.zip 파일 설치, wordpress.zip 파일 압축 풀기, 서버 폴더 소유자 권한 및 사용자 그룹 변경</a></td>
</tr>
<tr style="height: 25px;">
<td style="width: 100%; height: 25px; background-color: #f5f5f0;"><a href="https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-15/">15. 워드프레스 설치 후 환경 설정, 우분투 서버에 wp-config.php에 임시디렉토리 설정, FTP 연결 정보 입력, Putty로 php.ini, nginx.conf를 수정</a></td>
</tr>
</tbody>
</table>
<h2>개인 서버에 Ubuntu LEMP WORDPRESS 설치하기 11</h2>
<p>개인 서버에 Ubuntu sever LEMP(Linux-ubuntu+Nginx+MariaDB-Phpmyadmin+PHP8.3) WORDPRESS 설치하기</p>
<p>Nginx에 도메인을 연결하는 과정은 여러 단계로 이루어집니다. 이 과정을 통해 사용자가 도메인 이름을 입력했을 때, Nginx 서버가 해당 요청을 처리하도록 설정할 수 있습니다. 아래에는 기본적인 도메인 연결 과정을 설명합니다.</p>
<p>도메인 등록 기관에서 도메인을 구매 후, 도메인의 DNS 설정에서 A 레코드를 서버의 외부접속 IP 주소로 설정하여 도메인이 해당 서버를 가리키도록 합니다.</p>
<p>Nginx에서는 가상 호스트를 서버 블록(server block)이라고 합니다. 도메인에 대한 요청을 처리하기 위해 새로운 서버 블록을 설정합니다.</p>
<p>a. Nginx의 설정 파일이 위치한 디렉토리(<code>/etc/nginx/sites-available/</code>)에 새로운 설정 파일을 생성합니다. 파일 이름은 도메인 이름으로 하는 것이 관리에 편리합니다.</p>
<p>b. 생성한 설정 파일에 서버 블록을 구성합니다. 다음은 기본적인 서버 블록 설정의 예시입니다.</p>
<pre id="code_1633400140094" class="bash" style="margin: 20px auto 0px; display: block; overflow: auto; padding: 20px; color: #383a42; background: #f8f8f8; font-size: 14px; font-family: 'SF Mono', Menlo, Consolas, Monaco, monospace; border: 1px solid #ebebeb; line-height: 1.71; cursor: default; z-index: 1; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;" data-ke-language="bash" data-ke-type="codeblock"><code class="hljs">server {
    listen 80;
    server_name example.com www.example.com;

    root /var/www/example.com/html;
    index index.php index.html index.htm index.nginx-debian.html;

    location / {
        try_files $uri $uri/ =404;
    }
}
</code></pre>
<p>&nbsp;</p>
<h2>11-1. 아사달에서 도메인 연결하기</h2>
<p>아사달에서 도메인을 구매 시 ip 포워딩 서비스 신청(junewoo.com 도메인 과 개인 서버 접속 ip&lt;-개인 서버 외부 접속ip(iptime 공유기 외부 접속ip) ) 하시면 도메인 연결 서비스를 제공합니다.</p>
<p>아사달 접속 주소입니다. https://myinfo.asadal.com/domain/</p>
<p><img data-recalc-dims="1" fetchpriority="high" decoding="async" class="alignnone wp-image-1707" src="https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname7.png?resize=860%2C806&#038;ssl=1" alt="" width="860" height="806" srcset="https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname7.png?resize=300%2C281&amp;ssl=1 300w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname7.png?resize=1024%2C959&amp;ssl=1 1024w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname7.png?resize=768%2C719&amp;ssl=1 768w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname7.png?w=1425&amp;ssl=1 1425w" sizes="(max-width: 860px) 100vw, 860px" /></p>
<p>아래에 아사달 도메인 서비스의 내서비스 &gt; 호스팅 연장 클릭 하시면 IP 포워딩 신청이(필자의 경우) 되어있습니다.</p>
<p><img data-recalc-dims="1" decoding="async" class="alignnone wp-image-1708" src="https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname8.png?resize=859%2C418&#038;ssl=1" alt="" width="859" height="418" srcset="https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname8.png?resize=300%2C146&amp;ssl=1 300w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname8.png?resize=1024%2C500&amp;ssl=1 1024w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname8.png?resize=768%2C375&amp;ssl=1 768w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname8.png?resize=1536%2C750&amp;ssl=1 1536w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname8.png?w=1887&amp;ssl=1 1887w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname8.png?w=1720&amp;ssl=1 1720w" sizes="(max-width: 859px) 100vw, 859px" /></p>
<p>IP 포워딩 신청은 고객지원 &gt; 호스팅 문의 게시판에 직접 신청 하셔야 합니다.</p>
<p><img data-recalc-dims="1" decoding="async" class="alignnone wp-image-1709" src="https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname9.png?resize=859%2C553&#038;ssl=1" alt="" width="859" height="553" srcset="https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname9.png?resize=300%2C193&amp;ssl=1 300w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname9.png?resize=1024%2C660&amp;ssl=1 1024w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname9.png?resize=768%2C495&amp;ssl=1 768w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname9.png?resize=1536%2C989&amp;ssl=1 1536w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname9.png?w=1916&amp;ssl=1 1916w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname9.png?w=1720&amp;ssl=1 1720w" sizes="(max-width: 859px) 100vw, 859px" /></p>
<p>서비스 신청 후 서너 시간 뒤에 신청한 게시판에 &#8216;신청하신 *** 설정을 완료하였습니다&#8217; 댓글이 달리게 되면 되신겁니다.</p>
<p>설정이 잘 안되시면 고객센터에  문의 전화를 하시면, 전문 직원이 개인 서버 IP 포워딩에 대해 알려줍니다.</p>
<h2>11-2. 카페24에서 도메인 연결하기</h2>
<p>카페 24에서 구매한 도메인의 경우, 개인 서버로 ip 포워딩은 카페 24홈페이지에 접속해서 직접 설정할 수 있습니다.</p>
<p><a href="https://hosting.cafe24.com/?controller=myservice_domain_vservice&amp;method=dns" target="_blank" rel="noopener">https://hosting.cafe24.com/?controller=myservice_domain_vservice&amp;method=dns</a></p>
<p><img data-recalc-dims="1" loading="lazy" decoding="async" class="alignnone wp-image-1720" src="https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname-3.png?resize=860%2C605&#038;ssl=1" alt="" width="860" height="605" srcset="https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname-3.png?resize=300%2C211&amp;ssl=1 300w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname-3.png?resize=1024%2C721&amp;ssl=1 1024w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname-3.png?resize=768%2C541&amp;ssl=1 768w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname-3.png?resize=1536%2C1082&amp;ssl=1 1536w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname-3.png?w=1991&amp;ssl=1 1991w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname-3.png?w=1720&amp;ssl=1 1720w" sizes="auto, (max-width: 860px) 100vw, 860px" /></p>
<p>&nbsp;</p>
<p>카페 24 &gt; DNS 관리 &gt; 구매 도메인 체크 &gt; <span style="color: #ff0000;">서버 호스팅 DNS관리 &gt; -&gt; <span style="color: #0000ff;">DNS 관리</span> <span style="color: #000000;">로 들어갑니다.</span></span></p>
<p><img data-recalc-dims="1" loading="lazy" decoding="async" class="alignnone wp-image-1722" src="https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname2-1.png?resize=860%2C516&#038;ssl=1" alt="" width="860" height="516" srcset="https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname2-1.png?resize=300%2C180&amp;ssl=1 300w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname2-1.png?resize=1024%2C615&amp;ssl=1 1024w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname2-1.png?resize=768%2C461&amp;ssl=1 768w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname2-1.png?resize=1536%2C923&amp;ssl=1 1536w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname2-1.png?w=2014&amp;ssl=1 2014w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname2-1.png?w=1720&amp;ssl=1 1720w" sizes="auto, (max-width: 860px) 100vw, 860px" /></p>
<p>호스트IP(A 레코드) 관리 체크&gt; + <span style="color: #339966;">A 레코드 추가</span> 버튼을 클릭하면 새 창이 뜹니다.</p>
<p><img data-recalc-dims="1" loading="lazy" decoding="async" class="alignnone wp-image-1717" src="https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname3-1.png?resize=859%2C595&#038;ssl=1" alt="" width="859" height="595" srcset="https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname3-1.png?resize=300%2C208&amp;ssl=1 300w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname3-1.png?resize=1024%2C711&amp;ssl=1 1024w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname3-1.png?resize=768%2C533&amp;ssl=1 768w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname3-1.png?resize=1536%2C1066&amp;ssl=1 1536w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname3-1.png?w=2011&amp;ssl=1 2011w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/noname3-1.png?w=1720&amp;ssl=1 1720w" sizes="auto, (max-width: 859px) 100vw, 859px" /></p>
<p>aiutech.co.kr 는 구메한 도메인 이름이며, IP 포워딩 주소(개인 서버 외부 접속 ip &lt;- PC에서 my ip로 검색)를 입력합니다.</p>
<ul class="list_03 pl10 fs11 dot">
<li>설정하신 DNS정보는 약30분~1시간 후 반영됩니다.</li>
</ul>
<p>이 외에 도메인 관련 구매는 도메인 서비스 회사를 통해서 하며, 그 외 다른 DNS 설정은 본인이 등록하는 도메인 구매 회사의 도움말을 참조하시기 바랍니다.</p>
<h2>11-3. Nginx에 도메인 연결하기</h2>
<p>웹서버인 Nginx에 도메인에 대한 정보를 연결하여 서버의 어떤 위치로 연결하라는 라우팅 설정을 합니다.</p>
<p>Nginx의 라우팅 설정은 이전에 index.php 수정을 하였던 /etc/nginx/sites-available/default 에 위치해 있습니다.</p>
<p>#으로 되어 있는 주석을 제외하고 내용을 보면 현재 이렇게 되어 있습니다.</p>
<pre id="code_1633400140094" class="bash" style="margin: 20px auto 0px; display: block; overflow: auto; padding: 20px; color: #383a42; background: #f8f8f8; font-size: 14px; font-family: 'SF Mono', Menlo, Consolas, Monaco, monospace; border: 1px solid #ebebeb; line-height: 1.71; cursor: default; z-index: 1; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;" data-ke-language="bash" data-ke-type="codeblock"><code class="hljs">server {
	listen 80 default_server;
	listen [::]:80 default_server;

	root /var/www/html;
	index index.php index.html index.htm index.nginx-debian.html;

	server_name _;

	location / {
		try_files $uri $uri/ =404;
	}

	location ~ \.php$ {
		include snippets/fastcgi-php.conf;
		fastcgi_pass unix:/run/php/php7.4-fpm.sock;
		fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
		include fastcgi_params;
		fastcgi_read_timeout 300;
	}

	location ~ /\.ht {
	    deny all;
	}
}</code></pre>
<p>여기서 본인이 구매한 도메인으로 적용하여 보겠습니다.</p>
<p>먼저 server_name _;에 도메인 주소를 적습니다. server_name junewoo.com;</p>
<pre id="code_1633400140094" class="bash" style="margin: 20px auto 0px; display: block; overflow: auto; padding: 20px; color: #383a42; background: #f8f8f8; font-size: 14px; font-family: 'SF Mono', Menlo, Consolas, Monaco, monospace; border: 1px solid #ebebeb; line-height: 1.71; cursor: default; z-index: 1; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;" data-ke-language="bash" data-ke-type="codeblock"><code class="hljs">server {
	listen 80 default_server;
	listen [::]:80 default_server;

	root /var/www/html;
	index index.php index.html index.htm index.nginx-debian.html;

	<span style="color: #ff0000;">server_name junwqoo.com;</span></code></pre>
<p>EditPlus 에서  /etc/nginx/sites-available/default 수정이 안되시는 분은 파일 사용자 권한을 ubuntu가 가져올 수 있도록 하시기 바랍니다.</p>
<p>명령창에 sudo chgrp ubuntu /etc/nginx/sites-available/default 를 입력합니다.</p>
<p>명령창에 sudo chmod 775 /etc/nginx/sites-available/default 를 입력합니다.</p>
<pre id="code_1633400140094" class="bash" style="margin: 20px auto 0px; display: block; overflow: auto; padding: 20px; color: #383a42; background: #f8f8f8; font-size: 14px; font-family: 'SF Mono', Menlo, Consolas, Monaco, monospace; border: 1px solid #ebebeb; line-height: 1.71; cursor: default; z-index: 1; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;" data-ke-language="bash" data-ke-type="codeblock"><code class="hljs">junewoo@cvilla:~$ sudo chgrp ubuntu /etc/nginx/sites-available/default
junewoo@cvilla:~$ sudo chmod 775 /etc/nginx/sites-available/default</code></pre>
<p>작성을 완성하셨으면 Nginx 서버를 재 시작 합니다.</p>
<p>명령창에 sudo nginx -t 과 sudo service nginx restart 를 입력합니다.</p>
<p>sudo nginx -t를 입력했을 때, <b>~ </b>syntax is ok 와 <b>~ </b>test is successful 이 나오면 잘 수정이 된 것입니다.</p>
<pre id="code_1633400140094" class="bash" style="margin: 20px auto 0px; display: block; overflow: auto; padding: 20px; color: #383a42; background: #f8f8f8; font-size: 14px; font-family: 'SF Mono', Menlo, Consolas, Monaco, monospace; border: 1px solid #ebebeb; line-height: 1.71; cursor: default; z-index: 1; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;" data-ke-language="bash" data-ke-type="codeblock"><code class="hljs">junewoo@cvilla:~$ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
junewoo@cvilla:~$ </code></pre>
<p>이번에는 www를 연결해 보겠습니다.</p>
<h2>11-4. CNAME이라 불리는 서브 도메인이나, 도메인 앞의 www를 연결하는 방법입니다.</h2>
<p>http://junewoo.com 주소와 http://www.junewoo.com 주소가 반드시 일치한다는 법은 없습니다.</p>
<p>어느 사이트에서는 www는 영어로 kor은 한국어로 cn은 중국어로 앞에 붙여서 사용하기도 합니다.</p>
<p>이건 서브 도메인이라고 도메인 DNS 관리시에 Type A에 붙여서 사용하는 경우입니다.</p>
<p>여기서는 www를 CNAME으로 해서 target을 itreport.tk 로 잡았습니다.</p>
<p>이번에는 www.junewoo.com로 접속된 도메인은 junewoo.com으로 연결되도록 설정해 봅니다.</p>
<p>location ~ / location ~ /\.ht {<br />
deny all;<br />
}<br />
}<br />
하단 부에<br />
server {<br />
listen 80;<br />
listen [::]:80;<br />
server_name www.itreport.tk;</p>
<p>location / {<br />
return 301 http://junewoo.com$request_uri;     ### http://junewoo.com  로 리다이렉트<br />
}<br />
}</p>
<p>위 명령어를 EditPlus에서 defaul파일에 복사 붙여 넣기를 합니다.</p>
<p>명령어 구분을 하기 위하여 주석(###)을 먼저 붙이고 시작합니다.</p>
<pre id="code_1633400140094" class="bash" style="margin: 20px auto 0px; display: block; overflow: auto; padding: 20px; color: #383a42; background: #f8f8f8; font-size: 14px; font-family: 'SF Mono', Menlo, Consolas, Monaco, monospace; border: 1px solid #ebebeb; line-height: 1.71; cursor: default; z-index: 1; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;" data-ke-language="bash" data-ke-type="codeblock"><code class="hljs">     location ~ / location ~ /\.ht {
          deny all;
    }
}
### HTTP (CNAME 연결 www.junewoo.com to junewoo.com ) ###
server {
    listen 80;
    listen [::]:80; 
    server_name www.itreport.tk;       

    location / {  
        return 301 http://junewoo.com$request_uri;     ### http://junewoo.com  로 리다이렉트 
     }
}</code></pre>
<p>그러면 default 파일의 내용이 아래와 같이 됩니다.</p>
<pre id="code_1633400140094" class="bash" style="margin: 20px auto 0px; display: block; overflow: auto; padding: 20px; color: #383a42; background: #f8f8f8; font-size: 14px; font-family: 'SF Mono', Menlo, Consolas, Monaco, monospace; border: 1px solid #ebebeb; line-height: 1.71; cursor: default; z-index: 1; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;" data-ke-language="bash" data-ke-type="codeblock"><code class="hljs"># Default s그럼 default 파일의 내용이 아래와 같이 됩니다.erver configuration
server {
	listen 80 default_server;
	listen [::]:80 default_server;

	root /var/www/html;
	index index.php index.html index.htm index.nginx-debian.html;

	server_name junewoo.com;

	location / {
		try_files $uri $uri/ =404;
		}
	}

	location ~ \.php$ {
		include snippets/fastcgi-php.conf;
		fastcgi_pass unix:/run/php/php8.3-fpm.sock;
		fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
		include fastcgi_params;
		fastcgi_read_timeout 300;
	}

	location ~ /\.ht {
	    deny all;
	}
}

### HTTP (CNAME 연결 www.junewoo.com to junewoo.com ) ###
 server {
    listen 80;
    listen [::]:80; 
    server_name www.junewoo.com;

    location / { 
        return 301 http://junewoo.com$request_uri;     ### http://junewoo.com 로 리다이렉팅 
    }
}</code></pre>
<p>작성을 완성한 뒤 Nginx 서버를 재 시작해 줍니다.</p>
<p>명령창에 sudo nginx -t 과 sudo service nginx restart 를 입력합니다.</p>
<p>다음으로 현재 없는 도메인 주소를 웹 브라우저에서 찾을 때 에러 표시 방법입니다.</p>
<h2>11-5. 도메인 주소가 변경되어 해당 내용이 없는 경우 보통 404 Error를 표시합니다 만, 여기 서는 특정 주소로 이동하도록 합니다.</h2>
<p>해당 인터넷 URL과 관련된 파일이 없을 경우에 무조건 나타내주는 Page를 이동시킬 수 있습니다.</p>
<p>아래 404 페이지 부분가 나타는데 이렇게 하지 않고 메인 페이지로 이동하도록 하는 경우입니다.</p>
<p>try_files $uri $uri/ =404; 하단에 아래와 같이 작성해 줍니다.</p>
<p>if (!-e $request_filename) {<br />
rewrite ^.*$ /index.php last;<br />
}</p>
<p>그러면 index.php로 이동하게 됩니다.</p>
<pre id="code_1633400140094" class="bash" style="margin: 20px auto 0px; display: block; overflow: auto; padding: 20px; color: #383a42; background: #f8f8f8; font-size: 14px; font-family: 'SF Mono', Menlo, Consolas, Monaco, monospace; border: 1px solid #ebebeb; line-height: 1.71; cursor: default; z-index: 1; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;" data-ke-language="bash" data-ke-type="codeblock"><code class="hljs">	server_name junewoo.com;

	location / {
		# First attempt to serve request as file, then
		# as directory, then fall back to displaying a 404.
		try_files $uri $uri/ =404;
	       <span style="color: #ff0000;">if (!-e $request_filename) { 
                rewrite ^.*$ /index.php last;
                }</span>	
	}</code></pre>
<p>작성을 완성하셨으면 Nginx 서버를 재 시작합니다.</p>
<p>명령창에 sudo nginx -t 과 sudo service nginx restart 를 입력합니다.</p>
<pre id="code_1633400140094" class="bash" style="margin: 20px auto 0px; display: block; overflow: auto; padding: 20px; color: #383a42; background: #f8f8f8; font-size: 14px; font-family: 'SF Mono', Menlo, Consolas, Monaco, monospace; border: 1px solid #ebebeb; line-height: 1.71; cursor: default; z-index: 1; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;" data-ke-language="bash" data-ke-type="codeblock"><code class="hljs">junewoo@cvilla:~$ <span style="color: #ff0000;">sudo nginx -t</span>
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
junewoo@cvilla:~$ <span style="color: #ff0000;">sudo service nginx restart</span></code></pre>
<p>다음에는 HTTPS 적용을 위한 SSL 인증서 발급 받기입니다.</p>
<h2><a href="https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-12/">12. 개인 서버에 Ubuntu LEMP WORDPRESS 설치하기</a></h2>
<div class='kakaotalk_link' style='float:right;'><a href="javascript:SendKakao('준우블로그', '개인 서버에 Ubuntu LEMP WORDPRESS 설치하기 11', 'https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-11/');"><img data-recalc-dims="1" src="https://i0.wp.com/junewoo.com/wp-content/plugins/kakao-talk-link/kakaotalk.png?w=860&#038;ssl=1" alt='Smart phone only'></a></div><div class="korea-sns"><div class="korea-sns-post korea-sns-pos-left"><div class="korea-sns-button korea-sns-facebook" OnClick="SendSNS('facebook', '개인 서버에 Ubuntu LEMP WORDPRESS 설치하기 11 - 준우블로그', 'https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-11/', '', 0);"  style="background-image:url('https://junewoo.com/wp-content/plugins/korea-sns/icons/facebook.png');"></div><div class="korea-sns-button korea-sns-twitter" OnClick="SendSNS('twitter', '개인 서버에 Ubuntu LEMP WORDPRESS 설치하기 11 - 준우블로그', 'https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-11/', '', 0);"  style="background-image:url('https://junewoo.com/wp-content/plugins/korea-sns/icons/twitter.png');"></div><div class="korea-sns-button korea-sns-telegram" OnClick="SendSNS('telegram', '개인 서버에 Ubuntu LEMP WORDPRESS 설치하기 11 - 준우블로그', 'https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-11/', '', 0);"  style="background-image:url('https://junewoo.com/wp-content/plugins/korea-sns/icons/telegram.png');"></div><div class="korea-sns-button korea-sns-naverband" OnClick="SendSNS('naverband', '개인 서버에 Ubuntu LEMP WORDPRESS 설치하기 11 - 준우블로그', 'https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-11/', '', 0);"  style="background-image:url('https://junewoo.com/wp-content/plugins/korea-sns/icons/naverband.png');"></div><div class="korea-sns-button korea-sns-naverblog" OnClick="SendSNS('naverblog', '개인 서버에 Ubuntu LEMP WORDPRESS 설치하기 11 - 준우블로그', 'https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-11/', '', 0);"  style="background-image:url('https://junewoo.com/wp-content/plugins/korea-sns/icons/naverblog.png');"></div><div class="korea-sns-button korea-sns-copyurl" OnClick="SendSNS('copyurl', '개인 서버에 Ubuntu LEMP WORDPRESS 설치하기 11 - 준우블로그', 'https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-11/', '', 0);"  style="background-image:url('https://junewoo.com/wp-content/plugins/korea-sns/icons/copyurl.png');"></div></div><div style="clear:both;"></div></div><p>The post <a rel="nofollow" href="https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-11/">개인 서버에 Ubuntu LEMP WORDPRESS 설치하기 11</a> appeared first on <a rel="nofollow" href="https://junewoo.com">준우블로그</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-11/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1679</post-id>	</item>
	</channel>
</rss>
