"우분투 아파치 기본캐릭터셋 UTF-8 설정"의 두 판 사이의 차이

28번째 줄: 28번째 줄:
==charset.conf 수정==
==charset.conf 수정==
*/etc/apache2/conf-enabled/charset.conf 파일에 있는 UTF-8 설정 주석 해제
*/etc/apache2/conf-enabled/charset.conf 파일에 있는 UTF-8 설정 주석 해제
<source lang='bash'>
<source lang='cli'>
vi /etc/apache2/conf-enabled/charset.conf
root@zetawiki:~# vi /etc/apache2/conf-enabled/charset.conf
</source>
</source>
<source lang='autoconf' highlight='6'>
<source lang='autoconf' highlight='6'>

2015년 10월 2일 (금) 15:42 판

1 개요

아파치 기본캐릭터셋 UTF-8 설정

2 확인

실제 동작 확인
root@zetawiki:~# echo hello > /var/www/html/greet.html
root@zetawiki:~# curl -s -I http://localhost/greet.html
HTTP/1.1 200 OK
Date: Fri, 02 Oct 2015 06:35:15 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
→ 헤더에 캐릭터셋 정보 없음
설정 파일 확인
root@zetawiki:~# grep DefaultCharset /etc/apache2/conf-enabled/charset.conf
# Read the documentation before enabling AddDefaultCharset.
#AddDefaultCharset UTF-8
→ 주석처리되어 있음

3 charset.conf 수정

  • /etc/apache2/conf-enabled/charset.conf 파일에 있는 UTF-8 설정 주석 해제
root@zetawiki:~# vi /etc/apache2/conf-enabled/charset.conf
# Read the documentation before enabling AddDefaultCharset.
# In general, it is only a good idea if you know that all your files
# have this encoding. It will override any encoding given in the files
# in meta http-equiv or xml encoding tags.

AddDefaultCharset UTF-8

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

4 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}