우분투 아파치 기본캐릭터셋 UTF-8 설정 편집하기

경고: 로그인하지 않았습니다. 편집을 하면 IP 주소가 공개되게 됩니다. 로그인하거나 계정을 생성하면 편집자가 사용자 이름으로 기록되고, 다른 장점도 있습니다.

편집을 취소할 수 있습니다. 이 편집을 되돌리려면 아래의 바뀐 내용을 확인한 후 게시해주세요.

최신판 당신의 편집
1번째 줄: 1번째 줄:
{{다른뜻|CentOS 아파치 기본캐릭터셋 UTF-8 설정}}
==개요==
{{테스트|Ubuntu 14, Apache 2.4}}
;아파치 기본캐릭터셋 UTF-8 설정
;아파치 기본캐릭터셋 UTF-8 설정
;아파치 AddDefaultCharset UTF-8


==확인==
==확인==
;실제 동작 확인
;실제 동작 확인
<syntaxhighlight lang='console'>
<source lang='cli'>
root@zetawiki:~# echo hello > /var/www/html/greet.html
root@zetawiki:~# echo hello > /var/www/html/greet.html
root@zetawiki:~# curl -s -I http://localhost/greet.html
root@zetawiki:~# curl -s -I http://localhost/greet.html
17번째 줄: 15번째 줄:
Content-Length: 6
Content-Length: 6
Content-Type: text/html
Content-Type: text/html
</syntaxhighlight>
</source>
:→ 헤더에 캐릭터셋 정보 없음
:→ 헤더에 캐릭터셋 정보 없음


;설정 파일 확인
;설정 파일 확인
<syntaxhighlight lang='console'>
<source lang='cli'>
root@zetawiki:~# grep DefaultCharset /etc/apache2/conf-enabled/charset.conf
root@zetawiki:~# grep DefaultCharset /etc/apache2/conf-enabled/charset.conf
# Read the documentation before enabling AddDefaultCharset.
# Read the documentation before enabling AddDefaultCharset.
#AddDefaultCharset UTF-8
#AddDefaultCharset UTF-8
</syntaxhighlight>
</source>
:→ 주석처리되어 있음
:→ 주석처리되어 있음


==charset.conf 수정==
==charset.conf 수정==
*/etc/apache2/conf-enabled/charset.conf 파일에 있는 UTF-8 설정 주석 해제
*/etc/apache2/conf-enabled/charset.conf 파일에 있는 UTF-8 설정 주석 해제
<syntaxhighlight lang='console'>
<source lang='cli'>
root@zetawiki:~# vi /etc/apache2/conf-enabled/charset.conf
root@zetawiki:~# vi /etc/apache2/conf-enabled/charset.conf
</syntaxhighlight>
</source>
<syntaxhighlight lang='apacheconf' highlight='6'>
<source lang='autoconf' highlight='6'>
# Read the documentation before enabling AddDefaultCharset.
# Read the documentation before enabling AddDefaultCharset.
# In general, it is only a good idea if you know that all your files
# In general, it is only a good idea if you know that all your files
42번째 줄: 40번째 줄:


# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
</syntaxhighlight>
</source>
 
==아파치 재시작==
<syntaxhighlight lang='console'>
root@zetawiki:~# /etc/init.d/apache2 restart
* Restarting web server apache2                                                              [ OK ]
</syntaxhighlight>
 
==확인 2==
<syntaxhighlight lang='console'>
root@zetawiki:~# curl -s -I http://localhost/greet.html
HTTP/1.1 200 OK
Date: Fri, 02 Oct 2015 06:44:45 GMT
Server: Apache
Last-Modified: Fri, 02 Oct 2015 06:35:07 GMT
ETag: "6-521195d548626"
Accept-Ranges: bytes
Content-Length: 6
Content-Type: text/html; charset=UTF-8
</syntaxhighlight>
:→ 캐릭터셋이 UTF-8로 나옴


==같이 보기==
==같이 보기==
*[[CentOS 아파치 기본캐릭터셋 UTF-8 설정]]
*[[아파치 DefaultCharset 확인]]
*[[아파치 DefaultCharset 확인]]
*[[/etc/apache2/conf-enabled/charset.conf]]
*[[/etc/apache2/conf-enabled/charset.conf]]


[[분류: 아파치]]
[[분류: 아파치]]
[[분류: Ubuntu]]
[[분류: UTF-8]]

제타위키에서의 모든 기여는 크리에이티브 커먼즈 저작자표시-동일조건변경허락 3.0 라이선스로 배포된다는 점을 유의해 주세요(자세한 내용에 대해서는 제타위키:저작권 문서를 읽어주세요). 만약 여기에 동의하지 않는다면 문서를 저장하지 말아 주세요.
또한, 직접 작성했거나 퍼블릭 도메인과 같은 자유 문서에서 가져왔다는 것을 보증해야 합니다. 저작권이 있는 내용을 허가 없이 저장하지 마세요!

취소 편집 도움말 (새 창에서 열림)

이 문서에서 사용한 틀: